-
Notifications
You must be signed in to change notification settings - Fork 11
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: GetAccountMode #23
Conversation
/// Marker identifying whether the RPC provider supports `eth_getAccount` | ||
get_account_mode: OnceLock<GetAccountMode>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this have to be a oncelock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to set it once on the first request, and we don't need to make get_account_req
&mut self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're also setting the value inside Box::pin async fut
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to test this a bit because I think especially on reth this request is more expensive than doing multiple ones because of the storage root
Actually we shouldn't do this because this endpoint can be significantly more expensive due to the storage root which isn't trivial to compute by certain clients |
Motivation
Closes #9
Solution
Introduces
Above enum is cached in the
BackendHandler
inside aOnceLock
as it only needs to set exactly once i.e on the first request when we try to determine whether the provider supportseth_getAccount
or not.PR Checklist