Repository navigation
Conversation
A reorg diffed fallback-token balances only between the fork point and the new tip, so a transaction whose Fallback choice came from orphaned state kept a token execution no longer picks. Revalidate every Fallback-cached transaction on a reorg.
…chain Revalidating every fallback transaction on a reorg also removed bystanders that nothing changed. Revalidate those whose fallback-token balance slot the orphaned segment wrote.
👁️ Cyclops Security Review✅ Reviewed cbbf553 (latest) · Coverage: partial · no open findings · report |
There was a problem hiding this comment.
Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.
Additional findings (outside the current diff — GitHub can't attach inline comments there):
-
🟣
crates/transaction-pool/src/maintain.rs— Pre-existing: after a reorg, pooled implicit-fee transactions can keep aSelecteduser token set only in orphaned blocks, so eviction tracks a token execution no longer uses.TempoPoolUpdates::from_chain(tip)readsUserTokenSetlogs from the new segment only. The fallback fix at maintain.rs:575 checks fallback-cached transactions only. Fix: onReorg, also add the orphaned chain'suser_token_changes(e.g.TempoPoolUpdates::from_chain(&old)) toupdates. Check 6 in tempo_pool.rs:508 then evicts those payers' implicit-fee transactions.Why this was flagged
The trigger is a payer who calls
setUserToken(X)in a block that is later orphaned. A transaction with no explicit fee token is validated against that orphaned state, andresolve_fee_token(crates/evm/src/fee_manager.rs:263-269) cachesResolvedFeeToken::Selected(X). OnCanonStateNotification::Reorg, maintain.rs:547 buildsupdatesonly fromtip, the new segment, which has noUserTokenSetlog. Souser_token_changesis empty and Check 6 at tempo_pool.rs:508-517 does not evict the transaction. The new fallback-revalidation filter at maintain.rs:564 needsis_fallback_fee_token(), so it skipsSelectedtransactions. On the new chainuser_tokens[fee_payer]is zero, so execution infers the token or uses the pathUSD/OUSD fallback, yet pool balance, pause, policy and AMM checks still watch X. The base branch behaves the same way. The PR fixes this orphaned-choice gap only forFallback-cached transactions, the same defect class its description names.Verification: Pre-existing. On a reorg, maintain.rs:547 builds
updatesonly from the new segment:let updates = TempoPoolUpdates::from_chain(tip);. The orphaned chain'sUserTokenSetlog never reachesuser_token_changes, so Check 6 does not fire. The base commit has the same line. Consequence: eviction and balance checks watch token X, which execution no longer charges.
|
This PR has been marked stale due to 7 days of inactivity. |
|
Closed due to inactivity. Reopen if still needed. |
…r token an orphaned block set A user token set only by an orphaned block may have chosen the cached fee token of a transaction without an explicit one, and the new segment emits no event to show it.
|
This PR has been marked stale due to 7 days of inactivity. |
On a reorg,
maintain_tempo_poolread balances and events only from the new segment, whose baseline is the fork point rather than the orphaned state a cached fee-token choice was computed against. A transaction could keep a token that execution no longer picks, so eviction watched the wrong token. A reorg now also revalidatesFallback-cached transactions whose payer's fallback-token balance slot the orphaned segment wrote, and transactions without an explicit fee token whose payer set a user token in the orphaned segment.Fixes CYCLOPS-5252.