Skip to content

Route all non-governance txs through the cart with Multicall3 batching#70

Merged
koenmtb1 merged 4 commits into
mainfrom
km/multicall
May 13, 2026
Merged

Route all non-governance txs through the cart with Multicall3 batching#70
koenmtb1 merged 4 commits into
mainfrom
km/multicall

Conversation

@koenmtb1
Copy link
Copy Markdown
Contributor

@koenmtb1 koenmtb1 commented May 13, 2026

  • Adds Multicall3 batching for cart-eligible entries (claims), with gas-aware chunking, dependency-preserving auto-reorder, simulation + outcome verification, and graceful fallback to sequential EOA execution
  • Routes the remaining direct-tx flows through the cart, unstake/finalize (rollup, staker), operator updates, staker upgrades, move-funds-to-vault, and admin tools
  • Adds a collapsible MulticallBatchHeader so users can see which entries got bundled into a single signature
  • Bumps the cart's stacking order so it renders above modals when opened from inside one

closes #37

@koenmtb1 koenmtb1 requested a review from a team as a code owner May 13, 2026 08:14
…71)

* fix: throw instead of return on multicall pre-send failures

Simulation and outcome-check failures inside the Multicall3 execution path
called showAlert and returned. The dispatcher's executeAll loop treated the
silent return as success, continued past the segment, and fired its terminal
"All transactions executed successfully" toast — directly contradicting the
error toast the user had just seen.

Convert the four pre-send bailout paths to throw. For the two cases that
fail after the cart has accepted entries (simulation, outcome check), mark
every entry in the affected chunk as failed with the parsed reason before
throwing so per-entry attribution survives in the cart panel.

* fix: restore user-facing alerts on multicall pre-flight failures

The prior commit converted four return paths to throws, but two of them
("Wallet client not ready" and "hasExecutingTx") dropped their showAlert
calls. Because nothing higher up catches the thrown error, the user saw
nothing — silent failure replaced the prior toast.

Restore the alerts alongside the throw, matching the pattern already used
for the simulation- and outcome-check branches.

* fix: drop redundant showAlert calls — outer wrapper already emits toast

`TransactionCartContext.executeAll` already wraps `executeAllTransactions()`
in a try/catch that fires `showAlert("error", error.message)` on any
rejection. The showAlert calls added in the prior commit were therefore
duplicating the wrapper's toast (and in the `hasExecutingTx` branch, the
two toasts even disagreed on type — info vs. error).

Remove the local showAlert at every site that now throws. Keep:
  - the throws themselves (still required to abort `executeAll` and
    prevent the false-success toast),
  - the `setTransactions(failed)` blocks in the simulation / outcome-check
    branches (they add per-entry attribution the wrapper can't reconstruct),
  - the chunk-count info toast above the chunk loop (legitimate, not
    duplicated by the wrapper).

`error.message` carries the chunk-labelled reason verbatim, so the toast
the user sees is identical to what the local showAlert was emitting.
@koenmtb1 koenmtb1 merged commit 2d00f1c into main May 13, 2026
5 checks passed
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.

Use multicall3 when staking / withdrawing / claiming for multiple sequencers

2 participants