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(provider): eth_getAccount support #760

Merged
merged 4 commits into from
May 25, 2024
Merged

feat(provider): eth_getAccount support #760

merged 4 commits into from
May 25, 2024

Conversation

Evalir
Copy link
Contributor

@Evalir Evalir commented May 20, 2024

Motivation

See https://t.me/ethers_rs/37923.

Solution

Implement eth_getAccount.

Haven't added a test, as Anvil doesn't implement the method—needs an anvil companion PR

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@@ -41,6 +41,20 @@ pub struct EIP1186AccountProofResponse {
pub storage_proof: Vec<EIP1186StorageProof>,
}

/// Response for `eth_getAccount`
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Copy link
Member

Choose a reason for hiding this comment

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

do we have an Account struct in alloy-consensus? if not i would prefer to push this down and ensure it has RLP encoding

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.

one note here, the eth api proposal for this was closed because this no longer makes sense post verkle, but rpc providers currently support this, so reasonable to add

crates/provider/src/provider/trait.rs Outdated Show resolved Hide resolved
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.

lgtm

@mattsse mattsse marked this pull request as ready for review May 25, 2024 08:03
Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

still needs struct pushed down

@mattsse
Copy link
Member

mattsse commented May 25, 2024

yeah, I realized we don't have eip1186 types in the eips crate yet, so I think we should move them separately.

@prestwich
Copy link
Member

the account struct should be in consensus, as it's an member of the state trie, no?

@mattsse
Copy link
Member

mattsse commented May 25, 2024

where do you want me to put this, consensus/account.rs ?

@prestwich
Copy link
Member

that'd be great. I can get to it in a couple hours if you don't. if you want to merge this before adding the RLP impl, please open an issue to follow up 🫡

@mattsse
Copy link
Member

mattsse commented May 25, 2024

this would introduce alloy-consensus dep in provider, not sure if we want this

@prestwich
Copy link
Member

don't we already have that indirectly via receipts and txenvelopes?

@mattsse
Copy link
Member

mattsse commented May 25, 2024

ah we indeed have this already

@mattsse mattsse merged commit ec3f990 into main May 25, 2024
24 checks passed
@mattsse mattsse deleted the evalir/eth-accounts branch May 25, 2024 09:04
ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 2024
* feat: eth_getAccount on provider

* chore: use rpc with block

* move account to consensus

---------

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
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