Skip to content

Commit

Permalink
fix: function id was not registered in the contract
Browse files Browse the repository at this point in the history
add a sanity check to ensure we actually know about this release
  • Loading branch information
dndll committed Apr 3, 2024
1 parent 6b765a3 commit 0a6e72d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 9 additions & 5 deletions bin/operator/src/succinct/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,21 @@ impl Client {
self.config.contract_address.0 != [0u8; 20],
"no contract address"
);
let function_id = circuit.function_id(&self.contract).await?;
debug!("requesting relayed proof for {:?}", function_id);
ensure!(
self.releases
.iter()
.any(|d| d.function_id == hex::encode(function_id)),
"function_id not found in active releases"
);
let request_id = self
.ext
.submit_request(
circuit.deployment(&self.releases).chain_id,
self.config.contract_address.0 .0.into(),
circuit.with_selector(&req.input).into(),
circuit
.function_id(&self.contract)
.await
.inspect(|d| debug!("function_id: {:?}", d))?
.into(),
function_id.into(),
req.input.into(),
)
.await
Expand Down
6 changes: 5 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
vscode-extensions.vadimcn.vscode-lldb.adapter
rust-analyzer

(google-cloud-sdk.withExtraComponents ([pkgs.google-cloud-sdk.components.cloud-run-proxy]))
(google-cloud-sdk.withExtraComponents ([
pkgs.google-cloud-sdk.components.cloud-run-proxy
pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin
]))
kubectl

];
buildInputs = with pkgs; [
Expand Down

0 comments on commit 0a6e72d

Please sign in to comment.