fix(abstract-eth): validate maxPriorityFeePerGas <= maxFeePerGas (CGD-573)#8459
Open
pritam-gembali wants to merge 1 commit intomasterfrom
Open
fix(abstract-eth): validate maxPriorityFeePerGas <= maxFeePerGas (CGD-573)#8459pritam-gembali wants to merge 1 commit intomasterfrom
pritam-gembali wants to merge 1 commit intomasterfrom
Conversation
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
88bfc5a to
0b1de3b
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.
Summary
transactionBuilder.tsfee()setter: throwsBuildTransactionErrorwhenmaxPriorityFeePerGas > maxFeePerGastestEip1559PriorityFeeExceedsMaxFeehelper inabstract-ethtest utilitiessdk-coin-ethcovering both the invalid case and the equal-value boundaryContext
EIP-1559 transactions with
maxPriorityFeePerGas > maxFeePerGasare 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 passingyarn run unit-test --scope @bitgo/sdk-coin-eth— 142 passing (9 pre-existing failures due to missingBITGOJS_TEST_PASSWORD, unrelated to this change)mocha --grep maxPriorityFeePerGas→ 1 passingTicket: CGD-573
🤖 Generated with Claude Code