Skip to content
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

enhance GetBlockByNumber by supporting 'safe' and 'finalized', following Geth #70

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

NathanBSC
Copy link

Description

enhance GetBlockByNumber by supporting 'safe' and 'finalized', following Geth

Rationale

  1. follow up with Geth, to improve user experience, 'finalized' and 'safe' meaning, refer to
    https://www.alchemy.com/overviews/ethereum-commitment-levels
  2. transplant code from Geth,
    and the binding position is CurrentFinalBlock() and CurrentSafeBlock()
  3. remove GetFinalizedHeader and GetJustifiedNumberAndHash in ethapi list

Example

have been tested
curl -X POST "http://127.0.0.1:8545" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true],"id":1}'
image

curl -X POST "http://127.0.0.1:8545" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["safe", true],"id":1}'
image

curl -X POST "http://127.0.0.1:8545" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["finalized", true],"id":1}'
image

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

@NathanBSC NathanBSC requested review from NashBC and pythonberg1997 and removed request for NashBC March 29, 2023 04:33
@NathanBSC NathanBSC force-pushed the GetBlockByNumber_finalized_safe branch from 4117814 to 5b863e4 Compare March 29, 2023 08:52
@NathanBSC NathanBSC merged commit 10b7d98 into fast_finality Mar 29, 2023
@NathanBSC NathanBSC deleted the GetBlockByNumber_finalized_safe branch March 30, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant