Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Add support for EIP-234 and EIP-1898 #230

Closed
GCdePaula opened this issue Mar 16, 2021 · 1 comment
Closed

Add support for EIP-234 and EIP-1898 #230

GCdePaula opened this issue Mar 16, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@GCdePaula
Copy link
Contributor

EIP-234: Add blockHash to JSON-RPC filter options.
EIP-1898: Add blockHash to JSON-RPC methods which accept a default block parameter.

These two EIPs are closely related, and allow for querying the blockchain's state at a specified block hash. I've a draft implementation of these two ready and tested :)

There are two issues I'd like some guidance on, though.

The first is that, the way I was approaching it,EIP-1898 requires changing the signatures of a reasonable amount of methods of the trait etheres_providers::Middleware. Specifically, changing the types of Option<BlockNumber> to Option<BlockId>. Is this reasonable? I've also tried changing the type to something like Option<T> where T: Into<BlockId>. However, this has the downside that every time we pass a None, we have to type annotate the calls. Thoughts?

The second relates to testing. Ganache does not implement EIP-1898 (trufflesuite/ganache#745). It can be tested with geth, however, which is what I did.

How should I proceed? Should I open a PR?

Cheers!

@gakonst
Copy link
Owner

gakonst commented Mar 16, 2021

I personally find the None<()> annotation to be super ugly, so I'd more supportive of this first approach. This would be a breaking change (and that's fine since we're pre-1.0), and would be easily fixable by passing BlockNumber::Latest.into() (or similar) wherever the API is consumed

Testing the feature with geth SGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants