Skip to content

feat(consensus): activate native multisig accounts - #7238

Draft
joshieDo wants to merge 19 commits into
agent/native-multisig-precompilefrom
agent/native-multisig-activation
Draft

feat(consensus): activate native multisig accounts#7238
joshieDo wants to merge 19 commits into
agent/native-multisig-precompilefrom
agent/native-multisig-activation

Conversation

@joshieDo

Copy link
Copy Markdown
Member

Activates native multisig accounts at T11 with registration, bootstrap writes, stateful validation, role restrictions, and complete gas accounting. Enforces the no-code invariant across direct, access-key, and nested authorization paths.

Stacked on #7237; extracted from #4069.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

✅ Changelog found on PR.

Edit changelog

@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from 935ca4e to 2988c3d Compare August 19, 2026 15:29
@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from 2988c3d to dc6102c Compare August 19, 2026 15:33
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

📊 Tempo Precompiles Coverage

precompiles

Coverage: 6454/11165 lines (57.81%)

File details
File Lines Coverage
src/account_keychain/dispatch.rs 16/42 38.10%
src/account_keychain/mod.rs 315/899 35.04%
src/address_registry/dispatch.rs 21/27 77.78%
src/address_registry/mod.rs 50/60 83.33%
src/current_committee/dispatch.rs 0/9 0.00%
src/current_committee/mod.rs 0/18 0.00%
src/dispatch.rs 126/152 82.89%
src/error.rs 52/173 30.06%
src/ip_validation.rs 10/10 100.00%
src/lib.rs 128/148 86.49%
src/native_multisig/auth.rs 0/179 0.00%
src/native_multisig/dispatch.rs 0/15 0.00%
src/native_multisig/mod.rs 3/348 0.86%
src/nonce/dispatch.rs 6/7 85.71%
src/nonce/mod.rs 44/58 75.86%
src/receive_policy_guard/dispatch.rs 0/12 0.00%
src/receive_policy_guard/mod.rs 0/139 0.00%
src/signature_verifier/dispatch.rs 15/23 65.22%
src/signature_verifier/mod.rs 13/55 23.64%
src/stablecoin_dex/dispatch.rs 59/71 83.10%
src/stablecoin_dex/mod.rs 998/1097 90.98%
src/stablecoin_dex/order/mod.rs 120/154 77.92%
src/stablecoin_dex/order/storage.rs 178/249 71.49%
src/stablecoin_dex/orderbook.rs 183/242 75.62%
src/storage/actions.rs 11/90 12.22%
src/storage/evm.rs 390/440 88.64%
src/storage/hashmap.rs 0/249 0.00%
src/storage/mod.rs 27/69 39.13%
src/storage/packing.rs 68/93 73.12%
src/storage/thread_local.rs 200/300 66.67%
src/storage/types/array.rs 0/72 0.00%
src/storage/types/bytes_like.rs 135/179 75.42%
src/storage/types/cache.rs 65/122 53.28%
src/storage/types/mapping.rs 27/48 56.25%
src/storage/types/mod.rs 47/71 66.20%
src/storage/types/primitives.rs 21/24 87.50%
src/storage/types/set.rs 28/192 14.58%
src/storage/types/slot.rs 80/101 79.21%
src/storage/types/vec.rs 103/261 39.46%
src/storage_credits/accounting.rs 79/92 85.87%
src/storage_credits/dispatch.rs 16/16 100.00%
src/storage_credits/mod.rs 138/193 71.50%
src/tip20/dispatch.rs 64/73 87.67%
src/tip20/mod.rs 657/801 82.02%
src/tip20/rewards.rs 242/260 93.08%
src/tip20/roles.rs 85/88 96.59%
src/tip20_channel_reserve/dispatch.rs 0/42 0.00%
src/tip20_channel_reserve/mod.rs 3/548 0.55%
src/tip20_factory/dispatch.rs 9/11 81.82%
src/tip20_factory/mod.rs 117/140 83.57%
src/tip403_registry/dispatch.rs 29/46 63.04%
src/tip403_registry/mod.rs 347/544 63.79%
src/tip_fee_manager/amm.rs 295/465 63.44%
src/tip_fee_manager/dispatch.rs 35/37 94.59%
src/tip_fee_manager/mod.rs 57/155 36.77%
src/validator_config/dispatch.rs 18/28 64.29%
src/validator_config/mod.rs 171/227 75.33%
src/validator_config_v2/dispatch.rs 30/33 90.91%
src/validator_config_v2/mod.rs 523/581 90.02%
src/zone_factory/dispatch.rs 0/15 0.00%
src/zone_factory/mod.rs 0/215 0.00%
src/zone_factory/portal.rs 0/57 0.00%

contracts

Coverage: 1/202 lines (0.50%)

File details
File Lines Coverage
src/lib.rs 1/1 100.00%
src/precompiles/receive_policy_guard.rs 0/78 0.00%
src/precompiles/storage_credits.rs 0/7 0.00%
src/precompiles/tip20.rs 0/50 0.00%
src/precompiles/tip20_channel_reserve.rs 0/27 0.00%
src/precompiles/tip403_registry.rs 0/9 0.00%
src/precompiles/validator_config_v2.rs 0/3 0.00%
src/precompiles/zone_factory.rs 0/27 0.00%

Total: 6455/11367 lines (56.79%)

📦 Download full HTML report

@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from dc6102c to 402b6ae Compare August 19, 2026 16:53
@joshieDo

Copy link
Copy Markdown
Member Author

cyclops audit fast note="this belongs to the GH stack #7243 and the TIP 1061 is specified in the PR 7242. any bug not introduced by this PR should be clearly marked"

@tempoxyz-bot tempoxyz-bot 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.

👁️ Cyclops Review

This change activates native multisig accounts at T11 and wires their authorization and gas accounting into transaction validation. One medium-severity subblock liveness issue and three lower-severity validation or maintenance issues are included inline.

Reviewer Callouts
  • Subblock policy: Prefer an allowlist of authorization forms whose validity cannot change within a block, so future signature types are denied by default.
  • Subblock error recovery: Document that non-fee validation failures abort payload construction; every subblock-eligible authorization mechanism must preserve that invariant.
  • Reserved namespaces: is_valid_multisig_account excludes TIP-20 addresses but not the similarly prefixed ZonePortal namespace; confirm whether that omission is intentional.

@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from 50a2c67 to c50709e Compare August 19, 2026 19:08
@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from c50709e to b12cf5a Compare August 19, 2026 21:02
@joshieDo

Copy link
Copy Markdown
Member Author

cyclops audit fast note="this belongs to the GH stack #7243 and the TIP 1061 is specified in the PR 7242. any bug not introduced by this PR should be clearly marked"

@tempoxyz-bot tempoxyz-bot 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.

👁️ Cyclops Review

This change activates native multisig accounts at T11 and generally implements the authorization and consensus invariants carefully. One verified medium-severity resource-exhaustion issue remains; see the inline finding.

Reviewer Callouts
  • Simulation owner-count hint (crates/revm/src/handler.rs:3231): state-derived config gas is skipped based on the presence of simulation_config_owner_count, not ExecutionContext::Simulation. Gate the hint on simulation context before an RPC path can set it.
  • Dead alternate-account branch (crates/revm/src/handler.rs:1424): if the caller-equality guard is relaxed later, the alternate config load is not represented in the state-dependent gas calculation. Remove the dead branch or calculate gas for the signature account.
  • RPC authorization-list normalization (crates/revm/src/handler.rs:1069): AA simulation checks tempo_authorization_list, while pre-execution can fall back to the standard authorization list. Normalize or assert the two representations to prevent gas under-estimation.
  • TIP-1060 storage-credit accounting (crates/revm/src/handler.rs:1948): bootstrap slots are written with accounting disabled but can later be cleared with accounting enabled. Confirm that minting credits for those slots is intentional.

@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from b12cf5a to 496a290 Compare August 20, 2026 11:13
@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from 496a290 to bbcbc52 Compare August 20, 2026 13:40
@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from bbcbc52 to 341e0cc Compare August 20, 2026 13:56
@joshieDo

Copy link
Copy Markdown
Member Author

cyclops audit fast note="this belongs to the GH stack #7243 and the TIP 1061 is specified in the PR 7242. any bug not introduced by this PR should be clearly marked"

@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from 341e0cc to dc88db8 Compare August 20, 2026 14:31

@tempoxyz-bot tempoxyz-bot 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.

👁️ Cyclops Review

