-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for eth_getAccount #9625
Comments
graph TD
A[Get Account]
B[codeHash]
C[storageRoot]
D[balance]
E[nonce]
A --> B
A --> C
A --> D
A --> E
As was done here, this can be a starting point to address this the second question of this issue. |
@rkrasiuk I assume getting the storageroot at any block number isn't that easy, same issue as eth_getProof? |
@mattsse actually it's much easier since you only need to load storage changes for a given account. so, as long as all touched storage can fit in memory, we would be good |
could you please add some pointers on where to start, I see we have an AccountReader trait |
we would need to expose the interface in let address = ();
let hashed_address = keccack256(address);
let hashed_storage = HashedStorage::from_revert_range(address, &tx, block_range)?;
let hahed_storage_sorted = hashed_storage.into_sorted();
let root = StorageRoot::new_hashed(
&tx,
HashedPostStateStorageCursor::new(
DatabaseHashedStorageCursor::new(
tx.cursor_dup_read::<tables::HashedStorages>()?,
hashed_address,
),
Some(&hashed_storage_sorted)
),
hashed_address,
).root()? |
@rkrasiuk, in the part of |
@mvares you can just retrieve account information from |
Wouldn't it be better to use the |
hey @mvares are you still working on this? otherwise I'm down to give it a go |
@greged93 go for it |
This should be fixed by #10369 |
Describe the feature
ref https://www.quicknode.com/docs/ethereum/eth_getAccount
TODO
reth/crates/rpc/rpc-eth-api/src/core.rs
Lines 55 to 58 in 390f30a
reth/crates/rpc/rpc-eth-api/src/core.rs
Lines 372 to 376 in 390f30a
the latter likely needs more work, so this can be two prs where the first just introduces the trait function and when figure out how to get the account's storage root cc @rkrasiuk
Additional context
No response
The text was updated successfully, but these errors were encountered: