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

improve & refactor evm_rpc methods for reuse #41

Merged
merged 10 commits into from
Oct 11, 2023
Merged

Conversation

pirtleshell
Copy link
Member

I've implemented a sharding setup that routes requests for latest blocks (and other calls that can be made with no historical data) to a configurable pruning cluster.

In order to make that code more easily reviewable (and give me more time to write documentation 😄), I've pulled out all the changes I made to the decode package.

changes

  • block tag changes
    • adds "finalized" and "safe" block tags
    • adds tracking for when null is passed as a block number. this is undefined behavior in the spec, but is regularly interpreted by clients to mean "latest". instead of erroring because it can't convert nil to a string, the block number parsing now encodes it to a special value so we can track requests made with no value in the block number param position in metrics
  • adds new category of JSON-RPC methods: NoHistoryMethods
    • these methods require no historical state and thus can always be safely routed to pruning clusters
    • the categorization exists in this PR, but remains unused until i incorporate the sharding proxy changes
  • refactors and makes public various pieces used to extract the block number from the params of supported requests
  • increases overall test coverage of block number extraction

@pirtleshell pirtleshell merged commit 13a027b into main Oct 11, 2023
4 checks passed
@pirtleshell pirtleshell deleted the rp-refactor-decode branch October 11, 2023 19:40
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.

2 participants