This change activates TIP-1061 native multisig accounts at T11 with stateful configuration and authorization validation. The consensus-side implementation is generally careful, but one verified Medium-severity issue remains on the current head after drift.

🚨 [SECURITY] Multisig state changes leave dependent transactions stale in the pool

Severity: Medium
File: crates/transaction-pool/src/maintain.rs:123

TempoPoolUpdates::from_chain handles TIP-20, keychain, fee-manager, and TIP-403 events but ignores MultisigInitialized and MultisigConfigUpdated. Native-multisig authorization is checked against the current stored configuration and version, so updates can invalidate direct, key-authorization, and nested multisig approvals without changing the affected sender's nonce. These transactions remain eligible across nonce lanes and are repeatedly reconsidered by payload builders until generic stale eviction. Initialization can likewise invalidate transactions that name the newly registered account in a multisig-restricted role. This violates the pool-revalidation requirement at tips/tip-1061.md:321.

Recommended Fix: Decode native-multisig initialization and configuration-update logs in TempoPoolUpdates, then remove and fully revalidate every transaction whose authorization depends on the changed account. Cover direct outer signatures, multisig key-authorization signatures, nested owner nodes, newly invalid access-key IDs and keychain authorization-list authorities, and both the 2D/expiring-nonce and protocol-nonce pools.

Reviewer Callouts
  • Parallel storage-action replay: Account nonce/code-hash facts checked at crates/revm/src/handler.rs:1292 are not replay assertions. No current mutation path was found, but revisit this if payment-lane authorization rules change.
  • Duplicate configuration gas: crates/revm/src/handler.rs:1200 can charge owner-configuration validation twice when both outer and key-authorization signatures are multisig for the same caller, despite loading the configuration once.
  • Fee-check ordering: Key authorization and keychain authorization-list entries can trigger registry reads at crates/revm/src/handler.rs:1092 before insufficient-funds rejection. Confirm the bounded asymmetry is intentional.
  • Bootstrap simulation nonce: Bootstrap nonce validation does not honor disabled nonce checks. Confirm strict failure for nonzero protocol nonces is intended for RPC estimation and pool admission.

@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch 2 times, most recently from 1771bd5 to 3cc126b Compare August 20, 2026 16:12
@joshieDo
joshieDo force-pushed the agent/native-multisig-activation branch from 3cc126b to 365c7f4 Compare August 20, 2026 16:28
@joshieDo

Copy link
Copy Markdown
Member Author

cyclops audit fast note="this belongs to the GH stack #7243 and the TIP 1061 is specified in the PR 7242. any bug not introduced by this PR should be clearly marked"

@tempoxyz-bot tempoxyz-bot 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.

👁️ Cyclops Review

This change activates TIP-1061 native multisig accounts at T11 and integrates bootstrap, authorization, role restrictions, and gas accounting into transaction validation. The core paths are carefully implemented; one Low defense-in-depth gap remains in transaction-scoped precompile initialization.

Reviewer Callouts
  • Simulation authorization boundary: ExecutionContext::Simulation skips native-multisig owner-quorum verification while still staging bootstrap state. Add an invariant or test proving simulation-marked transactions cannot reach committing block execution.
  • State-measured intrinsic gas: native_multisig_registry_validation_gas derives consensus intrinsic gas from live journal warm/cold state. Add a test showing a discarded transaction or access-list prewarming cannot change the subsequent transaction's measured intrinsic gas unexpectedly.

keychain.set_tx_origin(ctx.tx.caller())?;

let mut multisig = NativeMultisig::new();
multisig.set_tx_origin(ctx.tx.caller())?;

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.

🛡️ [DEFENSE-IN-DEPTH] Reset the native-multisig bootstrap guard at transaction start

seed_precompile_tx_context resets the keychain transaction_key and seeds NativeMultisig.tx_origin, but does not reset the adjacent transient bootstrapped_account slot. store_initial_config writes that slot, and update_multisig_config rejects updates when it equals the caller. Current revm finalization clears transient storage, so this is fail-safe today; however, a driver or future refactor that preserves transient state across transactions would incorrectly block a later owner rotation and could create pool/execution divergence.

Recommended Fix:
Expose a crate-private setter and set bootstrapped_account to Address::ZERO here alongside the other transaction-scoped resets. Add a two-transaction regression test using one EVM instance, including the pool-validation/discard path.

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