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

Add support for EIP-1898 #284

Merged
merged 20 commits into from
Jan 10, 2022
Merged

Add support for EIP-1898 #284

merged 20 commits into from
Jan 10, 2022

Conversation

0xpanoramix
Copy link
Contributor

@0xpanoramix 0xpanoramix commented Dec 9, 2021

Description

This PR adds support for the EIP 1898, meaning that a set of JSON-RPCs methods will now support a new query parameter : blockHash.

Here is how you can use this parameter with curl :

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x1010101010101010101010101010101010101010", {"blockHash":"0xe0ee62fd4a39a6988e24df0b406b90af71932e1b01d5561400a8eab943a33d68"}],"id":1}' localhost:8545

The implementation is backward compatible, meaning this query also works :

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x1010101010101010101010101010101010101010", "latest"],"id":1}' localhost:8545

It closes #253.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Breaking changes

The following JSON-RPC methods are affected :

  • getBalance
  • getTransactionCount
  • getCode
  • getStorageAt
  • call

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have tested this code
  • I have updated the README and other relevant documents (guides...)
  • I have added sufficient documentation both in code, as well as in the READMEs

@0xpanoramix 0xpanoramix self-assigned this Dec 9, 2021
@0xpanoramix 0xpanoramix changed the title Update JSON-RPC methods to add EIP-1898 Update JSON-RPC methods to support EIP-1898 Dec 9, 2021
@zivkovicmilos zivkovicmilos linked an issue Dec 9, 2021 that may be closed by this pull request
@0xpanoramix 0xpanoramix force-pushed the feat/add-eip-1898 branch 2 times, most recently from e9fc32e to b2f6abb Compare December 10, 2021 17:47
@0xpanoramix 0xpanoramix changed the title Update JSON-RPC methods to support EIP-1898 Add support for EIP-1898 Dec 11, 2021
@0xpanoramix 0xpanoramix marked this pull request as ready for review December 21, 2021 11:19
Copy link
Contributor

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks great 💯

Thank you for documenting the code in tricky places, helps us with maintaining it down the line 🙏

jsonrpc/codec.go Show resolved Hide resolved
jsonrpc/codec.go Outdated Show resolved Hide resolved
jsonrpc/codec.go Show resolved Hide resolved
jsonrpc/codec.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Kourin1996 Kourin1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for the fix 👍

jsonrpc/codec.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
e2e/eip_1898_test.go Outdated Show resolved Hide resolved
jsonrpc/codec.go Outdated Show resolved Hide resolved
@0xpanoramix 0xpanoramix force-pushed the feat/add-eip-1898 branch 3 times, most recently from ccef91e to 14c3e13 Compare January 6, 2022 11:41
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: PtitLuca <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: PtitLuca <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
Signed-off-by: Luca Georges Francois <luca.georges-francois@epitech.eu>
@0xpanoramix 0xpanoramix merged commit 8c076ec into develop Jan 10, 2022
@zivkovicmilos zivkovicmilos deleted the feat/add-eip-1898 branch January 14, 2022 15:02
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.

eth_call does not accept EIP-1898 'blockHash' param
5 participants