Root next_sync_committee in attested_header#2932
Merged
hwwhww merged 8 commits intoethereum:devfrom Jul 12, 2022
etan-status:lc-attestedroot
Merged
Root next_sync_committee in attested_header#2932hwwhww merged 8 commits intoethereum:devfrom etan-status:lc-attestedroot
next_sync_committee in attested_header#2932hwwhww merged 8 commits intoethereum:devfrom
etan-status:lc-attestedroot
Conversation
`LightClientUpdate` structures currently use different merkle proof root depending on the presence of `finalized_header`. By always rooting it in the same state (the `attested_header.state_root`), logic gets simpler. Caveats: - In periods of extended non-finality, `update.finalized_header` may now be outdated by several sync committee periods. The old implementation rejected such updates as the `next_sync_committee` in them was stale, but the new implementation can properly handle this case. - The `next_sync_committee` can no longer be considered finalized based on `is_finality_update`. Instead, waiting until `finalized_header` is in the `attested_header`'s sync committee period is now necessary. - Because `update.finalized_header > store.finalized_header` no longer holds (for updates with finality), an `is_better_update` helper is added to improve `best_valid_update` tracking (in the past, finalized updates with supermajority participation would always directly apply) This PR builds on prior work from: - @hwwhww at #2829
hwwhww
reviewed
Jul 8, 2022
Contributor
hwwhww
left a comment
There was a problem hiding this comment.
epic work!
I haven't looked into the new test cases. will do another round.
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
hwwhww
approved these changes
Jul 11, 2022
| @@ -42,13 +42,18 @@ def get_sync_aggregate(spec, state, signature_slot=None): | |||
| committee_indices = compute_committee_indices(spec, signature_state) | |||
Contributor
There was a problem hiding this comment.
note to myself: out of the scope of this PR, compute_committee_indices helper doesn't need spec parameter at all.
29 tasks
1 task
hujw77
added a commit
to darwinia-network/darwinia-messages-sol
that referenced
this pull request
Sep 28, 2022
hackfisher
pushed a commit
to darwinia-network/darwinia-messages-sol
that referenced
this pull request
Nov 29, 2022
* replace import_next_sync_committee to sync_committee_period_update * Root `next_sync_committee` in `attested_header`, ref: ethereum/consensus-specs#2932 * use body hash verify `latest_execution_payload_state_root` * sync_committee_period_update after it's finalized * revert * test * verify update does not skip a sync committee period * test beacon light client updates * skip import too old state * test beacon light client match spec * test beacon light client match spec * test beacon api * test beacon light client match prater * test beacon light client match mainnet * comment * comment * change interface * update BeaconLCMandatoryReward * deploy new beacon light client * using lodestar ssz * change interface * beacon lc e2e test * finish beacon lc e2e test * update deps * rm log * rm log * beacon light client migrator * compile blc migrator * add block_number in light client * flatten * deploy bnlc migrator * bnlc migrate script * update flatten * test migrator * migrate bnlc testnet * root next_sync_committee in attested_header * migrate bnlc on testnet * match spec test * migrate on mainnet * migrate on mainnet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LightClientUpdatestructures currently use different merkle proof rootdepending on the presence of
finalized_header. By always rooting it inthe same state (the
attested_header.state_root), logic gets simpler.Caveats:
update.finalized_headermay nowbe outdated by several sync committee periods. The old implementation
rejected such updates as the
next_sync_committeein them was stale,but the new implementation can properly handle this case.
next_sync_committeecan no longer be considered finalized basedon
is_finality_update. Instead, waiting untilfinalized_headerisin the
attested_header's sync committee period is now necessary.update.finalized_header > store.finalized_headerno longerholds (for updates with finality), an
is_better_updatehelper isadded to improve
best_valid_updatetracking (in the past, finalizedupdates with supermajority participation would always directly apply)
This PR builds on prior work from:
next_sync_committee_branchverification and remove active header #2829