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

[Feature] Ability to prove historical account state (e.g. balance, nonce, codeHash, storageRoot) using Steel #380

Open
willemolding opened this issue Jan 9, 2025 · 1 comment · May be fixed by #414
Assignees
Labels
enhancement New feature or request steel

Comments

@willemolding
Copy link

willemolding commented Jan 9, 2025

Feature

Currently the Steel API only supports proving the result of contract calls. It also be useful to be able to prove other historical chain state, in this case the state of accounts/contracts.

Motivation

While a workaround is to deploy a contract that returns the desired values certain applications may wish to read this state directly rather than taking this approach. For example when reading values far into the past such a function may not have been deployed.

Implementation

API

It probably makes sense to follow the function name conventions of alloy providers e.g. get_balance, get_code_at, get_transaction_count on the guest side.

One idea for the host might be to add a include method to EvmEnv which accepts an enum with variants corresponding to the different account state values function calls e.g.

// Host
let mut env = EthViewCallEnv::from_rpc(&args.rpc_url, None)?;
env.include(BalanceOf(address))
env.include(CodeAt(address))
// Guest
let env = input.into_env()
env.get_balance(address)
env.get_code_at(address)

but other ideas also welcome

@willemolding willemolding added the enhancement New feature or request label Jan 9, 2025
@nategraf nategraf added the steel label Jan 13, 2025 — with Linear
@Wollac Wollac self-assigned this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request steel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants