Skip to content

Commit

Permalink
isssue
Browse files Browse the repository at this point in the history
  • Loading branch information
dndll committed Mar 28, 2024
1 parent 7b1217d commit c8da937
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
16 changes: 10 additions & 6 deletions bin/operator/src/succinct/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ pub struct Client {
impl Client {
pub async fn new(config: &config::Config) -> anyhow::Result<Self> {
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?;
Expand All @@ -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)
}
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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))]
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ where
.split("__")
.global(),
);
log::debug!("config: {figment:#?}");

figment.extract()
}
Expand Down
24 changes: 10 additions & 14 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down

0 comments on commit c8da937

Please sign in to comment.