This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
eth_getRawBlockByNumber for RPC API (part 1, issue 9057) #10552
Closed
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.
Hello
This PR contains (some) changes requested by issue #9057. The issue also requested a
eth_submitRawBlock
implementation. This feature has not been written yet -> I will follow up with that in a separate PR.(The original request specified the parity_ prefix instead of eth_. I assume that was an error and eth_ is correct here?)
Changes
eth_getRawBlockByNumber
API for both the full and light client. This endpoint returns the raw block in RLP form, no extras included (non-Rich). The return value is tested on the official Ethereum test cases in BlockchainTests/bcGasPricerTest/RPC_API_Test (the json file contains a "rlp" field).rich_block
method onEthClient
in both the full and light client has been split intoencoded_block
andrich_block
(rich_block
callingencoded_block
from within).Todo
eth_submitRawBlock
will follow up in a separate RP.include_txs: bool
parameter, it currently does not do anything (transactions are included, the default). Therpc::v1::types::Block
type can easily exclude transactions, theethcore::types::encoded::Block
type however is a little more complex as it only contains the raw bytes. I could useBlockView
to find the transactions and cut those out from the final form. I will do that, soon (unless someone can recommend a different way of doing this?). Should this parameter be removed for now?Open questions
eth_getBlockByHash
, i.e.eth_getRawBlockByHash
?