Skip to content

feat: assert non revertible phase when setting fee payer - #24479

Merged
nventuro merged 4 commits into
merge-train/fairies-v5from
nv/fee-payer-setup-phase-assert
Jul 10, 2026
Merged

nventuro merged 4 commits into
merge-train/fairies-v5from
nv/fee-payer-setup-phase-assert

Conversation

@nventuro

@nventuro nventuro commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The fee payer should only be set in the non-revertible phase, but we were not asserting this.

@nventuro
nventuro requested a review from nchamo July 2, 2026 20:29
Comment thread yarn-project/end-to-end/src/automine/phase_check.parallel.test.ts Outdated
@nventuro
nventuro enabled auto-merge (squash) July 10, 2026 18:01
@nventuro
nventuro merged commit da9ac1c into merge-train/fairies-v5 Jul 10, 2026
12 checks passed
@nventuro
nventuro deleted the nv/fee-payer-setup-phase-assert branch July 10, 2026 18:20
@PhilWindle PhilWindle added port-to-next Forward-port this merged PR into next and removed port-to-next Forward-port this merged PR into next labels Jul 21, 2026
spalladino added a commit that referenced this pull request Jul 23, 2026
(cherry picked from commit da9ac1c)

CONFLICTS LEFT INTENTIONALLY for follow-up resolution.
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
…rotocol#24930)

Forward-ports the **end-to-end / testing** slice of the v5-next → next
backlog (work merged to `v5-next` after the ~2026-07-08 cut that
reshaped `next`).

## Applied (clean cherry-picks, chronological)
- AztecProtocol#24518 docs(e2e): update READMEs for the consolidated suite layout
- AztecProtocol#24534 test(e2e): instrument and diagnose bot suite setup cost
- AztecProtocol#24566 perf(e2e): warp dead waits in multi-node recovery and proving
tests
- AztecProtocol#24570 perf(e2e): shrink e2e slot times
- AztecProtocol#24564 perf(e2e): seed BananaFPC fee juice at genesis instead of
bridging
- AztecProtocol#24568 perf(e2e): seed standard contracts at genesis
- AztecProtocol#24597 chore: add writing-e2e-tests skill
- AztecProtocol#24590 feat(e2e): interactive handshake e2e
- AztecProtocol#24671 test: fix proof_boundary startup race

## ⚠️ Needs owner conflict-resolution (conflict against reshaped `next`;
not included here)
Cherry-pick onto this branch and resolve:
- [ ] AztecProtocol#24569 `git cherry-pick -x 1d280af` — perf(e2e): overlap and
batch setup txs in e2e harnesses
- [ ] AztecProtocol#24479 `git cherry-pick -x da9ac1c` — feat: assert non
revertible phase when setting fee payer

Part of the manual v5-next backlog sweep. Draft until owners resolve the
conflicts above and CI is green.
nventuro pushed a commit that referenced this pull request Aug 27, 2026
## Summary

`BatchCall.simulate()` silently discarded `options.fee.paymentMethod`
and dropped the merged payload's `feePayer`, so batches simulated with a
sponsored/deferred fee method ran with the wallet's fallback handling
(`PREEXISTING_FEE_JUICE`) instead of the caller's method. The wallet's
account entrypoint then self-elected as fee payer and ended setup up
front — a different phase structure than the caller asked for.

Resolves F-785. Surfaced while landing #24479.

## Changes

- `batch_call.ts`: fetch
`options.fee.paymentMethod.getExecutionPayload()`, merge it ahead of the
batch (mirroring `request()`), and preserve `combinedPayload.feePayer`
when rebuilding the `ExecutionPayload`.
- The wallet-side app-call offset only counts the wallet's own fee
payment method, not one supplied via `options.fee`. So each batched
call's private/public return-value index is offset by the fee payload's
own call counts of each type; otherwise a call-contributing method (e.g.
`SponsoredFeePaymentMethod`) shifts the indices and the fee call's
return values decode as the first app call's.
- `contract_function_interaction.ts`: fixed the same latent off-by-one
under a call-contributing fee method. The single app call is the last of
its type in the payload, so its index is derived from the merged payload
(avoiding a second `getExecutionPayload()` call).
- `phase_check.parallel.test.ts`: reverted the #24479 workaround back to
the plain `batch.simulate({ from, fee })` form now that the option is
honored.

## Testing

- Added 3 `batch_call` unit tests: return-value index offset (asserting
on actual decoded values, not just absence of errors), `feePayer` from
the payment method, and `feePayer` carried by a batched payload.
Verified red/green — the offset test fails without the fix.
- All 3 `phase_check` e2e tests pass, including the reverted
late-election test.
- No behavior change for batches simulated without `fee.paymentMethod`
(offsets are 0).
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.

3 participants