Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

FM-367: Handle snapshot offer #438

Merged
merged 3 commits into from
Nov 27, 2023
Merged

FM-367: Handle snapshot offer #438

merged 3 commits into from
Nov 27, 2023

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Nov 17, 2023

Closes consensus-shipyard/ipc#174

Implement the offer_snapshot ABCI method by parsing the manifest back from the snapshot and accepting it if the application hash in it (coming from a light client) matches what the FVM state parameters in the snapshot.

For now if the offer cannot be validated we return Reject rather than RejectSender; it might just be a bug, rather than any bad intentions.

The PR moves the notification of the manager from commit to begin_block, so that the snapshot height is associated with the block where the app_hash will match the snapshot content. This is so we can validate the OfferSnapshot::app_hash which is something CometBFT acquired for us at OfferSnapshot::height against the FVM parameters in the manifest.

This is a change from #389 but also reflects what I did in #420 (which is not merged into this branch).


// Notify the snapshotter. We don't do this in `commit` because *this* is the height at which
// this state has been officially associated with the application hash, which is something
// we will receive in `offer_snapshot` and we can compare. If we did it in `commit` we'd
Copy link
Contributor

Choose a reason for hiding this comment

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

This is done to ensure that the state_params that we are requesting belongs to the right height because in end_block we haven't yet computed the up to date state_params, right?

Base automatically changed from fm-361-serve-snapshot-chunks to main November 27, 2023 09:51
@aakoshh aakoshh merged commit eb0a30b into main Nov 27, 2023
1 check failed
@aakoshh aakoshh deleted the fm-367-handle-snapshot-offer branch November 27, 2023 09:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Choose snapshot to load
2 participants