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

Add ExecutionPayloadHeader to LC data #3151

Merged
merged 33 commits into from
Jan 17, 2023
Merged

Add ExecutionPayloadHeader to LC data #3151

merged 33 commits into from
Jan 17, 2023

Conversation

etan-status
Copy link
Contributor

While the light client sync protocol currently provides access to the
latest BeaconBlockHeader, obtaining the matching execution data needs
workarounds such as downloading the full block.

Having ready access to the EL state root simplifies use cases that need
a way to cross-check eth_getProof responses against LC data.

Access to block_hash unlocks scenarios where a CL light client drives
an EL without engine_newPayload. As of Altair, only the CL beacon
block root is available, but the EL block hash is needed for engine API.

Other fields in the ExecutionPayloadHeader such as logs_bloom may
allow light client applications to monitor blocks for local interest,
e.g. for transfers affecting a certain wallet. This enables to download
only the few relevant blocks instead of every single one.

A new LightClientStore is proposed into the Capella spec that may be
used to sync LC data that includes execution data. Existing pre-Capella
LC data will remain as is, but can be locally upgraded before feeding it
into the new LightClientStore so that light clients do not need to run
a potentially expensive fork transition at a specific time. This enables
the LightClientStore to be upgraded at a use case dependent timing at
any time before Capella hits. Smart contract and embedded deployments
benefit from reduced code size and do not need synchronization with the
beacon chain clock to perform the Capella fork.

Introduce `get_lc_beacon_slot` and `get_lc_beacon_root` accessors
similar to `get_current_slot(state)` to account for future extensions
to the light client header structure that may override how those fields
are accessed. Idea is to extend with execution accessors in the future.
While the light client sync protocol currently provides access to the
latest `BeaconBlockHeader`, obtaining the matching execution data needs
workarounds such as downloading the full block.

Having ready access to the EL state root simplifies use cases that need
a way to cross-check `eth_getProof` responses against LC data.

Access to `block_hash` unlocks scenarios where a CL light client drives
an EL without `engine_newPayload`. As of Altair, only the CL beacon
block root is available, but the EL block hash is needed for engine API.

Other fields in the `ExecutionPayloadHeader` such as `logs_bloom` may
allow light client applications to monitor blocks for local interest,
e.g. for transfers affecting a certain wallet. This enables to download
only the few relevant blocks instead of every single one.

A new `LightClientStore` is proposed into the Capella spec that may be
used to sync LC data that includes execution data. Existing pre-Capella
LC data will remain as is, but can be locally upgraded before feeding it
into the new `LightClientStore` so that light clients do not need to run
a potentially expensive fork transition at a specific time. This enables
the `LightClientStore` to be upgraded at a use case dependent timing at
any time before Capella hits. Smart contract and embedded deployments
benefit from reduced code size and do not need synchronization with the
beacon chain clock to perform the Capella fork.
@etan-status
Copy link
Contributor Author

make clean && make install_test && make lint succeeds locally — the files highlighted by CI are not changed by this PR, so possibly spurious. Maybe resolves itself after next merge from dev.

@hwwhww
Copy link
Contributor

hwwhww commented Jan 5, 2023

the files highlighted by CI are not changed by this PR, so possibly spurious. Maybe resolves itself after next merge from dev.

@etan-status
Sorry about that; we are integrating and debugging the new GitHub Actions CI. The CircleCI jobs still covered all the tests including lint, which is all green now. ✅

etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 15, 2023
Implements the proposed light client data format for Capella:
- ethereum/consensus-specs#3151
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 15, 2023
Implements the proposed light client data format for Capella:
- ethereum/consensus-specs#3151
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 15, 2023
Implements the proposed light client data format for EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 15, 2023
Implements the light client data format for Capella / EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 15, 2023
Implements the light client data format for Capella / EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 15, 2023
Implements the light client data format for Capella / EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 15, 2023
Implements the light client data format for Capella / EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 15, 2023
Implements the light client data format for Capella / EIP4844:
- ethereum/consensus-specs#3151
Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lgtm!

etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 16, 2023
Implements the proposed light client data format for Capella:
- ethereum/consensus-specs#3151
@etan-status
Copy link
Contributor Author

Implemented in Nimbus: status-im/nimbus-eth2#4514

etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 16, 2023
Implements the proposed light client data format for EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 16, 2023
Implements the proposed light client data format for EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 16, 2023
Implements the proposed light client data format for EIP4844:
- ethereum/consensus-specs#3151
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! well done @etan-status 👏

@hwwhww hwwhww merged commit 521de12 into ethereum:dev Jan 17, 2023
@etan-status etan-status deleted the lc-eph branch January 17, 2023 13:34
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 18, 2023
Implements the proposed light client data format for Capella:
- ethereum/consensus-specs#3151
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 18, 2023
Implements the proposed light client data format for EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Jan 19, 2023
Implements the proposed light client data format for EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 26, 2023
Implements the light client data format for Capella / EIP4844:
- ethereum/consensus-specs#3151
etan-status added a commit to etan-status/beacon-APIs that referenced this pull request Jan 26, 2023
Implements the light client data format for Capella:
- ethereum/consensus-specs#3151
rolfyone pushed a commit to ethereum/beacon-APIs that referenced this pull request Jan 28, 2023
Implements the light client data format for Capella:
- ethereum/consensus-specs#3151
Ingridmichelledev added a commit to Ingridmichelledev/API-beacons that referenced this pull request Mar 3, 2023
Implements the light client data format for Capella:
- ethereum/consensus-specs#3151
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.

5 participants