feat: Execution layer fast sync - #5425
Conversation
# Conflicts: # Cargo.lock # ethexe/common/src/network.rs # ethexe/consensus/src/connect/mod.rs # ethexe/consensus/src/validator/initial.rs # ethexe/network/src/db_sync/mod.rs # ethexe/network/src/db_sync/requests.rs # ethexe/network/src/db_sync/responses.rs # ethexe/network/src/lib.rs # ethexe/service/src/fast_sync.rs # ethexe/service/src/lib.rs
# Conflicts: # Cargo.lock # ethexe/service/src/lib.rs # utils/gear-workspace-hack/Cargo.toml
…malachite-errors # Conflicts: # ethexe/compute/src/compute.rs # ethexe/malachite/service/src/externalities.rs
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request replaces the custom Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request replaces the custom request/response db_sync protocol with a Bitswap-backed content fetching mechanism in ethexe-network and implements the actual fast synchronization logic for MB-driven ethexe nodes in ethexe-service. It also introduces a fast-sync replay filter in Malachite to suppress outbound events during startup replay, updates event builders to support block range queries, and integrates the demo-mul-by-const program for testing. Feedback on these changes highlights a potential network behaviour stall in the Bitswap polling implementation due to an immediate return of Poll::Pending after a ready event, which should be resolved with a loop. Additionally, a redundant block size check was identified in Blockstore::get, and opportunities for improvement were noted in fast_sync.rs to fetch program state hashes concurrently and to avoid panics by propagating decoding errors as Result instead of using .expect().
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 261ed3ee2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…malachite-errors # Conflicts: # ethexe/malachite/service/src/externalities.rs
Base integration of `gsobol/ethexe/tune-malachite-errors` (Malachite error-handling rework) into `al/ethexe/bitswap`, with bitswap's Malachite-crate changes dropped in favour of tune's. This models the state after `tune → master → al/ethexe/bitswap` and is the base for the separate `gsobol/ethexe/bitswap-malachite` redesign PR. - ethexe/malachite/*, ethexe/compute/* → tune's versions (prerequisite EB gating still lives inside Malachite externalities here). - ethexe/service/* → bitswap's bitswap-network + fast-sync feature set, adapted to tune's Malachite API (MalachiteServiceStarter, receive_new_eb / receive_eb_synced / receive_eb_prepared, Stream<Result<MalachiteEvent>>). bitswap's now-removed replay-filter wiring is dropped. NOTE: fast sync has no replay suppression on this branch yet, so the `fast_sync` integration test is expected to stall here — that is exactly what the `bitswap-malachite` PR fixes by relocating the prerequisite gate into ethexe-compute and adding an app-level replay gate. `cargo fmt`, `cargo clippy` and compilation are clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EgjaE68s3nARWKBCa4Jid1
…chite Replaces the in-Malachite fast-sync replay filter with a layered design, on top of `gsobol/ethexe/al-bitswap` (al/ethexe/bitswap + tune-malachite-errors). A pure app-level "wait for BlockFinalized(target)" gate is impossible against tune's externalities: `try_emit_or_queue` head-of-line-blocks the event queue on an unprepared prerequisite EB, so the target event would never reach the app. So the prerequisite gate is moved out of Malachite: - Malachite externalities no longer queue events behind a prepared-EB prerequisite (try_emit_or_queue / pending_events / drain_pending_events / prerequisite_satisfied removed; receive_eb_prepared gone). process_mb_* emit immediately and strictly in order. - ethexe-compute now owns the "defer an MB until the EB it advances to is prepared" gate (ComputeSubService::deferred + receive_prepared_block), scanning all deferred requests on each BlockPrepared since the prepare sub-service only reports the chain head; defer-at-launch avoids head-of-line blocking ready requests. - The service applies an app-level ReplayGate after fast sync: it suppresses replayed BlockProposals until the committed target MB is reached (by hash for a fresh DB, or via a one-shot ancestry walk when the target was already finalized locally before start), then resumes live consensus. A missing CompactMb mid-walk fails loudly instead of hanging. cargo fmt, cargo clippy and cargo nextest run -p "ethexe-*" all pass (543 tests, incl. the fast_sync integration test). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EgjaE68s3nARWKBCa4Jid1
# Conflicts: # ethexe/malachite/core/src/config.rs # ethexe/malachite/core/src/externalities.rs # ethexe/malachite/core/src/lib.rs # ethexe/malachite/core/src/service.rs # ethexe/malachite/core/src/store.rs # ethexe/malachite/core/tests/multi_validators.rs # ethexe/malachite/service/src/config.rs # ethexe/malachite/service/src/externalities.rs # ethexe/malachite/service/src/lib.rs # ethexe/malachite/service/src/service.rs # ethexe/malachite/service/tests/restart_resilience.rs # ethexe/service/src/lib.rs # ethexe/service/src/tests/utils/env.rs
… into al/ethexe/bitswap # Conflicts: # ethexe/common/src/primitives.rs # ethexe/compute/src/compute.rs # ethexe/compute/src/lib.rs # ethexe/malachite/core/src/app.rs # ethexe/malachite/core/src/config.rs # ethexe/malachite/core/src/lib.rs # ethexe/malachite/core/src/service.rs # ethexe/malachite/core/src/store.rs # ethexe/malachite/core/tests/multi_validators.rs # ethexe/malachite/service/src/config.rs # ethexe/malachite/service/src/externalities.rs # ethexe/malachite/service/src/lib.rs # ethexe/malachite/service/src/service.rs # ethexe/malachite/service/src/starter.rs # ethexe/malachite/service/src/types.rs # ethexe/malachite/service/tests/restart_resilience.rs # ethexe/service/src/fast_sync.rs # ethexe/service/src/lib.rs # ethexe/service/src/tests/utils/env.rs
# Conflicts: # Cargo.lock # ethexe/malachite/core/src/config.rs # ethexe/malachite/core/src/lib.rs # ethexe/malachite/core/src/service.rs # ethexe/malachite/core/tests/multi_validators.rs # ethexe/malachite/service/src/config.rs # ethexe/malachite/service/src/lib.rs # ethexe/malachite/service/src/starter.rs # ethexe/network/src/gossipsub.rs # ethexe/network/src/lib.rs # ethexe/service/src/lib.rs # ethexe/service/src/tests/utils/env.rs
Summary
Replace
db-syncprotocol with thin wrapper forbitswapprotocolHow to test
Run
ethexe_service::tests::fast_syncNotes
db-syncis gone.Checklist
type(scope): description)Closes #5435
Closes #4812