diff --git a/.github/workflows/gas_benchmark.yaml b/.github/workflows/gas_benchmark.yaml index 27c772e..b1a2fa3 100644 --- a/.github/workflows/gas_benchmark.yaml +++ b/.github/workflows/gas_benchmark.yaml @@ -6,25 +6,26 @@ jobs: gas: name: Calculate gas costs in local juno runs-on: ubuntu-latest + env: + ADMIN_ADDR: juno10j9gpw9t4jsz47qgnkvl5n3zlm2fz72k67rxsg defaults: run: working-directory: ./ci-gas-benchmark - container: - image: ghcr.io/cosmoscontracts/juno:v6.0.0 - env: - PASSWORD: xxxxxxxxx - STAKE_TOKEN: ujunox - GAS_LIMIT: -1 - UNSAFE_CORS: true steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Install deps - run: apk --no-cache add rustup cargo - - - name: Setup Juno Node - run: cd /opt && /opt/setup_and_run.sh juno10j9gpw9t4jsz47qgnkvl5n3zlm2fz72k67rxsg > /dev/null 2>&1 & + - name: Run Local Juno Node + run: | + docker run --rm -d --name juno \ + -e PASSWORD=xxxxxxxxx \ + -e STAKE_TOKEN=ujunox \ + -e GAS_LIMIT=100000000 \ + -e UNSAFE_CORS=true \ + -p 1317:1317 \ + -p 26656:26656 \ + -p 26657:26657 \ + ghcr.io/cosmoscontracts/juno:v9.0.0 /opt/setup_and_run.sh $ADMIN_ADDR - name: Calculate gas costs run: RUST_LOG=DEBUG cargo run diff --git a/ci-gas-benchmark/Cargo.toml b/ci-gas-benchmark/Cargo.toml index 55ab06d..e32ceb6 100644 --- a/ci-gas-benchmark/Cargo.toml +++ b/ci-gas-benchmark/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -cosm-orc = { version = "0.5.5" } +cosm-orc = { version = "1.1.0" } anyhow = { version = "1.0.51"} cw20-base = "0.13" cw20 = "0.13" diff --git a/ci-gas-benchmark/choad.png b/ci-gas-benchmark/choad.png deleted file mode 100644 index 9d31dc7..0000000 Binary files a/ci-gas-benchmark/choad.png and /dev/null differ diff --git a/ci-gas-benchmark/config.yaml b/ci-gas-benchmark/config.yaml index 8dc7b01..f6b2ccc 100644 --- a/ci-gas-benchmark/config.yaml +++ b/ci-gas-benchmark/config.yaml @@ -1,7 +1,9 @@ chain_cfg: binary: "junod" denom: "ujunox" + prefix: "juno" chain_id: "testing" rpc_endpoint: "http://localhost:26657/" + gas_prices: 0.1 + gas_adjustment: 1.5 -key_name: "validator" diff --git a/ci-gas-benchmark/src/main.rs b/ci-gas-benchmark/src/main.rs index dd39153..b5a74c0 100644 --- a/ci-gas-benchmark/src/main.rs +++ b/ci-gas-benchmark/src/main.rs @@ -1,6 +1,9 @@ use anyhow::Result; use cosm_orc::{ - config::cfg::Config, + config::{ + cfg::Config, + key::{Key, SigningKey}, + }, orchestrator::cosm_orc::{CosmOrc, WasmMsg}, profilers::gas_profiler::GasProfiler, }; @@ -11,11 +14,15 @@ use std::fs; fn main() -> Result<()> { env_logger::init(); - let gas_report_out = "./gas_report.json"; let mut cosm_orc = - CosmOrc::new(Config::from_yaml("config.yaml")?).add_profiler(Box::new(GasProfiler::new())); + CosmOrc::new(Config::from_yaml("config.yaml")?)?.add_profiler(Box::new(GasProfiler::new())); - cosm_orc.store_contracts("./artifacts")?; + let key = SigningKey { + name: "validator".to_string(), + key: Key::Mnemonic("siren window salt bullet cream letter huge satoshi fade shiver permit offer happy immense wage fitness goose usual aim hammer clap about super trend".to_string()), + }; + + cosm_orc.store_contracts("./artifacts", &key)?; let msgs: Vec> = vec![ WasmMsg::InstantiateMsg(InstantiateMsg { @@ -29,12 +36,12 @@ fn main() -> Result<()> { WasmMsg::QueryMsg(QueryMsg::TokenInfo {}), ]; - cosm_orc.process_msgs("cw20_base".to_string(), &msgs)?; + cosm_orc.process_msgs("cw20_base", "ex_tok_info", &msgs, &key)?; - let reports = cosm_orc.profiler_reports()?; + let reports = cosm_orc.profiler_reports().unwrap(); let j: Value = serde_json::from_slice(&reports[0].json_data)?; - fs::write(gas_report_out, j.to_string())?; + fs::write("./gas_report.json", j.to_string())?; Ok(()) }