-
Notifications
You must be signed in to change notification settings - Fork 156
Update state: apply header, verify, store #3756
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just move these checks
// Check internal consistency.
let parent_header = parent_leaf.block_header();
ensure!(
state.chain_config.commit() == parent_header.chain_config().commit(),
"internal error! in-memory chain config {:?} does not match parent header {:?}",
state.chain_config,
parent_header.chain_config(),
);
ensure!(
state.block_merkle_tree.commitment() == parent_header.block_merkle_tree_root(),
"internal error! in-memory block tree {} does not match parent header {}",
state.block_merkle_tree.commitment(),
parent_header.block_merkle_tree_root()
);
ensure!(
state.fee_merkle_tree.commitment() == parent_header.fee_merkle_tree_root(),
"internal error! in-memory fee tree {} does not match parent header {}",
state.fee_merkle_tree.commitment(),
parent_header.fee_merkle_tree_root()
);
from before to after apply_header(), and we can change them for proposals instead of parent WDYT?
|
I wanted to split the code into separate logical parts: apply, verify, store. I can just move the code if that's what you prefer. |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-20251106
git worktree add -d .worktree/backport-3756-to-release-20251106 origin/release-20251106
cd .worktree/backport-3756-to-release-20251106
git switch --create backport-3756-to-release-20251106
git cherry-pick -x e574cda8d540aa44842f821d3618ba556b31ad10 |
* Update state: apply header, verify, store * Remove `compute_state_update` * Fix errors * First apply, then verify and store (cherry picked from commit e574cda)
* Update state: apply header, verify, store (#3756) * Update state: apply header, verify, store * Remove `compute_state_update` * Fix errors * First apply, then verify and store (cherry picked from commit e574cda) * Fix error after cherry pick * Fix `test_vote_dependency_handle` * clippy: fix type complexity error (#3718) * clippy: fix type complexity error
* relay log & logic * fmt * revert bad relay logic change * Update staging genesis file * Upgrade genesis file * Upgrade proposal genesis file * Add genesis files for upgrade proposer and new node * Add the initial stake table for upgrade test * Copy data dir into orchestrator's container * Add modified DA to genesis file * Increase DA genesis files * 0.4 to 0.5 upgrade genesis files * Adapt genesis file to new upgrade version * Add stake table contract addr in genesis file * Revert "Add stake table contract addr in genesis file" This reverts commit 5827101. * Set genesis_version to 0.4 * fix hotshotconfig deserialization * clippy * fix tests * fix * fix * remove redundant attribute * Adjust upgrade views * Adjust upgrade view again * CDN -> TCP (#3709) * cdn upgrade + b compat * lints * CDN backwards compatibility - use cleaner build (#3717) fix CDN backwards compatibility tag * logging * cancel dep handles correctly (#3733) * cancel dep handles correctly * log * Typos --------- Co-authored-by: Lukasz Rzasik <[email protected]> * better startup logging * Add more verbose logs to compute_state_update * Add DRB logs (#3753) * Add DRB logs * Adjust log * add version to block header trait and use it for the DRB calculation * discard value from storage if incorrect * fix * Backport 3756 to release 20251106 (#3759) * Update state: apply header, verify, store (#3756) * Update state: apply header, verify, store * Remove `compute_state_update` * Fix errors * First apply, then verify and store (cherry picked from commit e574cda) * Fix error after cherry pick * Fix `test_vote_dependency_handle` * clippy: fix type complexity error (#3718) * clippy: fix type complexity error --------- Co-authored-by: MRain <[email protected]> Co-authored-by: ss-es <[email protected]> Co-authored-by: pls148 <[email protected]> Co-authored-by: rob-maron <[email protected]> Co-authored-by: Rob <[email protected]> Co-authored-by: Brendon Fish <[email protected]> Co-authored-by: Mathis <[email protected]>
Closes #<ISSUE_NUMBER>
This PR:
This PR does not:
Key places to review: