-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[address-balance] support multi-epoch transaction expiration #24391
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6dd7565 to
0d11f57
Compare
| if self | ||
| .state | ||
| .get_transaction_cache_reader() | ||
| .transaction_executed_in_last_epoch(tx_digest, epoch_store.epoch())? |
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.
we should also add these checks to AuthorityState::handle_sign_transaction
| .unwrap(); | ||
| node.state() | ||
| .cache_for_testing() | ||
| .evict_executed_effects_from_cache_for_testing(&tx_digest); |
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.
you could use node.stop() and node.start() instead of adding the cache eviction method, and you could let the pruner take care of the db. not sure if the pruner is predictable enough to rely on for tests though.
| ) -> SuiResult<bool> { | ||
| self.store | ||
| .perpetual_tables | ||
| .was_transaction_executed_in_last_epoch(digest, current_epoch) |
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.
Let's add an assert that the transaction was not executed in the prior epoch in write_transaction_outputs, and add a cache for this to absorb the duplicated read
| match (min_epoch, max_epoch) { | ||
| (Some(min), Some(max)) => { | ||
| if min != max { | ||
| if min > max || *max > min.saturating_add(1) { |
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.
we will need a protocol config for this since we are changing the validity rules. (most likely no one is using ValidDuring yet, but it is open to the world)
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.
also, at node startup, if that config flag is true, we should check that there are entries for the previous epoch present, and abort if not. This will actually be crucial - anybody who restores using an old version of sui-tool that does not backfill the table will hit this assert.
Description
Allow callers to specify a maximum epoch range of 1, handling the case where txns are signed in one epoch but actually executed in a second epoch.
Test plan
New e2e tests added
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.