diff --git a/packages/core/src/internal/execution/jsonrpc-client.ts b/packages/core/src/internal/execution/jsonrpc-client.ts index db597bc6c..8b4b08636 100644 --- a/packages/core/src/internal/execution/jsonrpc-client.ts +++ b/packages/core/src/internal/execution/jsonrpc-client.ts @@ -638,11 +638,14 @@ export class EIP1193JsonRpcClient implements JsonRpcClient { ]); // We prioritize EIP-1559 fees over legacy gasPrice fees, however, - // polygon (chainId 137) requires legacy gasPrice fees so we skip EIP-1559 logic in that case + // polygon (chainId 137) requires legacy gasPrice fees + // so we skip EIP-1559 logic in that case if (latestBlock.baseFeePerGas !== undefined && chainId !== 137) { + // Support zero gas fee chains, such as a private instances + // of blockchains using Besu. We explicitly exclude BNB + // Smartchain (chainId 56) from this logic as it is EIP-1559 + // compliant but only sets a maxPriorityFeePerGas. if (latestBlock.baseFeePerGas === 0n && chainId !== 56) { - // Support zero gas fee chains, such as a private instances - // of blockchains using Besu. return { maxFeePerGas: 0n, maxPriorityFeePerGas: 0n, diff --git a/packages/core/test-integrations/new-api/internal/new-execution/jsonrpc-client.ts b/packages/core/test-integrations/new-api/internal/new-execution/jsonrpc-client.ts index 28d2f80bc..147ebcdd2 100644 --- a/packages/core/test-integrations/new-api/internal/new-execution/jsonrpc-client.ts +++ b/packages/core/test-integrations/new-api/internal/new-execution/jsonrpc-client.ts @@ -210,13 +210,13 @@ describe("JSON-RPC client", function () { const fees = await bnbClient.getNetworkFees(); - assert.notDeepEqual( + assert.deepStrictEqual( fees, { - maxFeePerGas: 0n, - maxPriorityFeePerGas: 0n, + maxFeePerGas: 1_000_000_000n, + maxPriorityFeePerGas: 1_000_000_000n, }, - "Fees should not be zero due to the specific handling for BNB Chain." + "Both max fee and max priority fee should be 1 gwei, as the base fee is 0 for BNB Chain" ); });