fix: set wallet minFeePadding in BotFactory constructor#20992
Merged
alexghr merged 1 commit intomerge-train/spartanfrom Mar 2, 2026
Merged
fix: set wallet minFeePadding in BotFactory constructor#20992alexghr merged 1 commit intomerge-train/spartanfrom
alexghr merged 1 commit intomerge-train/spartanfrom
Conversation
alexghr
approved these changes
Mar 2, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 3, 2026
BEGIN_COMMIT_OVERRIDE fix: track last seen nonce in case of stale fallback L1 RPC node (#20855) feat: Validate num txs in block proposals (#20850) fix(archiver): enforce checkpoint boundary on rollbackTo (#20908) fix: tps zero metrics (#20656) fix: handle scientific notation in bigintConfigHelper (#20929) feat(aztec): node enters standby mode on genesis root mismatch (#20938) fix: logging of class instances (#20807) feat(slasher): make slash grace period relative to rollup upgrade time (#20942) chore: add script to find PRs to backport (#20956) chore: remove unused prover-node dep (#20955) fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul() (#20962) feat(sequencer): (A-526) rotate publishers when send fails (#20888) chore: (A-554) bump reth version 1.6.0 -> 1.11.1 for eth devnet (#20889) chore: metric on how many epochs validator has been on committee (#20967) fix: set wallet minFeePadding in BotFactory constructor (#20992) chore: deflake epoch invalidate block test (#21001) chore(sequencer): e2e tests for invalid signature recovery in checkpoint attestations (#20971) chore: deflake duplicate proposals and attestations (#20990) chore: deflake epochs mbps test (#21003) feat: reenable function selectors in txPublicSetupAllowList (#20909) fix: limit offenses when voting in tally slashing mode by slashMaxPayloadSize (#20683) fix(spartan): wire SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT env var (#21017) END_COMMIT_OVERRIDE
johnathan79717
pushed a commit
that referenced
this pull request
Mar 4, 2026
## Summary - Sets `wallet.setMinFeePadding(config.minFeePadding)` in the `BotFactory` constructor so that all transactions during bot setup (token deployment, minting) use the configured fee padding instead of the wallet's default (0.5). - Previously, only account deployment explicitly used `config.minFeePadding` (line 226 of factory.ts), while token deploy and minting relied on the wallet default, causing insufficient fee headroom when gas prices escalate during rapid block building in tests. ## Root cause The merge-train/spartan PR (#20899) was dequeued because `e2e_bot.test.ts` ("does not reuse prior bridge claims if recipient address changes") failed with: ``` maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2Gas, but got maxFeesPerGas.feePerL2Gas=698400000 and gasFees.feePerL2Gas=932700000 ``` The test config had `minFeePadding: 99` (100x multiplier), but this was only applied during account deployment, not during subsequent token deployment/minting which used the wallet's default 1.5x multiplier. ## Test plan - [x] `make yarn-project` builds successfully - [ ] CI e2e_bot test passes with the fix [ClaudeBox log](http://ci.aztec-labs.com/e9fdbc1ddac8e593-1)
AztecBot
added a commit
that referenced
this pull request
Mar 5, 2026
## Summary - Sets `wallet.setMinFeePadding(config.minFeePadding)` in the `BotFactory` constructor so that all transactions during bot setup (token deployment, minting) use the configured fee padding instead of the wallet's default (0.5). - Previously, only account deployment explicitly used `config.minFeePadding` (line 226 of factory.ts), while token deploy and minting relied on the wallet default, causing insufficient fee headroom when gas prices escalate during rapid block building in tests. ## Root cause The merge-train/spartan PR (#20899) was dequeued because `e2e_bot.test.ts` ("does not reuse prior bridge claims if recipient address changes") failed with: ``` maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2Gas, but got maxFeesPerGas.feePerL2Gas=698400000 and gasFees.feePerL2Gas=932700000 ``` The test config had `minFeePadding: 99` (100x multiplier), but this was only applied during account deployment, not during subsequent token deployment/minting which used the wallet's default 1.5x multiplier. ## Test plan - [x] `make yarn-project` builds successfully - [ ] CI e2e_bot test passes with the fix [ClaudeBox log](http://ci.aztec-labs.com/e9fdbc1ddac8e593-1)
AztecBot
added a commit
that referenced
this pull request
Mar 13, 2026
#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
added a commit
that referenced
this pull request
Mar 13, 2026
#20992 #21148) (#21465) ## Summary Backports three fixes from `next` and adds a fourth to stabilize the flaky `e2e_bot` test on `v4-next`. **Root cause:** The `BotFactory` was snapshotting `maxFeesPerGas` once 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 1. **BotFactory constructor sets wallet fee padding** (backport of #20992) - Calls `wallet.setMinFeePadding(config.minFeePadding)` so all setup transactions use the configured padding instead of the wallet default (0.5x) 2. **GasFees.mul() precision fix** (backport of #20962) - Uses bigint arithmetic for integer scalars to avoid precision loss - Uses `Math.ceil` for non-integer scalars to ensure fees always round up 3. **Dedicated L1 account for bridge resume tests** (backport of #21148) - Uses private key index 7 instead of the default mnemonic (shared with the sequencer) - Avoids nonce races on approve/deposit calls in `bridgeL1FeeJuice` - Uses `getPrivateKey()` helper with auto-incrementing index for other tests 4. **Remove stale fee snapshot** (new, also in #21464 on `next`) - Removes explicit `maxFeesPerGas` snapshot from `setupAccountWithPrivateKey` - Lets the wallet re-estimate fees at `send()` time via `completeFeeOptions()` - Fresh estimation + 10x padding is sufficient since fee change within 1 block is minimal Related: A-648, #21453 ClaudeBox log: https://claudebox.work/s/c64a6207b95c4a16?run=4
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
wallet.setMinFeePadding(config.minFeePadding)in theBotFactoryconstructor so that all transactions during bot setup (token deployment, minting) use the configured fee padding instead of the wallet's default (0.5).config.minFeePadding(line 226 of factory.ts), while token deploy and minting relied on the wallet default, causing insufficient fee headroom when gas prices escalate during rapid block building in tests.Root cause
The merge-train/spartan PR (#20899) was dequeued because
e2e_bot.test.ts("does not reuse prior bridge claims if recipient address changes") failed with:The test config had
minFeePadding: 99(100x multiplier), but this was only applied during account deployment, not during subsequent token deployment/minting which used the wallet's default 1.5x multiplier.Test plan
make yarn-projectbuilds successfullyClaudeBox log