Skip to content

Conversation

arnetheduck
Copy link
Member

@arnetheduck arnetheduck commented Feb 3, 2023

By pre-seeding the sync committee cache when applying blocks, we avoid a significantly expensive validator set traversal / sync committee index construction during sync / block application - 20-30% sync speedup post-altair.

  • also cache/reload total active balances in EpochRef for another 10:ish %

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

Unit Test Results

         9 files  ±0    1 062 suites  ±0   32m 54s ⏱️ + 2m 24s
  3 552 tests ±0    3 315 ✔️ ±0  237 💤 ±0  0 ±0 
15 401 runs  ±0  15 136 ✔️ ±0  265 💤 ±0  0 ±0 

Results for commit 0a071a2. ± Comparison against base commit c81352c.

♻️ This comment has been updated with latest results.

By pre-seeding the sync committee cache when applying blocks, we avoid a
significantly expensive validator set traversal / sync committee index
construction during sync / block application - 20-30% sync speedup
post-altair.
also cache/reload total active balance for another cool 10%
@arnetheduck arnetheduck merged commit 98db005 into unstable Feb 7, 2023
@arnetheduck arnetheduck deleted the sync-comm-cache branch February 7, 2023 10:22
etan-status added a commit that referenced this pull request Mar 31, 2024
When initializing from a state that's not aligned to an epoch boundary,
an earlier state is loaded that's epoch aligned, and subsequently topped
up with the missing blocks. `dag.headSyncCommittee` is initialized prior
to topping up the missing blocks, though. If the sync committee changes
while applying the blocks (e.g., a sync committee period boundary hits),
the cached information becomes unlinked from `dag.head`, leading to
valid blocks based on that chain being rejected. To fix this, move cache
initialization after the top up with blocks. This has been observed on
Goerli by initializing from 7919502 and attempting to top up 7920111.
The block gets rejected with an invalid state root on nodes that have
restarted after setting 7920111 as head, while it gets accepted by all
other nodes. Error message is `block: state root verification failed`.
The incorrect initialization behaviour was introduced in #4592, before
which the sync committee cache was initialized after applying blocks.
etan-status added a commit that referenced this pull request Apr 3, 2024
…ate (#6160)

When initializing from a state that's not aligned to an epoch boundary,
an earlier state is loaded that's epoch aligned, and subsequently topped
up with the missing blocks. `dag.headSyncCommittee` is initialized prior
to topping up the missing blocks, though. If the sync committee changes
while applying the blocks (e.g., a sync committee period boundary hits),
the cached information becomes unlinked from `dag.head`, leading to
valid blocks based on that chain being rejected. To fix this, move cache
initialization after the top up with blocks. This has been observed on
Goerli by initializing from 7919502 and attempting to top up 7920111.
The block gets rejected with an invalid state root on nodes that have
restarted after setting 7920111 as head, while it gets accepted by all
other nodes. Error message is `block: state root verification failed`.
The incorrect initialization behaviour was introduced in #4592, before
which the sync committee cache was initialized after applying blocks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants