Skip to content

Accounts Refactor PR 2: Adding address_override param to tx#2771

Merged
citizen-stig merged 34 commits into
theodore/multisig-upgradefrom
nikolai/accounts-refactor-part-2
May 8, 2026
Merged

Accounts Refactor PR 2: Adding address_override param to tx#2771
citizen-stig merged 34 commits into
theodore/multisig-upgradefrom
nikolai/accounts-refactor-part-2

Conversation

@citizen-stig

@citizen-stig citizen-stig commented Apr 21, 2026

Copy link
Copy Markdown
Member

Description

Adds a signed address_override: Option<S::Address> field to V0 and V1 (multisig) transactions, threaded into AuthorizationData.address_override.
Resolve_context branches on it: Some(X) verifies (X, credential_id) ∈ account_owners via PR #2770 's is_authorized;
None keeps today's resolve_sender_address flow.
CHAIN HASH BREAKING for V1.

First commit: 7d2ab42

PR #2770 froze writes to the legacy credential_id → address map;
InsertCredentialId now only marks (sender, credential) authorized, without rerouting that credential's default.
That means a rotated multisig (new keys → new credential_id.into()) has no way to keep acting as the original address.
address_override is the signed channel that lets a signer declare which authorized address to execute as.

Design tradeoffs

  • V0 and V1 wire break, no grace period. CHAIN_HASH_OVERRIDES covers signature-level grace only (post-deserialize). Adding a borsh field breaks deserialization of pre-upgrade V0/V1 bytes regardless of chain hash, so a grace period isn't meaningful.
  • Unauthorized Some(X) is Skipped, not Reverted. We haven't resolved a sender yet, so there's no account to charge — sequencer pays inclusion cost, user is unaffected. Matches the existing pre-execution-error receipt category (same path as bad signatures). Error string is preserved in the receipt.
  • Read-only check. The Some(X) path never writes to account_owners. Auto-registration only happens on the None path.
  • Explicit builder parameters. to_multisig_tx and sign_utx_v1_in_place take the target as an argument rather than defaulting to None with callers assigning the public field afterwards — avoids a half-baked API in an SDK recommended pattern.

Audit invariants

  1. V1's credential_address field (multisig malleability commitment) is untouched.
  2. address_overred is inside the V1 signed bytes — post-sign tampering invalidates the signature (test: test_v1_target_tamper_breaks_signature).
  3. Some(_) path does exactly one read of account_owners; never writes.
  4. Failed Some(_) → TxEffect::Skipped, sequencer penalized, user never charged.

Notable side-effects

  • test_multisig_signature_verification in the EIP-712 integration test was already silently broken by PR Accounts Refactor PR 1: Adding account -> [credential_id] mapping #2770 (the multisig credential no longer routed to admin after InsertCredentialId, leaving gas on an unfunded default). Fixed here by signing with address_override = Some(admin.address()) — doubles as an EIP-712-meets-target-address smoke test.

  • 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

Testing

New tests are added

Docs

Updated doc-strings and comments

@citizen-stig
citizen-stig force-pushed the nikolai/accounts-refactor-part-2 branch from 1201dc0 to 5008b08 Compare April 22, 2026 08:20
@citizen-stig
citizen-stig force-pushed the nikolai/accounts-refactor-part-2 branch from 920da01 to 736575b Compare April 22, 2026 12:25
@citizen-stig
citizen-stig marked this pull request as ready for review April 22, 2026 13:12
devin-ai-integration[bot]

This comment was marked as resolved.

Comment thread crates/module-system/sov-capabilities/src/lib.rs Outdated
Comment thread crates/full-node/sov-rollup-apis/src/endpoints/simulate.rs Outdated
@citizen-stig
citizen-stig force-pushed the nikolai/accounts-refactor-part-2 branch from a887f49 to 30c8c38 Compare May 4, 2026 13:53

