Conversation
|
/run-security-scan |
alexcos20
left a comment
There was a problem hiding this comment.
AI automated code review (Gemini 3).
Overall risk: medium
Summary:
This pull request refactors the getGasOptions method in src/utils/blockchain.ts to improve clarity and standardize gas fee calculations. The changes consolidate the logic for applying a gasFeeMultiplier and introduce a minFee variable for Polygon/Mumbai and Sapphire networks. However, it removes the explicit minimum gas fee handling for Sepolia, which needs clarification.
Comments:
• [WARNING][bug] The MIN_GAS_FEE_SEPOLIA constant has been commented out, and its corresponding usage for SEPOLIA_NETWORK_ID has been removed from the getGasOptions logic. This means transactions on Sepolia will no longer have a enforced minimum maxPriorityFeePerGas or maxFeePerGas.
Could you please clarify the reasoning behind removing Sepolia's specific gas fee handling? Is Sepolia no longer a target network, or is there a new strategy for managing gas fees on this network? Without a minimum, transactions might get stuck or fail more often on Sepolia during periods of network congestion.
• [INFO][style] The return type hint for getGasOptions was previously Promise<{}> and is now implicitly Promise<any>. While the refactored code clearly returns an object with gasLimit, maxPriorityFeePerGas, and maxFeePerGas (or gasLimit and gasPrice), it would be beneficial for type safety to define a more specific return type interface (e.g., Promise<{ gasLimit: bigint; maxPriorityFeePerGas?: bigint; maxFeePerGas?: bigint; gasPrice?: bigint; }>).
• [INFO][performance] The minFee is now set to 0n for any chain that is not Polygon/Mumbai or in KNOWN_CONFIDENTIAL_EVMS. While this might be the desired behavior to allow networks to dictate their own minimums or use dynamic fee market rates, it's a significant change from previously hardcoded minimums for specific testnets like Sepolia.
Confirming that setting minFee = 0n for all other chains (where we previously had specific values for Sepolia) is the intended behavior and does not lead to unexpected transaction failures on other supported networks would be good.

Fixes # .
Changes proposed in this PR: