All notable changes to this project will be documented in this file.
- Add
try_call()
method toCallBuilder
when explicit error handling is necessary. - Make
BeaconInput
,BlockInput
andStateDb
public. - Implement custom
Debug
formatter forCommitment
. - Implement
Deref
forRlpHeader
.
- Return specific error, when no
Contract::preflight
was called. - Use
decode_exact
when RLP-decoding the MPT leaves.
- Introduce the
ComposeInput
as a generalized type to represent different commitments. TheBeaconInput
is now aComposeInput
. This changes the binary input data, but does not require any code changes.
0.13.0 - 2024-09-10
- Add support for creating a commitment to a beacon block root using
EvmEnv::into_beacon_input
, which can be verified using the EIP-4788 beacon roots contract. - Add the
EvmEnvBuilder
to simplify the creation of anEvmEnv
on the host. - If an individual
eth_getProof
RPC call contains many storage keys, it will be automatically split. The chunk size can be configured using theEvmEnvBuilder
. - Add
CallBuilder::prefetch_access_list
andCallBuilder::call_with_prefetch
for that host that prefetch storage proofs and values to drastically reduce the number of RPC calls.
EvmInput
has been changed to anenum
to support different input types for the guest, such as the newBeaconInput
. This changes the binary input data, but does not require any code changes.SolCommitment
has been renamed toCommitment
.
0.12.0 - 2024-08-09
- Replace
ethers
dependency completely withalloy
. - Make
host
functionsasync
. - Add support to build
EvmEnv
from anyalloy
provider. - Add more efficient RLP-based serialization for the header.
- Store the commitment inside the
EvmEnv
. - Use
eth_getTransactionCount
andeth_getBalance
instead ofeth_getProof
to query basic account information. - Switch tests from pre-recorded RPC responses to
Anvil
.
EthEvmEnv::from_rpc
now accepts aUrl
instead of a&str
for the HTTP RPC endpoint.EvmEnv::from_provider
now requires analloy
provider, and the block number parameter has been changed to aBlockNumberOrTag
.EvmEnv::sol_commitment
has been replaced withEvmEnv::commitment
(to get a reference), orEvmEnv::into_commitment
(to consume and return the commitment).ETH_SEPOLIA_CHAIN_SPEC
andETH_MAINNET_CHAIN_SPEC
have been moved to theethereum
module.CachedProvider
has been removed completely. As alternatives, you can:- Use
anvil --fork-url https://ethereum-rpc.publicnode.com@20475759
to create a cached fork for block20475759
. - Cache the RPC responses on an HTTP level using Tower or a caching forward proxy.
- Use
- The host functions are now
async
instead of blocking:
// Create an EVM environment from an RPC endpoint and a block number or tag.
let mut env = EthEvmEnv::from_rpc(args.rpc_url, BlockNumberOrTag::Latest).await?;
// The `with_chain_spec` method is used to specify the chain configuration.
env = env.with_chain_spec(Ð_SEPOLIA_CHAIN_SPEC);
// Preflight the call to prepare the input that is required to execute the function in
// the guest without RPC access. It also returns the result of the call.
let mut contract = Contract::preflight(CONTRACT, &mut env);
let returns = contract.call_builder(&CALL).from(CALLER).call().await?;
// Finally, construct the input from the environment.
let input = env.into_input().await?;