Skip to content

fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul()#20962

Merged
ludamad merged 3 commits intomerge-train/spartanfrom
claudebox/eb7d3f6401d9866b-1
Feb 27, 2026
Merged

fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul()#20962
ludamad merged 3 commits intomerge-train/spartanfrom
claudebox/eb7d3f6401d9866b-1

Conversation

@AztecBot
Copy link
Collaborator

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

ClaudeBox log

… GasFees.mul()

Gas fees can escalate >10x during rapid block building in the test environment.
The previous 10x padding (minFeePadding: 9) was insufficient. Increased to 100x
(minFeePadding: 99) for both bridge resume tests.

Also improved GasFees.mul() to use bigint arithmetic for integer scalars,
avoiding potential precision loss with large values, while properly handling
non-integer scalars via Math.ceil.
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Feb 27, 2026
@ludamad ludamad marked this pull request as ready for review February 27, 2026 16:13
@ludamad ludamad enabled auto-merge (squash) February 27, 2026 16:56
@ludamad ludamad self-assigned this Feb 27, 2026
@ludamad ludamad merged commit 3c106f2 into merge-train/spartan Feb 27, 2026
15 checks passed
@ludamad ludamad deleted the claudebox/eb7d3f6401d9866b-1 branch February 27, 2026 16:58
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
… 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>
AztecBot added a commit that referenced this pull request Mar 5, 2026
… 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>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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