Skip to content

Conversation

@alex-mysten
Copy link
Contributor

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.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@vercel
Copy link

vercel bot commented Nov 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sui-docs Ready Ready Preview Comment Nov 21, 2025 3:39pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
multisig-toolkit Ignored Ignored Preview Nov 21, 2025 3:39pm
sui-kiosk Ignored Ignored Preview Nov 21, 2025 3:39pm

if self
.state
.get_transaction_cache_reader()
.transaction_executed_in_last_epoch(tx_digest, epoch_store.epoch())?
Copy link
Contributor

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);
Copy link
Contributor

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)
Copy link
Contributor

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) {
Copy link
Contributor

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)

Copy link
Contributor

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.

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.

3 participants