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 domain snap sync algorithm #3027

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

shamil-gadelshin
Copy link
Member

@shamil-gadelshin shamil-gadelshin commented Sep 16, 2024

This PR introduces several important pieces for domain snap sync implementation (#3026): snap sync orchestrator and domain snap sync algorithm. This PR continues the discussion on the algorithm implementation highlighting the current decisions. It lacks the final integration in the code both at consensus and domain chain sides, proper configuration changes, and several security guarantees discussed previously.

The first commit introduces the SnapSyncOrchestrator - a synchronization manager that arranges correctly processes in both consensus and domain chains. 2-4 commits modify the existing code and add a structure to pass to the domain snap-sync algorithm introduced in the commit 5. The last (6) commit has an updated Cargo.lock placed separately to simplify the review.

Known future algorithm changes

  • change state block acquisition from downloading from remote peers to local derivation from consensus block
  • simple acquisition of the last confirmed domain block execution receipt must be replaced with the correct consensus protocol similar to segment headers acquisition
  • MMR data should be verified against the state (MMR roots)
  • introduce changes for MMR sync algorithm to work with "five segments lag" (see commit 3 and FINALIZATION_DEPTH_IN_SEGMENTS constant): modify MMR gadget to use archived blocks instead of finalized blocks.

Code contributor checklist:

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good, but I don’t understand the snap sync algorithm enough to fully review it.

Cargo.lock Outdated Show resolved Hide resolved
domains/client/domain-operator/src/snap_sync.rs Outdated Show resolved Hide resolved
Base automatically changed from modify-mmr-sync to main September 17, 2024 09:24
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, I don't think I'm familiar enough with the algorithm to approve, but it looks reasonable to me.

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.

3 participants