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

Lightweight checkpointing for all block types #898

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

amesgen
Copy link
Member

@amesgen amesgen commented Jan 22, 2024

Lightweight checkpointing is a mechanism to ensure that new nodes end up in the correct chain even when the chain is too sparse for normal operation of Praos and Genesis.

The idea is to supply the new node with a list of block hashes that should be present on the chain at specific block numbers. This list is provided in the TopLevelConfig record, and it is used during validation of headers in validateIfCheckpoint called by validateEnvelope.

If the hashes of checkpoints don't match the hashes of a supplied header for a given block number, then validation of the header fails.

The substance of the change is modifying TopLevelConfig and validateEnvelope. Most other changes derive from these modifications. There are three new unit tests of validateIfCheckpoint added in ouroboros-consensus:test:consensus-test.

Implements #453 (comment)

@amesgen amesgen added the Genesis PRs related to Genesis testing and implementation label Jan 22, 2024
@amesgen amesgen force-pushed the amesgen/checkpointing-abstract branch 2 times, most recently from 70d976d to db3c7f8 Compare January 22, 2024 12:53
@facundominguez facundominguez force-pushed the amesgen/checkpointing-abstract branch 3 times, most recently from 1fd0dbb to f91e093 Compare January 22, 2024 20:43
@facundominguez
Copy link
Contributor

@amesgen, this is ready for a review.

@facundominguez facundominguez force-pushed the amesgen/checkpointing-abstract branch from a66b9ad to bd7e442 Compare January 24, 2024 15:50
@nbacquey nbacquey force-pushed the amesgen/checkpointing-abstract branch from bd7e442 to 4262f91 Compare February 29, 2024 13:01
@facundominguez facundominguez force-pushed the amesgen/checkpointing-abstract branch from 4262f91 to fb8811d Compare February 29, 2024 17:14
Lightweight checkpointing is a mechanism to ensure that new nodes
end up in the correct chain even when the chain is too sparse for
normal operation of Praos and Genesis.

The idea is to supply the new node with a list of block hashes that
should be present on the chain at specific block numbers. This list
is provided in the TopLevelConfig record, and it is used during
validation of headers in validateIfCheckpoint called by
validateEnvelope.

If the hashes of checkpoints don't match the hashes of a supplied
header for a given block number, then validation of the header fails.

The substance of the change is modifying TopLevelConfig and
validateEnvelope. Most other changes derive from these modifications.
There are three new unit tests of validateIfCheckpoint added in
ouroboros-consensus:test:consensus-test.
@facundominguez facundominguez force-pushed the amesgen/checkpointing-abstract branch from fb8811d to 4673971 Compare February 29, 2024 18:35
@facundominguez facundominguez changed the title Draft another lightweight checkpointing approach Lightweight checkpointing for all block types Feb 29, 2024
@amesgen amesgen marked this pull request as ready for review March 1, 2024 09:57
@amesgen amesgen requested a review from a team as a code owner March 1, 2024 09:57
@facundominguez facundominguez added this pull request to the merge queue Mar 22, 2024
Merged via the queue into main with commit 488bfc6 Mar 22, 2024
15 checks passed
@facundominguez facundominguez deleted the amesgen/checkpointing-abstract branch March 22, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Genesis PRs related to Genesis testing and implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants