fix: stabilize e2e_bot test fees and fix L1 nonce races (backport #20962 #20992 #21148)#21465
Merged
ludamad merged 1 commit intobackport-to-v4-next-stagingfrom Mar 13, 2026
Merged
Conversation
#20992 #21148) BEGIN_COMMIT_OVERRIDE fix: set wallet minFeePadding in BotFactory constructor (#20992) fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul() (#20962) fix: use dedicated L1 account for bot bridge resume tests to avoid nonce race (#21148) fix: remove stale fee snapshot from BotFactory account deployment END_COMMIT_OVERRIDE Backports three fixes from next and adds a fourth: 1. BotFactory constructor now calls wallet.setMinFeePadding() so all setup transactions (token deploy, minting) use the configured padding instead of the wallet default (0.5x). (#20992) 2. GasFees.mul() uses bigint arithmetic for integer scalars to avoid precision loss, and Math.ceil for non-integer scalars. (#20962) 3. Bridge resume tests use a dedicated L1 private key (index 7) instead of the default mnemonic shared with the sequencer, avoiding nonce races on approve/deposit calls. (#21148) 4. Remove explicit maxFeesPerGas snapshot from setupAccountWithPrivateKey. Let the wallet re-estimate fees at send() time via completeFeeOptions(), making the fee estimate fresh and 10x padding sufficient.
ludamad
approved these changes
Mar 13, 2026
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.
Summary
Backports three fixes from
nextand adds a fourth to stabilize the flakye2e_bottest onv4-next.Root cause: The
BotFactorywas snapshottingmaxFeesPerGasonce during account setup, then using that stale value for subsequent transactions. L1 baseFee escalation on anvil (from rapid block building) caused fees to exceed the stale cap.Changes
BotFactory constructor sets wallet fee padding (backport of fix: set wallet minFeePadding in BotFactory constructor #20992)
wallet.setMinFeePadding(config.minFeePadding)so all setup transactions use the configured padding instead of the wallet default (0.5x)GasFees.mul() precision fix (backport of fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul() #20962)
Math.ceilfor non-integer scalars to ensure fees always round upDedicated L1 account for bridge resume tests (backport of fix: use dedicated L1 account for bot bridge resume tests to avoid nonce race #21148)
bridgeL1FeeJuicegetPrivateKey()helper with auto-incrementing index for other testsRemove stale fee snapshot (new, also in fix: remove stale fee snapshot from BotFactory and reduce minFeePadding to 10x #21464 on
next)maxFeesPerGassnapshot fromsetupAccountWithPrivateKeysend()time viacompleteFeeOptions()Related: A-648, #21453
ClaudeBox log: https://claudebox.work/s/c64a6207b95c4a16?run=4