You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, a minimum reproduction of the code, in an isolated binary, indeed passes with the same dependencies and flags. Something is wrong with the alloy decoder in cargo stylus that works fine in isolation.
// Copyright 2023-2024, Offchain Labs, Inc.// For licensing, see https://github.com/OffchainLabs/cargo-stylus/blob/stylus/licenses/COPYRIGHT.mduse alloy_primitives::{address,Address};use alloy_provider::{Provider,ProviderBuilder};use alloy_sol_macro::sol;use eyre::{bail,Result};sol!{
#[sol(rpc)]
interface ArbWasmCache{
function allCacheManagers() external view returns (address[] managers);}}pubconstCONTRACT_ADDR:Address = address!("0000000000000000000000000000000000000072");#[tokio::main]pubasyncfnmain() -> Result<()>{let endpoint = "http://localhost:8547";let provider = ProviderBuilder::new().with_recommended_fillers().on_builtin(&endpoint).await?;let manager_addr = get_cache_manager_address(provider).await?;println!("Addr: {:?}", manager_addr);Ok(())}asyncfnget_cache_manager_address<P>(provider:P) -> Result<Address>whereP:Provider + Clone + Send + Sync,{let arb_wasm_cache = ArbWasmCache::new(CONTRACT_ADDR, provider.clone());let result = arb_wasm_cache.allCacheManagers().call().await?;if result.managers.is_empty(){bail!("no cache managers found in ArbWasmCache, perhaps the Stylus cache is not yet enabled on this chain");}Ok(*result.managers.last().unwrap())}
The text was updated successfully, but these errors were encountered:
The command deploys the bytecode directly, so I'm not entirely sure what the contract looks like. Maybe this version of the cache manager doesn't contain the method cargo-stylus is looking for?
When running
cargo stylus cache status --address=$ADDR --endpoint=http://localhost:8547
on the Nitro devnode, we get an alloy decoding failure:This was debugged and determined to happen in the cache.rs file when attempting to fetch all the cache manager addresses:
However, a minimum reproduction of the code, in an isolated binary, indeed passes with the same dependencies and flags. Something is wrong with the alloy decoder in cargo stylus that works fine in isolation.
The text was updated successfully, but these errors were encountered: