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: Add hash chained input #170

Closed
wants to merge 4 commits into from
Closed

feat: Add hash chained input #170

wants to merge 4 commits into from

Conversation

Wollac
Copy link
Contributor

@Wollac Wollac commented Jul 4, 2024

Previously, EvmEnv::block_commitment() returned the commitment with respect to the block holding the EVM state. This is not very flexible.
To improve this, the PR adds the EvmChainInput that in addition to the EVM input also contains a chain of block headers to move this commitment to a later point.

// Create a view call environment from an RPC endpoint and a block number in the past.
let mut env = EthViewCallEnv::from_rpc(&args.rpc_url, Some(old_block_number))?;

// Preflight the call to construct the input with respect to a more recent block.
let mut contract = Contract::preflight(CONTRACT, &mut env);
let returns = contract.call_builder(&CALL).from(CALLER).call()?;
let input = env.into_chain_input(newer_block_number)?;

@Wollac Wollac closed this Sep 9, 2024
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.

1 participant