Commit 15f769d
authored
test(e2e_fees): bridge fee juice from a dedicated L1 account (#24054)
## What
`e2e_fees/account_init` → *"account pays its own fee › pays natively in
the Fee Juice by bridging funds themselves"* flakes while preparing L1
fee juice (before the account deploy), failing on the bridge write:
```
ContractFunctionExecutionError: ... contract function "depositToAztecPublic"
from: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Details: replacement transaction underpriced
```
CI: http://ci.aztec-labs.com/60b00f39a7a0e3cc
## Why
The fee-juice bridge test harness does direct L1 writes (`mint` →
`approve` → `depositToAztecPublic`) through a plain viem client with
**no nonce manager**, so each write picks its nonce via
`getTransactionCount('pending')`. That client uses Anvil account
`0xf39f…92266` (mnemonic index 0) — which is **also the sequencer
publisher account**. The publisher tracks its own nonce in
`l1-tx-utils`, independently of the test client.
When a test write and a publisher checkpoint tx land on the same nonce
concurrently, the higher-priced publisher tx wins and the test's
lower-priced tx is rejected. In the failed run the publisher was sending
on account #0 at ~95–120 gwei:
```
node:l1-tx-utils Sent L1 transaction 0x9652… {nonce: 67, account: 0xf39f…92266, maxFeePerGas: "95.396…"}
```
while the test's `depositToAztecPublic` went out on the same account at
nonce **60** / ~26 gwei → `replacement transaction underpriced`.
The shared-account race is pre-existing but rarely hit; #24037 (changing
publisher send timing) makes the overlap more likely, which surfaced it.
## Fix
Send the harness's direct L1 writes from a dedicated mnemonic account
(`L1_DIRECT_WRITE_ACCOUNT_INDEX = 1`) instead of the deployer/publisher
account #0. Index 1 is unused by any L1-tx sender in these setups
(publisher = 0, prover = 2, validators = 3+), so the test's writes no
longer share a nonce stream with the publisher. Affects `FeesTest` and
`ClientFlowsBenchmark`.1 parent 49c510a commit 15f769d
3 files changed
Lines changed: 33 additions & 4 deletions
File tree
- yarn-project/end-to-end/src
- bench/client_flows
- e2e_fees
- fixtures
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
247 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
248 | 261 | | |
249 | 262 | | |
250 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
| |||
0 commit comments