Skip to content

fix: backport bot fee padding fixes to v4#21150

Open
AztecBot wants to merge 2 commits intobackport-to-v4-stagingfrom
claudebox/e453e995512e981d-2
Open

fix: backport bot fee padding fixes to v4#21150
AztecBot wants to merge 2 commits intobackport-to-v4-stagingfrom
claudebox/e453e995512e981d-2

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 5, 2026

Backports two fixes for the e2e_bot "reuses prior bridge claims" test failure caused by insufficient fee padding:

  1. fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul() #20962 — Increase minFeePadding from 9 to 99 in bridge resume tests and harden GasFees.mul() bigint arithmetic
  2. fix: set wallet minFeePadding in BotFactory constructor #20992 — Set wallet.setMinFeePadding(config.minFeePadding) in BotFactory constructor so all setup transactions use the configured padding

These fix the error: maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2Gas

ClaudeBox log: http://ci.aztec-labs.com/e453e995512e981d-2

AztecBot and others added 2 commits March 5, 2026 01:20
… 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)
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 5, 2026
@ludamad ludamad added the ci-draft Run CI on draft PRs. label Mar 5, 2026
@ludamad ludamad self-requested a review March 5, 2026 02:20
@ludamad ludamad marked this pull request as ready for review March 5, 2026 02:20
@ludamad ludamad enabled auto-merge (squash) March 5, 2026 02:26
@ludamad ludamad force-pushed the backport-to-v4-staging branch from 4ff264b to 2d467c9 Compare March 12, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants