diff --git a/.dockerignore b/.dockerignore index 4a6e0c1..dbecba5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,9 @@ -**target/ -**direnv/ -**vendor/ +target/ +.direnv/ +vendor/ +nearx/contract/out/ +nearx/build/ +state.db/ +wrapped/ +build/ +.git/ diff --git a/bin/operator/src/succinct/mod.rs b/bin/operator/src/succinct/mod.rs index 486a44b..d5d615e 100644 --- a/bin/operator/src/succinct/mod.rs +++ b/bin/operator/src/succinct/mod.rs @@ -98,7 +98,14 @@ pub struct Client { impl Client { pub async fn new(config: &config::Config) -> anyhow::Result { info!("starting succinct client"); + info!("rpc: {}", config.succinct.rpc_url); + info!("contract address: {}", config.succinct.contract_address); + info!("eth rpc: {}", config.succinct.eth_rpc_url); + ensure!( + config.succinct.contract_address != Address::ZERO, + "invalid contract address", + ); let (contract, chain_id) = Self::init_contract_client(&config.succinct).await?; let inner = Self::init_inner_client(&config.succinct).await?; @@ -122,10 +129,7 @@ impl Client { verify_amt: bps_from_network(&config.rpc.network), }; s.releases = s.fetch_releases(&chain_id).await?; - ensure!( - s.config.contract_address != Address::ZERO, - "invalid contract address", - ); + ensure!(!s.releases.is_empty(), "no releases found"); Ok(s) } @@ -180,7 +184,7 @@ impl Client { chain_id, &self.config.version, )) - .inspect(|r| trace!("releases: {:?}", r)) + .inspect(|r| debug!("releases: {:?}", r)) } fn extract_release_details( @@ -266,7 +270,7 @@ impl Client { .error_for_status()? .json() .await - .inspect(|d| debug!("fetched deployments: {:?}", d))?) + .inspect(|d| trace!("fetched deployments: {:?}", d))?) } #[tracing::instrument(skip(self))] diff --git a/crates/primitives/src/config.rs b/crates/primitives/src/config.rs index 238b4af..0a76d5a 100644 --- a/crates/primitives/src/config.rs +++ b/crates/primitives/src/config.rs @@ -54,6 +54,7 @@ where .split("__") .global(), ); + log::debug!("config: {figment:#?}"); figment.extract() } diff --git a/justfile b/justfile index 66b090a..18e1fb3 100644 --- a/justfile +++ b/justfile @@ -78,21 +78,17 @@ init: (fetch-deployments "/tmp/deployments.json") call-brunoc REQUEST: {{brunoc}} "api/succinct/deploy/{{REQUEST}}.bru" --env testnet -o /tmp/{{REQUEST}}.json -# Deploy a succinct circuit -succinct-deploy $ENTRYPOINT $VERSION: - {{brunoc}} "Succinct/Deploy/new-deployment.bru" --env testnet -o /tmp/deploy.json - check $CHECK_RELEASE_NUM: {{brunoc}} "api/succinct/deploy/check.bru" --env testnet -o /tmp/check.json wait-for-success RELEASE_NUM: #!/usr/bin/env bash - for ((count=0; count<20; count++)); do + for ((count=0; count<10; count++)); do just check {{RELEASE_NUM}} if [ $? -ne 0 ]; then echo "non zero exit code: $?, trying in 30s" - sleep 30s + sleep 60s else echo "success" break @@ -121,20 +117,20 @@ update-current-name ENTRYPOINT: get-verifier OUTPUT: cat {{OUTPUT}} | jq -r '.bytecode' -release-dev ENTRYPOINT VERSION: +release-dev $ENTRYPOINT $VERSION: #!/usr/bin/env bash set -euxo pipefail - # just update-current-name {{ENTRYPOINT}} - # just call-brunoc "new-deployment" + {{brunoc}} "api/succinct/deploy/new-deployment.bru" --env testnet -o /tmp/new-deployment.json + # RELEASE_ID=`just extract-release-id` RELEASE_NUM=`just extract-release-num` - # just wait-for-success $RELEASE_NUM - # - # just update-current-name $ENTRYPOINT - # cat /tmp/check.json | jq -r ".results[0].response.data" > /tmp/{{ENTRYPOINT}}-release.json - # just update-name $RELEASE_ID + just wait-for-success $RELEASE_NUM + + just update-current-name $ENTRYPOINT + cat /tmp/check.json | jq -r ".results[0].response.data" > /tmp/{{ENTRYPOINT}}-release.json + just update-name $RELEASE_ID $VERSION export CREATE2_SALT=`cast th "$RANDOM$RANDOM$RANDOM$RANDOM" | cast to-uint256| cast tb` export FUNCTION_VERIFIER=`just get-verifier /tmp/{{ENTRYPOINT}}-release.json`