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

serve libp2p protocol for light client sync #3341

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

etan-status
Copy link
Contributor

@etan-status etan-status commented Jan 29, 2022

This extends the --serve-light-client-data launch option to serve
locally collected light client data via libp2p.
Backfill of historic best LightClientUpdate is not yet implemented.
See ethereum/consensus-specs#2802

@etan-status etan-status changed the title implement server side of libp2p protocol for light client sync implement server side of light client sync libp2p protocol Jan 29, 2022
@github-actions
Copy link

github-actions bot commented Jan 29, 2022

Unit Test Results

     12 files  ±0     834 suites  ±0   54m 20s ⏱️ +13s
1 686 tests ±0  1 638 ✔️ ±0    48 💤 ±0  0 ±0 
9 825 runs  ±0  9 713 ✔️ ±0  112 💤 ±0  0 ±0 

Results for commit 178ba5d. ± Comparison against base commit e7d017b.

♻️ This comment has been updated with latest results.

@etan-status
Copy link
Contributor Author

Rebased to unstable, updated spec URLs for 1.1.9, and re-phrased epochBoundarySlot helper documentation.

@etan-status
Copy link
Contributor Author

Fixed time delay of broadcasting OptimisticLightClientUpdate, it was combined with attestations and sync committee messages, but those may fire earlier than 1/3 of slot. OptimisticLightClientUpdate is always sent at 1/3.

Extended sendBeaconBlock REST/JSON-RPC API to send the OptimisticLightClientUpdate as well.

Avoid "No optimistic light client update for proposed block" log when proposing pre-Altair block.

@zah zah deleted the branch status-im:unstable February 15, 2022 20:57
@zah zah closed this Feb 15, 2022
@etan-status etan-status reopened this Feb 15, 2022
@etan-status
Copy link
Contributor Author

@etan-status
Copy link
Contributor Author

  • Updated sync_protocol for latest style (early return for step == 0 / count == 0 case, and trace before throwing exception).

@etan-status etan-status force-pushed the lc-libp2p branch 2 times, most recently from e7d4f50 to 1753bfd Compare February 17, 2022 15:29
@etan-status
Copy link
Contributor Author

Thanks to @arnetheduck for the detailed review!

  • Document GeneralizedIndex constants in altair.nim.

  • Add new option --import-light-client-data=on-demand to compute historic light client data on demand instead of at startup. May lead to missed validator duties.

  • Replace --import-historic-light-client-data=false with --import-light-client-data=only-new.

  • Replace --import-historic-light-client-data=true with --import-light-client-data=full.

  • Harden initBestLightClientUpdateForPeriod / initLightClientBootstrapForPeriod for untrusted period input.

  • Move light client database initialization from blockchain_dag.nim into blockchain_dag_light_client.nim.

  • Move light client specifics from block_pools_types.nim into block_pools_types_light_client.nim.

  • Wrap light client database objects into LightClientDatabase and renamed field names to be a bit shorter.

  • Re-use StateCache when operating on multiple states in loops.

  • Avoid caching of unnecessary data in edge cases during light client database initialization.

  • Use version 0 for libp2p protocol IDs to signify this being for a pre-release specification.

  • Move handleProposal changes to call side, and renamed didPropose to didSubmitBlock.

@etan-status
Copy link
Contributor Author

  • Update test instructions in PR description for new command line options.

@etan-status
Copy link
Contributor Author

  • Tag new libp2p req/rsp endpoints to be served only when the --serve-light-client-data is specified. See eth2_network.nim changes.

@etan-status etan-status changed the title implement server side of light client sync libp2p protocol serve libp2p protocol for light client sync Mar 17, 2022
@etan-status etan-status marked this pull request as ready for review March 17, 2022 15:50
@etan-status
Copy link
Contributor Author

  • Rebase to unstable - this leaves only the Req/Resp changes in this PR :)

@etan-status
Copy link
Contributor Author

  • Rebase to unstable (Option -> Opt for LightClientBoostrap endpoint)

This extends the `--serve-light-client-data` launch option to serve
locally collected light client data via libp2p.
Backfill of historic best `LightClientUpdate` is not yet implemented.
See ethereum/consensus-specs#2802
@etan-status
Copy link
Contributor Author

  • Remove step parameter from BestLightClientUpdatesByRange message
  • Replace unreachable serveLightClientData checks with asserts

@etan-status etan-status merged commit b2b7b0b into status-im:unstable Mar 22, 2022
@etan-status etan-status deleted the lc-libp2p branch March 22, 2022 20:23
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.

4 participants