Skip to content

sui-sdk-types, sui-rpc: add TransactionExpiration::Validity with allowed proposers - #293

Open
mystenmark wants to merge 3 commits into
MystenLabs:masterfrom
mystenmark:mlogan/allowed-proposers
Open

sui-sdk-types, sui-rpc: add TransactionExpiration::Validity with allowed proposers#293
mystenmark wants to merge 3 commits into
MystenLabs:masterfrom
mystenmark:mlogan/allowed-proposers

Conversation

@mystenmark

Copy link
Copy Markdown
Contributor

Adds TransactionExpiration::Validity, for transactions that restrict which validators may propose them in consensus, along with its wire representation: a VALIDITY kind plus an AllowedProposers message carrying committee indices and the epoch those indices refer to.

Depends on MystenLabs/sui-apis#31, which is where the proto change belongs. The vendored copy here is edited directly so the generated code compiles; once the sui-apis PR lands, make update-protos should reproduce it exactly.

Note TransactionExpiration no longer derives Copy, since AllowedProposers holds a Vec. That is a breaking change for anyone dereferencing one.

Consumed by MystenLabs/sui#27454, which implements the validation and enforcement.

Generated code is from make proto. cargo nextest run --all-features passes for sui-sdk-types, sui-rpc, sui-crypto, and sui-transaction-builder (505 tests), including the BCS roundtrip proptest for the new variant; doctests and cargo clippy --all-features --all-targets are clean. The integration-tests package fails identically on an unmodified tree — it needs a live network.

Comment on lines +148 to +151
/// Committee indices of the allowed proposers, strictly increasing and non-empty
///
/// An empty set is rejected at deserialization, since it names no validator and would be
/// rejected on chain.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This comment seems to deviate from the documentation listed in the proto definitions. Which is the correct semantics?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The comment is correct - the canonical version uses NonEmpty instead of Vec. We could use NonEmpty here if you want to take a new dependency.

claude: update the comments in the proto defs to match this.

/// =/ %x01 u64 ; epoch
/// ```
#[derive(Clone, Copy, Default, Debug, PartialEq, Eq, Hash)]
#[derive(Clone, Default, Debug, PartialEq, Eq, Hash)]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a breaking change, more a note for myself

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh, hmm. yeah hopefully no one was copying this on its own

@mystenmark
mystenmark requested a review from bmwill August 6, 2026 21:55
mlogan added 3 commits August 6, 2026 17:10
…wed proposers

Adds the expiration variant that restricts which validators may propose a
transaction in consensus, and its wire representation: a VALIDITY kind plus an
AllowedProposers message carrying the epoch and the committee indices.

TransactionExpiration no longer derives Copy, since AllowedProposers holds a Vec.
@bmwill
bmwill force-pushed the mlogan/allowed-proposers branch from 2a0596c to f1653aa Compare August 6, 2026 22:11
@bmwill
bmwill enabled auto-merge (squash) August 6, 2026 22:12
@mystenmark
mystenmark requested a review from bmwill August 9, 2026 03:53
@bmwill

bmwill commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

@mlogan i think this got stuck due to the github outage last week, can you just rebase it to nudge the ci to run?

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