fix: backport bot fee padding fixes to v4#21150
Open
AztecBot wants to merge 2 commits intobackport-to-v4-stagingfrom
Open
fix: backport bot fee padding fixes to v4#21150AztecBot wants to merge 2 commits intobackport-to-v4-stagingfrom
AztecBot wants to merge 2 commits intobackport-to-v4-stagingfrom
Conversation
… GasFees.mul() (#20962) ## Summary - Increased `minFeePadding` from 9 (10x headroom) to 99 (100x headroom) in both bridge resume tests in `e2e_bot.test.ts`. Gas fees can escalate >13x during rapid block building in the test environment, causing flaky failures with insufficient padding. - Improved `GasFees.mul()` to use bigint arithmetic for integer scalars, avoiding potential precision loss with large values. Non-integer scalars (e.g., 1.5) are handled via `Math.ceil` to ensure fees always round up. ## Test plan - CI should pass the `e2e_bot` test suite, specifically "does not reuse prior bridge claims if recipient address changes" - Existing callers of `GasFees.mul()` with integer and non-integer scalars should work identically 🤖 Generated with [Claude Code](https://claude.com/claude-code) [ClaudeBox log](http://ci.aztec-labs.com/eb7d3f6401d9866b-1) --------- Co-authored-by: ludamad <adam.domurad@gmail.com>
## 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)
4ff264b to
2d467c9
Compare
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.
Backports two fixes for the
e2e_bot"reuses prior bridge claims" test failure caused by insufficient fee padding:minFeePaddingfrom 9 to 99 in bridge resume tests and hardenGasFees.mul()bigint arithmeticwallet.setMinFeePadding(config.minFeePadding)inBotFactoryconstructor so all setup transactions use the configured paddingThese fix the error:
maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2GasClaudeBox log: http://ci.aztec-labs.com/e453e995512e981d-2