Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix: specify risczero version
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Mar 9, 2024
1 parent 50c094c commit 81d5c5b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/risc0-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:
git config --global --replace-all "url.https://${{ secrets.AUTH_TOKEN }}@github.com.insteadOf" ssh://[email protected]
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-risc0
run: cargo install cargo-risczero
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain
run: cargo risczero install
run: cargo risczero install --version v2024-02-08.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Risc0 compatibility
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ serde_json = "1.0"
schemars = { version = "0.8.12", features = ["derive"] }
tempfile = "3.5"
thiserror = "1.0.38"
tracing = { version = "0.1.40", default-features = false }

# ibc depedenencies
ibc-core = { git = "https://github.com/cosmos/ibc-rs.git", rev = "4463366e65", default-features = false, features = ["borsh","schema","serde"] }
Expand Down
1 change: 1 addition & 0 deletions modules/sov-ibc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ sha2 = { version = "0.10.8", default-features = false }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
thiserror = { workspace = true }
tracing = { workspace = true }

# internal dependencies
sov-ibc-transfer = { path = "../sov-ibc-transfer" }
Expand Down
23 changes: 18 additions & 5 deletions modules/sov-ibc/src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use ibc_core::primitives::proto::Any;
use sov_ibc_transfer::context::IbcTransferContext;
use sov_modules_api::{CallResponse, Context, DaSpec, Spec, WorkingSet};
use thiserror::Error;
use tracing::info;

use crate::context::IbcContext;
use crate::router::IbcRouter;
Expand Down Expand Up @@ -40,6 +41,16 @@ impl<S: Spec, Da: DaSpec> Ibc<S, Da> {
context: Context<S>,
working_set: &mut WorkingSet<S>,
) -> Result<CallResponse> {
let msg_envelope = MsgEnvelope::try_from(msg).map_err(|e| {
anyhow::anyhow!("Failed to convert Any to MsgEnvelope: {}", e.to_string())
})?;

info!(
"Processing IBC core message: {:?} at visible slot number {:?}",
msg_envelope,
context.visible_slot_number()
);

let shared_working_set = Rc::new(RefCell::new(working_set));

let mut execution_context = IbcContext {
Expand All @@ -48,11 +59,7 @@ impl<S: Spec, Da: DaSpec> Ibc<S, Da> {
working_set: shared_working_set.clone(),
};

let mut router = IbcRouter::new(self, context, shared_working_set);

let msg_envelope = MsgEnvelope::try_from(msg).map_err(|e| {
anyhow::anyhow!("Failed to convert Any to MsgEnvelope: {}", e.to_string())
})?;
let mut router = IbcRouter::new(self, context.clone(), shared_working_set);

match dispatch(&mut execution_context, &mut router, msg_envelope) {
Ok(_) => Ok(CallResponse::default()),
Expand All @@ -66,6 +73,12 @@ impl<S: Spec, Da: DaSpec> Ibc<S, Da> {
context: Context<S>,
working_set: &mut WorkingSet<S>,
) -> Result<CallResponse> {
info!(
"Processing IBC transfer message: {:?} at visible slot number {:?}",
msg_transfer,
context.visible_slot_number()
);

let shared_working_set = Rc::new(RefCell::new(working_set));

let mut ibc_ctx = IbcContext {
Expand Down

0 comments on commit 81d5c5b

Please sign in to comment.