Skip to content

Limit generation/windowed-nonce growth#3032

Merged
theodorebugnet merged 2 commits into
theodore/multisig-upgradefrom
theodore/limit-nonce-growth
Jul 20, 2026
Merged

Limit generation/windowed-nonce growth#3032
theodorebugnet merged 2 commits into
theodore/multisig-upgradefrom
theodore/limit-nonce-growth

Conversation

@theodorebugnet

Copy link
Copy Markdown
Contributor

Description

Add a sane limit to how much a generation or windowed nonce can grow in a single transaction, to prevent accidental major changes to account state.

The limit is 2x the current value, with exceptions for low values (at least the minimum required for pruning in generations, and at least PAST_WINDOWS for windowed nonces) to avoid excessive friction when the current value is small.

Also updates the module README which was out of date.

  • I have updated CHANGELOG.md with a new entry if my PR makes any breaking changes or fixes a bug. If my PR removes a feature or changes its behavior, I provide help for users on how to migrate to the new behavior.
  • I have carefully reviewed all my Cargo.toml changes before opening the PRs. (Are all new dependencies necessary? Is any module dependency leaked into the full-node (hint: it shouldn't)?)

Linked Issues

  • Fixes # (issue, if applicable)
  • Related to # (issue)

Testing

Describe how these changes were tested. If you've added new features, have you added unit tests?

Docs

Describe where this code is documented. If it changes a documented interface, have the docs been updated?

Rendered docs are available at https://sovlabs-ci-rustdoc-artifacts.us-east-1.amazonaws.com/<BRANCH_NAME>/index.html

@theodorebugnet
theodorebugnet force-pushed the theodore/multisig-upgrade branch from d256a83 to 675f818 Compare July 8, 2026 21:13
@theodorebugnet
theodorebugnet force-pushed the theodore/limit-nonce-growth branch 2 times, most recently from f3a789a to 26d5dc7 Compare July 8, 2026 21:21
…single transaction, to prevent accidental major changes to account state.
@theodorebugnet
theodorebugnet force-pushed the theodore/limit-nonce-growth branch 3 times, most recently from d7182b5 to a1ad288 Compare July 9, 2026 17:15

@bkolad bkolad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR LGTM. One question, generation uniqueness now rejects jumps above max(latest * 2, latest + PAST_TRANSACTION_GENERATIONS + 1) but if last is let's say 1000_0000 so the gap can be 1000_0000 and it grows as latest grows is that ok?

@theodorebugnet

Copy link
Copy Markdown
Contributor Author

Yep, the main idea is that you can't do 1000x e.g. when accidentally submitting ms time instead of s time. That's been Zeta's main issue

@theodorebugnet
theodorebugnet force-pushed the theodore/limit-nonce-growth branch from a1ad288 to 127a1f5 Compare July 20, 2026 00:39
@theodorebugnet
theodorebugnet merged commit a63b65a into theodore/multisig-upgrade Jul 20, 2026
11 of 14 checks passed
@theodorebugnet
theodorebugnet deleted the theodore/limit-nonce-growth branch July 20, 2026 00:39
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.

2 participants