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

feat(eth_call): fix serializion to include default block to latest #1959

Conversation

0xfourzerofour
Copy link
Contributor

@0xfourzerofour 0xfourzerofour commented Jan 28, 2025

Motivation

In an eth_call the block parameter is always required. In the current serialization logic, it does not add a block if the state_overrides is None and the block is None.

This results in a node returning an invalid parameter error.

Solution

I have updated the code to always set the block as the second argument, if it is None it will use the default latest value. The third argument will only be added if state_overrides is Some.

PR Checklist

  • [y] Added Tests
  • [y] Added Documentation
  • [n] Breaking changes

@DaniPopes
Copy link
Member

DaniPopes commented Jan 29, 2025

the block parameter is not required as per the RPC spec, so it's on the node to accept a missing block parameter
we don't serialize it as some nodes also don't support it at all

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this param is optional,
I think we don't need to set it and leave this up to the node to pick the default

@0xfourzerofour
Copy link
Contributor Author

damn, no worries I shall fix on my client side

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.

3 participants