-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add fallback method for EIP-1559 maxPriorityFee #6393
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
概述代码变更步骤这些变更主要集中在以太坊(EVM)相关的两个文件中,涉及气体费用估算和EIP-1559支持检查的优化。主要目标是改进错误处理和费用估算的健壮性。 变更
详细变更ClientEvm.ts
EvmApiProvider.ts
序列图sequenceDiagram
participant Client as ClientEvm
participant Provider as EvmApiProvider
Client->>Provider: checkEIP1559Support()
Provider-->>Client: 返回EIP-1559支持状态
Client->>Provider: getGasPriceEIP1559()
alt 原生方法失败
Provider->>Provider: fallbackEstimateMaxPriorityFeePerGas()
Provider-->>Client: 返回备用气体价格
end
这些变更旨在提高以太坊交易的费用估算和错误处理能力,确保在不同网络条件下都能正常工作。 Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
packages/kit-bg/src/vaults/impls/evm/sdkEvm/ClientEvm.ts
(1 hunks)packages/kit-bg/src/vaults/impls/evm/sdkEvm/EvmApiProvider.ts
(2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/kit-bg/src/vaults/impls/evm/sdkEvm/EvmApiProvider.ts
[error] 488-488: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
🔇 Additional comments (3)
packages/kit-bg/src/vaults/impls/evm/sdkEvm/EvmApiProvider.ts (2)
416-419
: 逻辑清晰,操作安全。
代码在这里看起来简洁明了,没有发现明显问题。
423-437
: fallback 方案设计良好。
当原生方法不可用时,使用 fallback 能有效提高鲁棒性。日志信息也能帮助排查问题。
packages/kit-bg/src/vaults/impls/evm/sdkEvm/ClientEvm.ts (1)
31-34
: 逻辑简化,易读性增强。
现在只检查 baseFeePerGas 是否为 0 或 NaN,整体流程更直观清晰。
Summary by CodeRabbit
新特性
bug 修复