bluealloy/revm

Implement manual deserialize for AccountInfo

Open

#2.564 geöffnet am 1. Juni 2025

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Rust (1.019 Forks)user submission
good first issue

Repository-Metriken

Stars
 (2.194 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 14h) (32 gemergte PRs in 30 T)

Beschreibung

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct AccountInfo {

matches the non standard eth_getAccountInfo endpoint response:

https://github.com/alloy-rs/alloy/blob/c04ef82f3a63c97cb3332a78b3c18dca47966ad3/crates/rpc-types-eth/src/account.rs#L9-L21

this means for an rpc db this could be replaced with single rpc call if the node supports that endpoint and directly deserialize into revm AccountInfo if deserialize is manually impl so that the codehash is computed during deserde

   let (nonce, balance, code) = tokio::join!(nonce, balance, code,);

TODO

  • add manual deserde that in addition to the current format also supports the eth_getAccountInfo response

Contributor Guide