Commit Graph

13 Commits

Author SHA1 Message Date
Etan Kissling dd65aa0cb2
Gossip additional `LightClientFinalityUpdate` on new supermajority
When new finality is reached without supermajority sync committee
support, trigger another event push on beacon-API and libp2p once
the new finality gains supermajority support.

Without this, if the first `LightClientFinalityUpdate` that advances
finality has low participation, light clients monitoring gossip would
likely get stuck until the next time when finality advances (1 epoch).

Thanks to @DragonDev1906 for reporting this issue to Nimbus:

- https://github.com/status-im/nimbus-eth2/issues/5491
2023-11-14 22:28:16 -08:00
Hsiao-Wei Wang 2b2ffb5229
Merge pull request #3190 from etan-status/lc-headerwrapper
Add `LightClientHeader` wrapper
2023-01-13 00:40:44 +08:00
GeemoCandama d23d0147c8
Update p2p-interface.md
fixed typo
2023-01-07 14:28:12 -06:00
Etan Kissling 5c64a2047a
Add `LightClientHeader` wrapper
In Altair, light client sync protocol exchanges `BeaconBlockHeader`
structures for tracking current progress. Wrapping `BeaconBlockHeader`
inside a `LightClientHeader` allows future extensions of this header,
e.g., to also track `ExecutionPayloadHeader`.

Note: This changes the JSON REST format by adding a `beacon` nesting.
For SSZ, the serialization format stays same (but overall root changes).
2023-01-05 13:36:04 +01:00
Etan Kissling 0fb2447a95
Merge branch 'dev' into lc-blockfuncs 2022-11-19 12:20:18 +01:00
Michael Sproul 897b97990f
Further clarify light client slot checks 2022-11-11 22:09:33 +11:00
Michael Sproul dae1011194
Fix typos
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
2022-11-09 09:41:21 +11:00
Michael Sproul 91de8a09f3
Fix slot checks in light client p2p spec 2022-11-08 17:06:07 +11:00
Etan Kissling 08ff71688f
Merge branch 'dev' into lc-blockfuncs 2022-11-07 15:03:20 +01:00
Etan Kissling ff0e525ecc
Pass blocks to LC data creation functions
Future light client protocol extensions may include data from the block
in addition to data from the state, e.g., `ExecutionPayloadHeader`.
To prepare for this, also pass the block to the corresponding functions.
In practice, blocks access is easier than historic state access, meaning
there are no practical limitations due to this change.
2022-10-28 22:14:25 +02:00
Etan Kissling c399e11aa7
Document how to derive fork context for LC gossip
For LC gossip, the documentation did not specify what slot number to use
for deriving the gossip objects. This missing documentation is now added
to document using `attested_header.slot`.
2022-10-27 21:23:09 +02:00
Etan Kissling 52a741f7c6
Improve grammar
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
2022-07-25 15:46:29 +02:00
Etan Kissling 56363cd94a
Define libp2p protocol for light client sync
While the current Altair specs define structures to aid light client
development, one missing key aspect is the network protocol definition.

Certain implementations have started defining their own REST based APIs,
e.g., Lodestar at https://github.com/ChainSafe/lodestar/blob/master/packages/api/src/routes/lightclient.ts
While such APIs are useful, REST does not seem to be the ideomatic
choice as the sole API available at such a low level for Ethereum.

This patch introduces a libp2p based protocol to allow light clients to
sync to the latest `BeaconBlockHeader` in a trustless and decentralized
manner, building on top of prior work from:
- @hwwhww at https://github.com/ethereum/consensus-specs/pull/2267
- @jinfwhuang at https://github.com/ethereum/consensus-specs/pull/2786
- Lodestar's REST API (also has an endpoint to fetch merkle proofs!)
2022-07-22 17:56:41 +02:00