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

[stateless_validation] Fix to store state witness from prev block of epoch before stateless validation #11638

Closed

Conversation

shreyan-gupta
Copy link
Contributor

Bowen identified this issue with protocol upgrade where we were not storing the chunk state witness for the last block of epoch before stateless validation. This PR is a fix for that.

In a future PR we would write a test for protocol upgrade.

@@ -3524,8 +3524,12 @@ impl Chain {
}
let epoch_id = block_header.epoch_id();
// Use epoch manager because block is not in DB yet.
// Let "epoch" be the epoch at which we enable stateless validation.
// We need to start storing the state witness from the last block of the previous epoch.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. storing -> generating/sending

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me go with "producing" as that's the wording of this function call.

let next_epoch_id =
self.epoch_manager.get_next_epoch_id_from_prev_block(block_header.prev_hash())?;
self.epoch_manager.get_next_epoch_id_from_prev_block(block_header.hash())?;
Copy link
Member

Choose a reason for hiding this comment

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

Sanity check - will it work if the last block doesn't have a chunk, so for main transition this will be false?

@shreyan-gupta
Copy link
Contributor Author

This is not the issue.

@shreyan-gupta shreyan-gupta deleted the shreyan/stateless_validation/upgrade_fix branch June 20, 2024 21:44
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.

None yet

3 participants