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

Optional parameter in fee_history causes problems when omitted #3184

Closed
antazoey opened this issue Jan 4, 2024 · 3 comments
Closed

Optional parameter in fee_history causes problems when omitted #3184

antazoey opened this issue Jan 4, 2024 · 3 comments

Comments

@antazoey
Copy link
Contributor

antazoey commented Jan 4, 2024

  • Version: 6.13.0
  • Python: 3.10.13
  • OS: macos
  • pip freeze output
<put the output from running pip freeze here>

What was wrong?

We have been doing this in our code:

fee_history = self.web3.eth.fee_history(1, BlockNumber(latest_block_number))

However, it now failed with the following error:

ValueError: {'code': -32602, 'message': 'Errors encountered in param 2: Invalid value null supplied to : Array<Float number> | undefined', 'data': {'message': 'Errors encountered in param 2: Invalid value null supplied to : Array<Float number> | undefined'}}

To fix it on my end, I had to change the line to:

fee_history = self.web3.eth.fee_history(1, BlockNumber(latest_block_number), reward_percentiles=[])

How can it be fixed?

If given None , change to [] in the code implementation.


Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.

@antazoey
Copy link
Contributor Author

antazoey commented Jan 4, 2024

Ok, I am realizing this does not happen on normal geth nodes but does happen on Anvil and Hardhat.

@antazoey
Copy link
Contributor Author

antazoey commented Jan 4, 2024

maybe the fix is to actually remove the fee reward_percentiles parameter from the arguments list if it is null

@reedsa
Copy link
Contributor

reedsa commented Jan 10, 2024

Closed in #3185

@reedsa reedsa closed this as completed Jan 10, 2024
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

No branches or pull requests

2 participants