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)?;
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 theEvmChainInput
that in addition to the EVM input also contains a chain of block headers to move this commitment to a later point.