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(ethersdb): basic_ref return none instead of panic #935

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

0xkr8os
Copy link
Contributor

@0xkr8os 0xkr8os commented Dec 28, 2023

Instead of panicking whenever there's an error fetching the account data, return None. This behavior is similar to the EmptyDB and helpful in unit tests when using the mock provider. The tradeoff here is that any RPC client connection issues can surface as EVM execution revert errors but these can be easily mitigated earlier on in the middleware setup process. If the client connection is established, the behavior is essentially the same for callers.

@rakita
Copy link
Member

rakita commented Dec 29, 2023

Silently failing is maybe even worse, as you would just get the wrong result and people wouldn't know if it is revm or connection.

The solution would be to propagate the error and set Database::Error correctly

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

lgtm

@rakita rakita merged commit eff379d into bluealloy:main Dec 29, 2023
22 checks passed
@github-actions github-actions bot mentioned this pull request Jan 12, 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

Successfully merging this pull request may close these issues.

None yet

2 participants