-
Notifications
You must be signed in to change notification settings - Fork 0
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
Nethermind as rbuilder state provider #1
Comments
@asdacap, can you please look into the following (by look into, I mean either let me know RPC methods if they already exist or implement new ones) 1. bytecode_by_hashI'm not sure what the RPC call is for this one (or if NM supports it), here is how I implemented it (following Ferran's PR), but I don't think this is the correct implementation: fn bytecode_by_hash(&self, code_hash: B256) -> ProviderResult<Option<Bytecode>> {
let address = Address::from_word(code_hash);
let block_id = BlockId::hash(self.hash);
let res = futures::executor::block_on(async {
self.provider.get_code_at(address).block_id(block_id).await
})
.unwrap();
Ok(Some(Bytecode::new_raw(res)))
} This doesn't look correct because the
2. calculate_state_rootWe'll need an RPC call to calculate the state root (if one doesn't already exist) on the NM side. The
If I'm not mistaken, this should be enough to calculate state_root. I |
So for 1, I think it probably mean that you'll need to get the account for the address first, which contains the codehash. |
Yeah, but the issue is that the |
Ow, thats fine. I thought it only pass in Address as some kind of optimization. We can get code by hash directly. |
Goal
Nethermind client should work as a state provider for
rbuilder.
Firstly, the state will be provided via IPC RPC, and then we'll optimize (e.g., Rust <> C# FFI).
TODOs
SatateProviderFactory
traitsStateProvider
traitsHeaderProvider
traitsHere is the list of the Traits we'll have to implement:
Column Already supported by NM? indicates that the:
If the args or return data needs to be adapted from/to NM-specific types, I propose adapters to be implemented on the
rbuilder
side where possible since this is specific torbuilder
and not the NM client.StateProviderFactory
StateProvider
HeaderProvider
The text was updated successfully, but these errors were encountered: