fix(trace): populate base_fee_per_gas in trace_debankBlock output - #12
Merged
Conversation
Both DebankBlock and DebankBlockHeader hardcoded base_fee_per_gas to None. Source it from the RichBlock already fetched via EthApi (rpc_block.inner.base_fee_per_gas) so the field is correctly returned for post-EIP1559 blocks.
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.
问题
trace_debankBlock的输出中,DebankBlock.base_fee_per_gas和DebankBlockHeader.base_fee_per_gas两个字段都被硬编码为None(带TODO注释),导致 RPC 始终不返回区块的 base fee。原注释认为只能通过 Runtime API 获取,但其实数据已经在手边:实现里已经通过 EthApi 取得了
rpc_block(frontier 的RichBlock),其inner.base_fee_per_gas: Option<U256>正是所需的值。改动
client/rpc/trace/src/lib.rs两处:DebankBlock.base_fee_per_gasDebankBlockHeader.base_fee_per_gaspost-EIP1559 区块返回实际 base fee,之前的区块返回
None。测试
cargo check -p moonbeam-rpc-trace通过(exit 0)。Label
B5-clientnoteworthy(仅客户端 RPC 输出修复,不涉及运行时)