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

feat(runner): Enable starting testnet follower from state-sync #105

Merged
merged 3 commits into from
Mar 15, 2023

Conversation

mhofman
Copy link
Member

@mhofman mhofman commented Mar 14, 2023

This change adds an option in preparation of Agoric/agoric-sdk#3769 to allow the testnet runner to join using a state-sync snapshot instead of catching up from genesis. This will be exercised in the CI deployment integration test once https://github.com/Agoric/agoric-sdk/compare/mhofman/5542-export-state-sync gets merged.

I have locally verified that these changes together are sufficient for that test to use state-sync (using agoric-sdk's run-deployment-integration.sh script)

@mhofman mhofman requested a review from michaelfig March 14, 2023 14:15
Comment on lines +242 to +243
Number(currentBlockInfo.result.block.header.height) -
stateSyncInterval,
Copy link
Member

Choose a reason for hiding this comment

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

Does this calculation work even if the height is much greater than the stateSyncInterval, and the interval is a fairly large number? I don't know the semantics of what you're trying to do here; it would be worth a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty standard state-sync, which requires a "root of trust". This is basically configuring state-sync saying we'll trust any block after the given height (and corresponding hash). The goal is to give something recent enough so that it doesn't need to verify too many blocks hashes with the light client, but old enough that there exists a state-sync snapshot taken after that block height.

Most state-sync instructions/scripts out there basically do this "latest block height - some offset" math without giving much explanation as to why. This is what I've gathered from understanding how state-sync works.

I'll add a comment adding an explanation.

Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

Approved assuming you address my prior comment.

@mhofman mhofman enabled auto-merge (squash) March 15, 2023 23:12
@mhofman mhofman merged commit 7b46e55 into main Mar 15, 2023
@mhofman mhofman deleted the mhofman/5542-state-sync branch March 15, 2023 23: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.

2 participants