Commit 4be0457
perf(e2e): seed BananaFPC fee juice at genesis instead of bridging (#24564)
## What / why
PR 2 of the round-4 e2e speedup effort. The fees-family suites pay a
`setup:bridge` span (~48s ≈ 4 production slots per process) in
`FeesTest.applyFPCSetup`, bridging fee juice from L1 to the BananaFPC
via the gas portal (`bridgeFromL1ToL2` = prepare-on-L1 + advance 2
blocks + a claim tx). That funding is pure setup plumbing — the fees
tests snapshot the FPC's gas balance and assert deltas, they don't
assert on the bridge itself.
Fee-juice balances are just public-data leaves at
`computeFeePayerBalanceLeafSlot(address)`, which `getGenesisValues`
(`world-state/src/testing.ts`) already prefills for genesis-funded
accounts — the same mechanism that funds the initial accounts and
(already, on this base) the sponsored FPC. This PR seeds the BananaFPC's
fee juice at genesis instead of bridging it during setup.
Note: the plan's premise that `fundSponsoredFPC: true` bridges was stale
— the sponsored FPC has been genesis-funded since #19532 (setup pushes
its deterministic address into the genesis-funded list). The remaining
`setup:bridge` cost in the fees family is the BananaFPC bridge, which
this PR removes.
## Mechanism
- The BananaFPC address depends on the BananaCoin address and the FPC
admin (the first setup account), and the accounts are generated *inside*
`setup()` with random secrets — so the FPC address can't be precomputed
by the test before genesis. Fixed deploy salts are added for BananaCoin
and BananaFPC so both addresses become deterministic once the admin is
known, and a `computeExtraGenesisFundedAddresses(defaultAccounts)` hook
on `SetupOptions` runs after the accounts are generated and before
genesis values are computed. `FeesTest` uses it to derive the BananaFPC
address from the first account and add it to the genesis-funded list.
- The returned address flows through the existing initial-accounts path
(`addressesToFund` → `getGenesisValues`), so it is funded with the same
fee juice as an initial account (`10^22`) and automatically included in
the L1 `FeeJuicePortal` `feeJuicePortalInitialBalance` (`fundingNeeded`)
accounting — the portal's locked L1 balance stays consistent with total
L2 fee-juice supply, exactly as for every other genesis-funded balance.
- `applyFPCSetup` deploys the FPC with the fixed salt and asserts the
deployed address equals the seeded one, so any drift in the
deterministic deploy params surfaces as a clear error instead of a
downstream "insufficient fee payer balance". The `bridgeFromL1ToL2` call
is removed.
- The `setup:bridge` span wrapper is kept in place for the bridging that
remains, so its disappearance from the fees setup hooks is the measured
proof.
## Scope decisions (site by site)
- **`FeesTest.applyFPCSetup` BananaFPC funding** → moved to genesis.
Used by `account_init`, `private_payments.parallel`, `failures`,
`gas_estimation.parallel`. This is the only funding that moved.
- **`FeesTest.mintAndBridgeFeeJuice`** (bridges to an arbitrary
recipient) → kept. It fires in `account_init` test bodies that test the
bridge/claim flow ("pays natively in the Fee Juice after Alice bridges
funds") — real behavior under test.
- **`account_init` `FeeJuicePaymentMethodWithClaim` /
`prepareTokensOnL1`** → kept. Tests the atomic claim-in-deploy flow.
- **Sponsored FPC** → already genesis-funded via `fundSponsoredFPC:
true` on this base; no change.
- **`cross_chain_messaging_test`** (`fundSponsoredFPC: true`) → already
genesis-funded; its own cross-chain bridging harness is the behavior
under test, kept.
- **`bench/client_flows_benchmark`** bridges to its BananaFPC → out of
scope (benchmark harness, not in the fees e2e timing family), kept.
- Production/sandbox funding paths (cli, `aztec sandbox`) → untouched.
The new hook defaults to unset; only the e2e fixtures opt in.
## Expected effect
~48s × the number of fees processes that ran the FPC bridge in setup
(account_init, private_payments, failures, gas_estimation). No C++, no
new config, no change to production genesis roots.
## Local verification
- `single-node/fees/account_init -t 'pays privately through an FPC'`
passes; the span leaderboard for the run shows **zero `setup:bridge`**
occurrences (was ~48s), while `deploy:fpc`/`deploy:token` remain. The
FPC-paying test asserts the FPC's gas balance decreases by the fee, so
the genesis funding is exercised end to end, and the deployed-address
assertion held.
- `single-node/fees/account_init -t 'after Alice bridges funds'` passes
with `setup:bridge` present in the test body, confirming the retained
bridge/claim harness still works.
## Measured impact
The `setup:bridge` span is eliminated across the run: 17 occurrences
totalling 646.4s of bridge
setup time in the baseline drop to zero in the PR run. The 13 fees-hook
bridges (~48s each) are the
bulk of it.
- Fees beforeHooks per shard: `private_payments.parallel` −51.1s (×8
shards),
`gas_estimation.parallel` −48.1s (×3), `failures` −47.8s, `account_init`
−47.8s — each matching the
~48s (4-slot) bridge cost.
- `setup:bridge` busyMs removed per suite: account_init 48.1s, failures
48.2s, gas_estimation ×3 =
144.6s, private_payments ×8 = 384.7s (13 fees-hook bridges ≈ 625.5s),
plus the ~5s sponsored-FPC
bridges on `amm` and `storage_proof`.
- Total beforeHooks reduction over the suites present in both runs:
−907.4s summed across shards
(wall-clock benefit is smaller, since the fees shards run in parallel).
- One suite moved the wrong way within noise: `fee_juice_payments`
+11.0s. It keeps its real
bridging/claim txs (no `setup:bridge` span removed), so this is
run-to-run variance, not a
regression from this change.
Baseline CI run 1783374468714213 (merge-base e1711d3, full). PR CI
run 1783375878950264
(x-fast — the comparison is per-suite over the suites present in both
runs).
Fixes A-1405
(cherry picked from commit 1321e98)1 parent 3b0823e commit 4be0457
2 files changed
Lines changed: 69 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
| |||
458 | 466 | | |
459 | 467 | | |
460 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
461 | 475 | | |
462 | 476 | | |
463 | 477 | | |
| |||
Lines changed: 55 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
37 | 67 | | |
38 | 68 | | |
39 | 69 | | |
40 | 70 | | |
41 | 71 | | |
42 | | - | |
43 | | - | |
| 72 | + | |
| 73 | + | |
44 | 74 | | |
45 | 75 | | |
46 | 76 | | |
| |||
116 | 146 | | |
117 | 147 | | |
118 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
119 | 154 | | |
120 | 155 | | |
121 | 156 | | |
| |||
247 | 282 | | |
248 | 283 | | |
249 | 284 | | |
250 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
251 | 289 | | |
252 | 290 | | |
253 | 291 | | |
| |||
270 | 308 | | |
271 | 309 | | |
272 | 310 | | |
273 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
274 | 315 | | |
275 | 316 | | |
276 | 317 | | |
277 | 318 | | |
278 | 319 | | |
279 | 320 | | |
280 | | - | |
281 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
282 | 331 | | |
283 | 332 | | |
284 | 333 | | |
| |||
0 commit comments