perf(e2e): seed BananaFPC fee juice at genesis instead of bridging#24564
Open
spalladino wants to merge 1 commit into
Open
perf(e2e): seed BananaFPC fee juice at genesis instead of bridging#24564spalladino wants to merge 1 commit into
spalladino wants to merge 1 commit into
Conversation
The fees suites paid a setup:bridge span (~48s / ~4 production slots) in applyFPCSetup to bridge fee juice from L1 to the BananaFPC. Fee-juice balances are just public-data leaves at computeFeePayerBalanceLeafSlot(address), which getGenesisValues already prefills for genesis-funded accounts (and the sponsored FPC). Fix the BananaCoin and BananaFPC deploy salts so their addresses are deterministic given the FPC admin (the first setup account), add a computeExtraGenesisFundedAddresses hook to setup so a test can genesis-fund an address derived from a generated account, and use it to seed the BananaFPC's fee juice at genesis. The address is included in the L1 portal fundingNeeded accounting via the existing initial-accounts path. applyFPCSetup no longer bridges; it asserts the deployed FPC address matches the seeded one. The bridging/claim flow that the fee-juice tests exercise directly (mintAndBridgeFeeJuice, FeeJuicePaymentMethodWithClaim) keeps its real txs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
PR 2 of the round-4 e2e speedup effort. The fees-family suites pay a
setup:bridgespan (~48s ≈ 4 production slots per process) inFeesTest.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), whichgetGenesisValues(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: truebridges was stale — the sponsored FPC has been genesis-funded since #19532 (setup pushes its deterministic address into the genesis-funded list). The remainingsetup:bridgecost in the fees family is the BananaFPC bridge, which this PR removes.Mechanism
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 acomputeExtraGenesisFundedAddresses(defaultAccounts)hook onSetupOptionsruns after the accounts are generated and before genesis values are computed.FeesTestuses it to derive the BananaFPC address from the first account and add it to the genesis-funded list.addressesToFund→getGenesisValues), so it is funded with the same fee juice as an initial account (10^22) and automatically included in the L1FeeJuicePortalfeeJuicePortalInitialBalance(fundingNeeded) accounting — the portal's locked L1 balance stays consistent with total L2 fee-juice supply, exactly as for every other genesis-funded balance.applyFPCSetupdeploys 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". ThebridgeFromL1ToL2call is removed.setup:bridgespan 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.applyFPCSetupBananaFPC funding → moved to genesis. Used byaccount_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 inaccount_inittest bodies that test the bridge/claim flow ("pays natively in the Fee Juice after Alice bridges funds") — real behavior under test.account_initFeeJuicePaymentMethodWithClaim/prepareTokensOnL1→ kept. Tests the atomic claim-in-deploy flow.fundSponsoredFPC: trueon 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_benchmarkbridges to its BananaFPC → out of scope (benchmark harness, not in the fees e2e timing family), kept.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 zerosetup:bridgeoccurrences (was ~48s), whiledeploy:fpc/deploy:tokenremain. 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 withsetup:bridgepresent in the test body, confirming the retained bridge/claim harness still works.Measured numbers from a full CI run vs merge-base will be appended after a green run.