-
Notifications
You must be signed in to change notification settings - Fork 296
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
cnidarium: implement deferred commits via StagedWriteBatch
#4122
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.
Thanks for taking this on, this is great work and it unlocks a lot of cool things besides 0.38 support. There are a couple things we want to change before merging but overall ACK. I have put together a couple unit tests that I will add before merging, once we're done with review
@erwanor thanks for the review, comments addressed! |
commit
into prepare_commit
and commit_batch
StagedWriteBatch
Added some simple tests scenarios, will merge on green CI. This is really exciting! Thanks again for your work on this. |
## Summary updates the sequencer app to use ABCI v0.38, which replaces `begin_block`/`deliver_tx`/`end_block` with one call, `finalize_block`. relevant penumbra PRs: - update penumbra-tower-trace to re-add instrumentation to the ABCI methods (done in penumbra-zone/penumbra#4160) - update cnidarium to be able to get the root hash of the state without calling `commit` (done in penumbra-zone/penumbra#4122) ## Background this was inevitable, also it cleans up the block execution flow inside the sequencer application. (removed `processed_txs` and `current_sequencer_block_builder` from the app) ## Changes - implement `finalize_block`; for the most part, I left the `begin_block`/`deliver_tx`/`end_block` as they are but called them inside `finalize_block` - however the block execution flow is cleaned up as we no longer need to track how many txs have been delivered (for the commitments) and we can construct the `SequencerBlock` at the end of `finalize_block` without needing to track things between calls ## Testing unit tests ran it with cometbft release [v0.38.6](https://github.com/cometbft/cometbft/releases/tag/v0.38.6) ## Breaking Changelist - the sequencer app will now only work with a cometbft version that supports ABCI v0.38 ## Related Issues closes #679
refactor
commit
intoprepare_commit
andcommit_batch
. this allows aStagedWriteBatch
to be prepared viaprepare_commit
and the actual writing theStagedWriteBatch
to disk to occur incommit_batch
. this allows us to get the root hash of the changes without requiring the data to be fully committed.closes #4095