-
Notifications
You must be signed in to change notification settings - Fork 208
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(cosmic-swingset): add begin block check and transaction #8432
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.
Not sure if the comment is misleading (i.e. could use more clarification), or incorrect (i.e. should be rewritten). The code LGTM, though.
Please address the comment before merging.
// Start a block transaction, but without changing state | ||
// for the upcoming begin block check | ||
saveBeginHeight(0); |
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.
Why "without changing state"? Saving a 0 is a state change, isn't it?
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.
The default is 0
when missing, so writing 0
instead of defaulting does not effectively change the state. I'll calrify.
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 could either re-write it as saveBeginHeight(savedBeginHeight);
or update the comment, or both. Which one would be more clear?
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…8432) * feat(cosmic-swingset): add being block check and transaction * fixup! feat(cosmic-swingset): add being block check and transaction --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
closes: #8424
Description
This adds a consistency check for begin/end block, and does so through the host storage section of swing-store, which results in forcibly starting a block transaction at begin block to solve any future variations of #8423.
Security Considerations
None
Scaling Considerations
None
Documentation Considerations
None
Testing Considerations
As usual, this part of cosmic-swingset relies on integration tests which should exercise the happy paths. The unhappy paths are wholly untested.
Upgrade Considerations
The enact upgrade may publish bundles, so it's also protected with a no-op state change to start a transaction.
The new saved state is fully backwards compatible, and will be created the first time needed (after an upgrade, or after a state-sync restore)