risc0 / risc0-ethereum

Integration of the RISC Zero verifiable compute platform with Ethereum and EVM chains.
https://risczero.com
Apache License 2.0
102 stars 23 forks source link

Fix deprecation in `erc20-counter` #293

Closed Wollac closed 1 day ago

Wollac commented 1 month ago

The erc20-counter example currently dynamically creates either a block or a beacon commitment depending on its command line arguments. This uses the deprecated into_beacon_input:

// Finally, construct the input from the environment.
let evm_input = if let Some(beacon_api_url) = args.beacon_api_url {
    #[allow(deprecated)]
    env.into_beacon_input(beacon_api_url).await?
} else {
    env.into_input().await?
};

Instead, the intended behaviour in steel v1.1 is to use builder.beacon_api(url). However, as we are using a typed builder pattern, the following will not work as the type of the builder changes:

if let Some(beacon_api_url) = args.beacon_api_url { {
    builder = builder.beacon_api(beacon_api_url);
}
linear[bot] commented 1 month ago

WEB3-174 Fix deprecation in `erc20-counter`

mahmudsudo commented 1 month ago

can i take on this issue ?

nategraf commented 1 month ago

@mahmudsudo, sure! This is a good first issue

nategraf commented 1 day ago

@Wollac, did you address this? I no longer see the deprecated call in the example (although the commit above it says "there are two options", and it's unclear what's that's referring to exactly) https://github.com/risc0/risc0-ethereum/blob/main/examples/erc20-counter/apps/src/bin/publisher.rs#L143-L146

If this is fixed, go ahead and close this issue

Wollac commented 1 day ago

@nategraf good call, this was fixed as a byproduct in https://github.com/risc0/risc0-ethereum/pull/316