Skip to content

fix(abstract-eth): validate maxPriorityFeePerGas <= maxFeePerGas (CGD-573)#8459

Open
pritam-gembali wants to merge 1 commit intomasterfrom
fix/eip1559-priority-fee-validation
Open

fix(abstract-eth): validate maxPriorityFeePerGas <= maxFeePerGas (CGD-573)#8459
pritam-gembali wants to merge 1 commit intomasterfrom
fix/eip1559-priority-fee-validation

Conversation

@pritam-gembali
Copy link
Copy Markdown
Contributor

Summary

  • Adds cross-field EIP-1559 validation in transactionBuilder.ts fee() setter: throws BuildTransactionError when maxPriorityFeePerGas > maxFeePerGas
  • Adds testEip1559PriorityFeeExceedsMaxFee helper in abstract-eth test utilities
  • Adds an inline test in sdk-coin-eth covering both the invalid case and the equal-value boundary

Context

EIP-1559 transactions with maxPriorityFeePerGas > maxFeePerGas are rejected by Ethereum nodes. The SDK previously accepted such values silently — the transaction passed signing but failed at broadcast. A partial mitigation already exists in the microservices API layer (validateEip1559Params()), but SDK consumers using offline signing or direct builder access were unprotected.

Test plan

  • yarn run unit-test --scope @bitgo/abstract-eth — 70 passing
  • yarn run unit-test --scope @bitgo/sdk-coin-eth — 142 passing (9 pre-existing failures due to missing BITGOJS_TEST_PASSWORD, unrelated to this change)
  • New test confirmed isolated: mocha --grep maxPriorityFeePerGas → 1 passing

Ticket: CGD-573

🤖 Generated with Claude Code

@linear
Copy link
Copy Markdown

linear bot commented Apr 9, 2026

EIP-1559 transactions with a priority fee exceeding the max fee are
invalid and rejected by Ethereum nodes. Previously the SDK accepted
such values silently, producing a transaction that would fail at
broadcast. Add a cross-field check in the fee() setter so the error
is surfaced at build time.

Add unit tests in both abstract-eth and sdk-coin-eth to cover the
invalid case (priorityFee > maxFee) and the equal-value boundary.

Ticket: CGD-573
@pritam-gembali pritam-gembali force-pushed the fix/eip1559-priority-fee-validation branch from 88bfc5a to 0b1de3b Compare April 10, 2026 13:33
@pritam-gembali pritam-gembali marked this pull request as ready for review April 10, 2026 13:57
@pritam-gembali pritam-gembali requested review from a team as code owners April 10, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant