fix(rpc/trace): wrong calculate of block ommer rewards#8767
Merged
mattsse merged 3 commits intoparadigmxyz:mainfrom Jun 12, 2024
Merged
fix(rpc/trace): wrong calculate of block ommer rewards#8767mattsse merged 3 commits intoparadigmxyz:mainfrom
mattsse merged 3 commits intoparadigmxyz:mainfrom
Conversation
Signed-off-by: jsvisa <delweng@gmail.com>
emhane
pushed a commit
that referenced
this pull request
Jun 13, 2024
Signed-off-by: jsvisa <delweng@gmail.com>
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.
In the current implementation of
trace_blockrpc, we return block base reward asblockreward, and the uncle inclusion rewards asunclereward.But in OpenEthereum/Erigon's implementation, they return
block base + uncle inclusionasblockreward, and each uncle reward asunclereward, so the actual uncle rewards were missed.IMHO, we should keep the same as oe/erigon, because the results will be more inaccurate, similar to etherscan's.
Eg the reward of https://etherscan.io/block/1378035
Reth's response:
{ "jsonrpc": "2.0", "result": [ { "action": { "author": "0xea674fdde714fd979de3edf0f56aa9716b898ec8", "rewardType": "block", "value": "0x4563918244f40000" // 5ETH }, "blockHash": "0xd6940190d24aa1c2e8aa70fb2847aba6c4461679753a7546daf79e6295a9e1e2", "blockNumber": 1378035, "subtraces": 0, "traceAddress": [], "type": "reward" }, { "action": { "author": "0xea674fdde714fd979de3edf0f56aa9716b898ec8", "rewardType": "uncle", "value": "0x22b1c8c1227a000" // 0.15625ETH }, "blockHash": "0xd6940190d24aa1c2e8aa70fb2847aba6c4461679753a7546daf79e6295a9e1e2", "blockNumber": 1378035, "subtraces": 0, "traceAddress": [], "type": "reward" } ], "id": "reth" }Erigon's response
{ "jsonrpc": "2.0", "id": "erigon", "result": [ { "action": { "author": "0xea674fdde714fd979de3edf0f56aa9716b898ec8", "rewardType": "block", "value": "0x478eae0e571ba000" // 5.15625ETH }, "blockHash": "0xd6940190d24aa1c2e8aa70fb2847aba6c4461679753a7546daf79e6295a9e1e2", "blockNumber": 1378035, "result": null, "subtraces": 0, "traceAddress": [], "type": "reward" }, { "action": { "author": "0xea674fdde714fd979de3edf0f56aa9716b898ec8", "rewardType": "uncle", "value": "0x3cb71f51fc558000" // 4.375ETH }, "blockHash": "0xd6940190d24aa1c2e8aa70fb2847aba6c4461679753a7546daf79e6295a9e1e2", "blockNumber": 1378035, "result": null, "subtraces": 0, "traceAddress": [], "type": "reward" } ] }Ref https://github.com/ledgerwatch/erigon/blob/b4c9f22923cd7156cd26be91a8a83b131eb3cc73/consensus/ethash/consensus.go#L624-L668