Skip to content

chore(e2e): fix e2e bot L1 tx nonce reuse#21052

Merged
spalladino merged 1 commit intomerge-train/spartanfrom
palla/fix-e2e-bot
Mar 3, 2026
Merged

chore(e2e): fix e2e bot L1 tx nonce reuse#21052
spalladino merged 1 commit intomerge-train/spartanfrom
palla/fix-e2e-bot

Conversation

@spalladino
Copy link
Contributor

@spalladino spalladino commented Mar 3, 2026

Fixes the following error caused by reusing the same L1 private key across multiple bots, without waiting for the txs from the previous bots to be done.

13:06:39   ● e2e_bot › bridge resume › does not reuse prior bridge claims if recipient address changes
13:06:39
13:06:39     expect(received).rejects.toThrow(expected)
13:06:39
13:06:39     Expected substring: "test error"
13:06:39     Received message:   "Transaction creation failed.·
13:06:39     URL: http://127.0.0.1:8545
13:06:39     Request body: {\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f8b1827a6935843b9aca00843c028b4a82b54194a513e6e4b8f2a923d98304ec87f64353c4d5c85380b844095ea7b3000000000000000000000000846005fdb8e3f125749df47d36b2c826029e536400000000000000000000000000000000000000000000003635c9adc5dea00000c080a019eb199d74619635cc3f88492e1818ae26ece48c5dc102091b03be9a4cbc2df7a0047b03d47e4f034a239c639c6610d472e36a35b01c070f6b9072c1b67df6b9c4\"]}··
13:06:39     Request Arguments:
13:06:39       from:  0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
13:06:39       to:    0xa513e6e4b8f2a923d98304ec87f64353c4d5c853
13:06:39       data:  0x095ea7b3000000000000000000000000846005fdb8e3f125749df47d36b2c826029e536400000000000000000000000000000000000000000000003635c9adc5dea00000··
13:06:39     Contract Call:
13:06:39       address:   0xa513e6e4b8f2a923d98304ec87f64353c4d5c853
13:06:39       function:  approve(address spender, uint256 value)
13:06:39       args:             (0x846005fdb8e3f125749df47d36b2c826029e5364, 1000000000000000000000)
13:06:39       sender:    0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266·
13:06:39     Docs: https://viem.sh/docs/contract/writeContract
13:06:39     Details: replacement transaction underpriced
13:06:39     Version: viem@2.38.2"
13:06:39
13:06:39           87 |         this.logger.info(`Approving ${amount} tokens for ${stringifyEthAddress(address, addressName)}`);
13:06:39           88 |         await this.extendedClient.waitForTransactionReceipt({
13:06:39         > 89 |             hash: await this.contract.write.approve([
13:06:39              |                   ^
13:06:39           90 |                 address,
13:06:39           91 |                 amount
13:06:39           92 |             ])
13:06:39
13:06:39           at getContractError (../node_modules/viem/utils/errors/getContractError.ts:78:10)
13:06:39           at writeContract.internal (../node_modules/viem/actions/wallet/writeContract.ts:242:13)
13:06:39           at L1TokenManager.approve (../aztec.js/dest/ethereum/portal_manager.js:89:19)
13:06:39           at L1FeeJuicePortalManager.bridgeTokensPublic (../aztec.js/dest/ethereum/portal_manager.js:129:9)
13:06:39           at BotFactory.bridgeL1FeeJuice (../bot/dest/factory.js:450:23)
13:06:39           at BotFactory.getOrCreateBridgeClaim (../bot/dest/factory.js:432:23)
13:06:39           at BotFactory.setupAccountWithPrivateKey (../bot/dest/factory.js:170:27)
13:06:39           at BotFactory.setupAccount (../bot/dest/factory.js:149:20)
13:06:39           at BotFactory.setup (../bot/dest/factory.js:49:39)
13:06:39           at Bot.create (../bot/dest/bot.js:14:61)
13:06:39           at Object.<anonymous> (src/e2e_bot.test.ts:189:9)

Fix is to use different L1 private key per test.

Fixes the following error caused by reusing the same L1 private key
across multiple bots, without waiting for the txs from the previous bots
to be done.

```
13:06:39   ● e2e_bot › bridge resume › does not reuse prior bridge claims if recipient address changes
13:06:39
13:06:39     expect(received).rejects.toThrow(expected)
13:06:39
13:06:39     Expected substring: "test error"
13:06:39     Received message:   "Transaction creation failed.·
13:06:39     URL: http://127.0.0.1:8545
13:06:39     Request body: {\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f8b1827a6935843b9aca00843c028b4a82b54194a513e6e4b8f2a923d98304ec87f64353c4d5c85380b844095ea7b3000000000000000000000000846005fdb8e3f125749df47d36b2c826029e536400000000000000000000000000000000000000000000003635c9adc5dea00000c080a019eb199d74619635cc3f88492e1818ae26ece48c5dc102091b03be9a4cbc2df7a0047b03d47e4f034a239c639c6610d472e36a35b01c070f6b9072c1b67df6b9c4\"]}··
13:06:39     Request Arguments:
13:06:39       from:  0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
13:06:39       to:    0xa513e6e4b8f2a923d98304ec87f64353c4d5c853
13:06:39       data:  0x095ea7b3000000000000000000000000846005fdb8e3f125749df47d36b2c826029e536400000000000000000000000000000000000000000000003635c9adc5dea00000··
13:06:39     Contract Call:
13:06:39       address:   0xa513e6e4b8f2a923d98304ec87f64353c4d5c853
13:06:39       function:  approve(address spender, uint256 value)
13:06:39       args:             (0x846005fdb8e3f125749df47d36b2c826029e5364, 1000000000000000000000)
13:06:39       sender:    0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266·
13:06:39     Docs: https://viem.sh/docs/contract/writeContract
13:06:39     Details: replacement transaction underpriced
13:06:39     Version: viem@2.38.2"
13:06:39
13:06:39           87 |         this.logger.info(`Approving ${amount} tokens for ${stringifyEthAddress(address, addressName)}`);
13:06:39           88 |         await this.extendedClient.waitForTransactionReceipt({
13:06:39         > 89 |             hash: await this.contract.write.approve([
13:06:39              |                   ^
13:06:39           90 |                 address,
13:06:39           91 |                 amount
13:06:39           92 |             ])
13:06:39
13:06:39           at getContractError (../node_modules/viem/utils/errors/getContractError.ts:78:10)
13:06:39           at writeContract.internal (../node_modules/viem/actions/wallet/writeContract.ts:242:13)
13:06:39           at L1TokenManager.approve (../aztec.js/dest/ethereum/portal_manager.js:89:19)
13:06:39           at L1FeeJuicePortalManager.bridgeTokensPublic (../aztec.js/dest/ethereum/portal_manager.js:129:9)
13:06:39           at BotFactory.bridgeL1FeeJuice (../bot/dest/factory.js:450:23)
13:06:39           at BotFactory.getOrCreateBridgeClaim (../bot/dest/factory.js:432:23)
13:06:39           at BotFactory.setupAccountWithPrivateKey (../bot/dest/factory.js:170:27)
13:06:39           at BotFactory.setupAccount (../bot/dest/factory.js:149:20)
13:06:39           at BotFactory.setup (../bot/dest/factory.js:49:39)
13:06:39           at Bot.create (../bot/dest/bot.js:14:61)
13:06:39           at Object.<anonymous> (src/e2e_bot.test.ts:189:9)
```

Fix is to use different L1 private key per test.
@spalladino spalladino enabled auto-merge (squash) March 3, 2026 14:01
@spalladino spalladino merged commit d471d24 into merge-train/spartan Mar 3, 2026
11 of 12 checks passed
@spalladino spalladino deleted the palla/fix-e2e-bot branch March 3, 2026 14:03
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
test: update proving-real test to mbps (#20991)
chore: epoch proving log analyzer (#21033)
chore: update pause script to allow resume (#21032)
feat: price bump for RPC transaction replacement (#20806)
refactor: remove update checker, retain version checks (#20898)
fix: (A-592) p2p client proposal tx collector test (#20998)
refactor: use publishers-per-pod in deployments (#21039)
chore: web3signer refreshes keystore (#21045)
feat(sequencer): set block building limits from checkpoint limits
(#20974)
chore(e2e): fix e2e bot L1 tx nonce reuse (#21052)
feat: Update L1 to L2 message APIs (#20913)
fix: (A-589) epochs l1 reorgs test (#20999)
feat(sequencer): add SEQ_MAX_TX_PER_CHECKPOINT config (#21016)
fix: drop --pid=host from docker_isolate (#21081)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
feat(validator): add VALIDATOR_ env vars for independent block limits
(#21060)
refactor(p2p): decouple proposal validators from base class via
composition (#21075)
feat: additional validation in public setup allowlist (onlySelf + null
msg sender) (#21122)
fix: (A-591) aztecProofSubmissionEpochs incorrectly named as
aztecProofSubmissionWindow (#21108)
refactor(sequencer): rename SEQ_GAS_PER_BLOCK_ALLOCATION_MULTIPLIER to
SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER (#21125)
fix: unbound variable in check_doc_references.sh with set -u (#21126)
feat: calldata length validation of public setup function allowlist
(#21139)
fix: include mismatched values in tx metadata validation errors (#21147)
feat: single-node implementation of slash-protection signer (#20894)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
chore: More updated Alpha configuration (#21155)
chore: tally slashing pruning improvements (#21161)
fix: update dependencies (#20997)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21169)
refactor(p2p): (A-588) maintain sorted array in tx pool instead of
sorting on read (#21079)
fix(p2p): report most severe failure in runValidations (#21185)
fix: use dedicated L1 account for bot bridge resume tests to avoid nonce
race (#21148)
fix: parse error.message in formatViemError (#21163)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
chore: code decuplication + refactor (public setup allowlist) (#21200)
END_COMMIT_OVERRIDE
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.

2 participants