Skip to content

feat(pool): revalidate native multisig transactions - #7240

Draft
joshieDo wants to merge 10 commits into
agent/native-multisig-rpc-walletfrom
agent/native-multisig-pool
Draft

feat(pool): revalidate native multisig transactions#7240
joshieDo wants to merge 10 commits into
agent/native-multisig-rpc-walletfrom
agent/native-multisig-pool

Conversation

@joshieDo

@joshieDo joshieDo commented Aug 19, 2026

Copy link
Copy Markdown
Member

Revalidates pooled transactions when applied or reverted configuration events affect their outer account, nested owners, or key-authorization multisig tree. Still-valid transactions return to the pool.

Stacked on #7239; extracted from #4069.

@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from 7f72761 to 1116aec Compare August 19, 2026 15:29
@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch 2 times, most recently from 2a56d67 to d0fa80d Compare August 19, 2026 16:53
@joshieDo joshieDo changed the title feat(pool): invalidate native multisig transactions feat(pool): revalidate native multisig transactions Aug 19, 2026
@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from d0fa80d to 1319fda Compare August 19, 2026 17:05
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

📊 Tempo Precompiles Coverage

precompiles

Coverage: 6426/11165 lines (57.55%)

File details
File Lines Coverage
src/account_keychain/dispatch.rs 16/42 38.10%
src/account_keychain/mod.rs 314/899 34.93%
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 972/1097 88.61%
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 56/155 36.13%
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: 6427/11367 lines (56.54%)

📦 Download full HTML report

@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 adds transaction-pool revalidation for native-multisig initialization and configuration updates. One verified Medium security finding remains: initialization changes a key-authorization dependency that the new signature-tree matcher does not enumerate.

Reviewer Callouts
  • Initialization dependency coverage: Compare the pool's dependency enumeration with every NativeMultisig::is_multisig_account check in execution; signature-tree membership alone is sufficient for owner-config rotations but not for account initialization.

@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch 2 times, most recently from 42fd714 to 55676f5 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 adds native-multisig transaction-pool revalidation after initialization and configuration updates. One verified medium-severity availability finding remains after deduplication and verification.

Reviewer Callouts
  • Pool scan budget: crates/transaction-pool/src/maintain.rs:695 adds another full-pool scan to a sequential maintenance thread whose lagged canonical-state notifications are not replayed; consider indexing affected transactions or enforcing a bounded per-block maintenance budget.
  • Invalidation predicate consistency: crates/transaction-pool/src/maintain.rs:291 does not include the new multisig update sets in has_invalidation_events(), although is_empty() does. The dedicated path makes this harmless today, but a future generalization could silently skip multisig updates.

@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from 55676f5 to 9811211 Compare August 20, 2026 11:13
@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from 9811211 to 96e6037 Compare August 20, 2026 13:40
@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from 96e6037 to 6577c56 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-pool branch from 6577c56 to eb22aba 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 revalidates pooled transactions affected by native-multisig initialization or configuration updates. One verified medium-severity availability race remains on the current head.

Reviewer Callouts
  • Public invalidation wrapper: evict_invalidated_transactions() passes no multisig revalidation output and can silently skip multisig updates if a production caller is added. Route affected transactions to removal or document/restrict this API.
  • Maintenance write lock: The maintenance path calls remove_transactions even when no multisig transaction was selected, causing an unnecessary AA 2D pool write-lock acquisition every block. Guard the call with !to_revalidate.is_empty().
  • Fire-and-forget re-admission: Multisig removals are not added to removed_this_iteration. This is safe only while this remains the final snapshot-based scan; record the hashes to preserve that invariant if later maintenance phases are added.

.iter()
.filter(|tx| !removed_this_iteration.contains(tx.hash())),
Some(tip_timestamp.saturating_add(EVICTION_BUFFER_SECS)),
Some(&mut multisig_revalidated),

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.

🚨 [SECURITY] Point-in-time multisig scans miss transactions admitted from an older state snapshot

This scan only covers transactions already present in all_txs. An AA 2D batch can finish validation against the pre-update state after this scan and then be inserted by add_transactions without any canonical-tip or state-generation check. Those stale multisig signatures remain in the pool and can be retried across payload builds, degrading proposer throughput.

Recommended Fix:
Bind stateful validation outcomes to the canonical tip hash or a monotonic state generation, and revalidate at insertion whenever that snapshot no longer matches. Apply the same barrier to maintenance reinsertion.

@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from eb22aba to 9df0583 Compare August 20, 2026 15:26
@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from 9df0583 to 9afb28e Compare August 20, 2026 16:12
@joshieDo
joshieDo force-pushed the agent/native-multisig-pool branch from 9afb28e to dadc596 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

No new actionable findings remain after verification and deduplication. The verified validation/insertion race was already reported in the prior Cyclops review; the reverted-bootstrap receipt finding was rejected because pre-checkpoint logs are retained in reverted execution results.

Reviewer Callouts
  • Non-AA EIP-7702 authority recovery (crates/transaction-pool/src/transaction.rs:257-262): Confirm whether cached non-AA transaction environments retain signed rather than recovered authorizations. If so, each multisig initialization can trigger repeated ecrecover work across every pooled authorization; pre-recover authorities or enforce an authorization-list bound.

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