@theodorebugnet theodorebugnet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but is there a reason we avoid adding it to V0 transactions? Note that the theodore/multisig-upgrade branch is going to be a hard fork and require a new rollup binary regardless, with a coordinated upgrade height using the rollup manager. The previous changes on this branch already break the V0 format (UnsignedTransaction::V0 {...} is not byte-compatible with the old UnsignedTransaction, by design).

Adding it to both cases would IMO simplify things conceptually: this way, the differences between V0 and V1 are the signing protocol, while the actual transaction features remain the same.

Comment thread crates/module-system/sov-solana-offchain-auth/src/authentication/payload.rs Outdated
@citizen-stig
citizen-stig force-pushed the nikolai/accounts-refactor-part-2 branch from 3898e2e to 3704b1d Compare May 5, 2026 14:39
@citizen-stig citizen-stig changed the title Accounts Refactor PR 2: Adding target_account Accounts Refactor PR 2: Adding address_override May 5, 2026
Base automatically changed from nikolai/accounts-refactor-part-1 to theodore/multisig-upgrade May 6, 2026 10:11
@citizen-stig
citizen-stig force-pushed the nikolai/accounts-refactor-part-2 branch from f94b261 to ce7b152 Compare May 6, 2026 10:13
Comment thread crates/module-system/sov-capabilities/src/lib.rs Outdated

@theodorebugnet theodorebugnet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, almost all comments are doc nits except the redundant argument to to_multisig_tx() in unsigned/v0.rs which I think needs fixing

Comment thread crates/module-system/sov-capabilities/src/lib.rs Outdated
Comment thread crates/module-system/sov-modules-api/src/runtime/capabilities/authorization.rs Outdated
Comment thread crates/module-system/sov-modules-api/src/transaction/types/v0.rs Outdated
Comment thread crates/module-system/sov-modules-api/src/transaction/types/v1.rs Outdated
Comment thread crates/module-system/sov-modules-api/src/transaction/unsigned/v0.rs Outdated
Comment thread crates/module-system/sov-modules-api/src/transaction/unsigned/v1.rs Outdated
Comment thread crates/module-system/sov-modules-api/src/transaction/unsigned/v0.rs Outdated
Comment thread crates/module-system/sov-solana-offchain-auth/src/authentication/mod.rs Outdated
Comment thread crates/module-system/sov-solana-offchain-auth/src/authentication/payload.rs Outdated
Comment thread crates/module-system/sov-solana-offchain-auth/src/authentication/payload.rs Outdated
citizen-stig and others added 7 commits May 8, 2026 11:45
Co-authored-by: Theodore Bugnet <24320578+theodorebugnet@users.noreply.github.com>
Co-authored-by: Theodore Bugnet <24320578+theodorebugnet@users.noreply.github.com>
…on/payload.rs

Co-authored-by: Theodore Bugnet <24320578+theodorebugnet@users.noreply.github.com>
…on/payload.rs

Co-authored-by: Theodore Bugnet <24320578+theodorebugnet@users.noreply.github.com>
…v0.rs

Co-authored-by: Theodore Bugnet <24320578+theodorebugnet@users.noreply.github.com>
…v1.rs

Co-authored-by: Theodore Bugnet <24320578+theodorebugnet@users.noreply.github.com>
@citizen-stig

Copy link
Copy Markdown
Member Author

LGTM, almost all comments are doc nits except the redundant argument to to_multisig_tx() in unsigned/v0.rs which I think needs fixing

Thanks @theodorebugnet , keeping the bar. Many things slipped through while repurposing PR to support of the target_address for V0 tx too.

@citizen-stig citizen-stig changed the title Accounts Refactor PR 2: Adding address_override Accounts Refactor PR 2: Adding address_override param to tx May 8, 2026
@citizen-stig
citizen-stig merged commit 6406ec4 into theodore/multisig-upgrade May 8, 2026
28 of 30 checks passed
@citizen-stig
citizen-stig deleted the nikolai/accounts-refactor-part-2 branch May 8, 2026 12:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants