-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
eth_getblockbynumber supports finalized except latest, pending and blocknumber #5953
Comments
Sounds great. This title is a bit confusing to me, I understand what you are going to do after reading the content. Will you implement it on the existing interface by adding new parameters? Or if you are adding a new interface, can you describe it like this: Add a new JSON-RPC API |
@tomatoishealthy I think it doesn't add a new JSON-RPC API but eth_getBlockByNumber support new String parameter
These are 3 kinds:
|
@zhangwenhua-tron Is other jsonrpc api should also support |
I think make eth_getBlockByNumber support About other api, maybe we can support it later. |
@zhangwenhua-tron Why not use the httpSolidityPort? eth_getBlockByNumber("latest") in solidity may return the finalized block number.
|
@zhangwenhua-tron Would it be convenient to introduce this issue at the next Core Devs Community Call 22? |
@317787106 Beside, for the developer from the ETH or BSC, they maybe have no idea what is the difference between wallet and walletsolidity. So support for eth_getBlockByNumber(“finalized”) is necessary for better compatibility with EVM jsonrpc. |
@zhangwenhua-tron I think supporting |
@abn2357 |
@zhangwenhua-tron In the referenced doc, finalized block means latest finalized block, the additional information 'latest' can't be obtained through 'finalized' . I still think it is not a good api(name). |
For EVM, For What we talking about, is not the name, it is the compatibility with Besides, if you have better idea about the api(name), you can submit issue for |
Hi, I have made a PR as #6007 |
@waynercheung Any other methods handled EARLIEST_STR, PENDING_STR, LATEST_STR should also handle |
OK |
Hi @317787106 , I have updated the codes and you can review it now. Thanks |
Background
I need to get the latest solidified/finalized block number through jsonrpc, but this method doesn't support yet.
Rationale
Why should this feature exist?
For many developers, they need to get the latest solidified/finalized block number, then fetch other data by this number.
What are the use-cases?
For example, I want to fetch the specific events by eth_getLogs, I should get the latest solidified/finalized block number, then using the eth_getLogs to fetch the logs.
Specification
The api
eth_getBlockByNumber
,eth_getBlockTransactionCountByNumber
andeth_getLogs
will support the parameterfinalized
, treating it the same as thesolid
block in java-tron.The other jsonrpc api will not support this parameter, just returns message as
TAG [earliest | pending | finalized] not supported
.Test Specification
Scope Of Impact
Implementation
Do you have ideas regarding the implementation of this feature?
Yes.
Actually, we can get the current solidified block number by
chainBaseManager.getDynamicPropertiesStore().getLatestSolidifiedBlockNum();
.Are you willing to implement this feature?
Yes
The text was updated successfully, but these errors were encountered: