Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update light client specifications for Electra #3811

Merged
merged 10 commits into from
Jul 19, 2024

Conversation

etan-status
Copy link
Contributor

Electra introduces two changes that affect light client data handling:

  1. The ExecutionPayloadHeader is extended with new fields. This is handled similarly as before with the Deneb fork.

  2. The BeaconState generalized indices change due to lack of EIP-6493. This is handled by making the generalized index be fork dependent via a helper function that computes it dynamically. Furthermore, the case where pre-Electra light client data is consumed by an Electra based LightClientStore requires normalizing the shorter proof of the pre-Electra data to fit into the Electra data structure by prepending a zero hash.

Electra introduces two changes that affect light client data handling:

1. The `ExecutionPayloadHeader` is extended with new fields.
   This is handled similarly as before with the Deneb fork.

2. The `BeaconState` generalized indices change due to lack of EIP-6493.
   This is handled by making the generalized index be fork dependent via
   a helper function that computes it dynamically. Furthermore, the case
   where pre-Electra light client data is consumed by an Electra based
   `LightClientStore` requires normalizing the shorter proof of the
   pre-Electra data to fit into the Electra data structure by prepending
   a zero hash.
@etan-status
Copy link
Contributor Author

consensus-spec-tests-3811.zip

etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jun 21, 2024
Add missing Electra support for light client protocol:

- ethereum/consensus-specs#3811

Tested against PR consensus-spec-tests, the test runner automatically
picks up the new tests once available.
execution_branch = ExecutionBranch(
compute_merkle_proof(block.message.body, EXECUTION_PAYLOAD_GINDEX))
else:
# Note that during fork transitions, `finalized_header` may still point to earlier forks.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far in Ethereum networks we have aligned fork epochs to light-client sync periods. Under what circumstance could that happen then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The head advances into the new fork before the finalized cp does. there is a short transition period during which the finalized header has to be normalized into the new datatype.

tersec pushed a commit to status-im/nimbus-eth2 that referenced this pull request Jun 26, 2024
* extend light client protocol for Electra

Add missing Electra support for light client protocol:

- ethereum/consensus-specs#3811

Tested against PR consensus-spec-tests, the test runner automatically
picks up the new tests once available.

* workaround `version-2-0`: `Error: cannot instantiate: 'SomeUnsignedInt'`

* fix initialization when Electra not scheduled

* try reduce stack size in test

* put correct sync committee branch version into DB

* adjust fork schedule in light client data tests

* further reduce stack size

* split function into multiple parts

* rename variable

* regenerate test reports to cover new Electra tests

* add Nim bug reference
Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thank you @etan-status for your solid work again!

@hwwhww hwwhww merged commit a42d670 into ethereum:dev Jul 19, 2024
18 checks passed
@etan-status etan-status deleted the lc-electra branch July 19, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants