This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
961696d
commit c6a6bc1
Showing
15 changed files
with
164 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Check risc0 compatibility | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/risc0-check.yml | ||
- ci/risc0-check/** | ||
- '**/Cargo.toml' | ||
push: | ||
branches: main | ||
paths: | ||
- .github/workflows/risc0-check.yml | ||
- ci/risc0-check/** | ||
- '**/Cargo.toml' | ||
|
||
env: | ||
CARGO_PROFILE_DEV_DEBUG: 1 | ||
CARGO_PROFILE_RELEASE_DEBUG: 1 | ||
CARGO_NET_RETRY: 10 | ||
RUSTUP_MAX_RETRIES: 10 | ||
RISC0_DEV_MODE: 1 | ||
|
||
jobs: | ||
risc0-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Install cargo-risc0 | ||
run: cargo install cargo-risczero | ||
- name: Install risc0-zkvm toolchain | ||
run: cargo risczero install | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check risc0 compatibility | ||
run: make check-risc0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ on: | |
paths: | ||
- .github/workflows/rust.yml | ||
- Cargo.toml | ||
- clients/** | ||
- modules/** | ||
- mocks/** | ||
push: | ||
branches: main | ||
paths: | ||
- .github/workflows/rust.yml | ||
- Cargo.toml | ||
- clients/** | ||
- modules/** | ||
- mocks/** | ||
|
||
|
@@ -35,50 +37,50 @@ jobs: | |
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly # Since fmt uses unstable features for organizing imports | ||
components: rustfmt | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
doc_all_features: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SOVEREIGN_DEPLOY_KEY }} | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: arduino/setup-protoc@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: doc | ||
args: --all-features --no-deps --release | ||
|
||
clippy_all_features: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SOVEREIGN_DEPLOY_KEY }} | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: arduino/setup-protoc@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -90,14 +92,14 @@ jobs: | |
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SOVEREIGN_DEPLOY_KEY }} | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: arduino/setup-protoc@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -110,13 +112,13 @@ jobs: | |
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SOVEREIGN_DEPLOY_KEY }} | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: arduino/setup-protoc@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
/target | ||
target/ | ||
/contracts | ||
|
||
.idea/ | ||
target-path | ||
|
||
.DS_Store | ||
**/.DS_Store | ||
|
||
demo_data/ | ||
/.vscode/* | ||
|
||
/ci/**/*.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": [ | ||
"./ci/risc0-check/methods/guest/Cargo.toml", | ||
"./ci/risc0-check/host/Cargo.toml" | ||
], | ||
"cSpell.words": [ | ||
"jsonrpsee", | ||
"Rollup" | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["host", "methods"] | ||
|
||
# Always optimize; building and running the guest takes much longer without optimization. | ||
[profile.dev] | ||
opt-level = 3 | ||
|
||
[profile.dev.build-override] | ||
opt-level = 3 | ||
|
||
[profile.release] | ||
debug = 1 | ||
lto = true | ||
|
||
[profile.release.build-override] | ||
opt-level = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "host-sov-ibc" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
methods = { path = "../methods" } | ||
risc0-zkvm = { version = "0.20.1" } | ||
tracing-subscriber = { version = "0.3", features = ["env-filter"] } | ||
serde = "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use methods::{GUEST_SOV_IBC_ELF, GUEST_SOV_IBC_ID}; | ||
use risc0_zkvm::{default_prover, ExecutorEnv}; | ||
|
||
fn main() { | ||
// An example input | ||
let input: u32 = 15 * u32::pow(2, 27) + 1; | ||
let env = ExecutorEnv::builder() | ||
.write(&input) | ||
.unwrap() | ||
.build() | ||
.unwrap(); | ||
|
||
// Obtain the default prover. | ||
let prover = default_prover(); | ||
|
||
// Produce a receipt by proving the specified ELF binary. | ||
let receipt = prover.prove(env, GUEST_SOV_IBC_ELF).unwrap(); | ||
|
||
// An example retrieval of the output from the receipt journal. | ||
let _output: u32 = receipt.journal.decode().unwrap(); | ||
|
||
receipt.verify(GUEST_SOV_IBC_ID).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "methods" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[build-dependencies] | ||
risc0-build = { version = "0.20.1" } | ||
|
||
[package.metadata.risc0] | ||
methods = ["guest"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
risc0_build::embed_methods(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "guest-sov-ibc" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[workspace] | ||
|
||
[dependencies] | ||
sov-ibc = { path = "../../../../modules/sov-ibc" } | ||
sov-ibc-transfer = { path = "../../../../modules/sov-ibc-transfer" } | ||
sov-celestia-client = { path = "../../../../clients/sov-celestia" } | ||
risc0-zkvm = { version = "0.20.1", default-features = false, features = ["std"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![no_main] | ||
#![no_std] // std support is experimental | ||
|
||
use risc0_zkvm::guest::env; | ||
risc0_zkvm::guest::entry!(main); | ||
|
||
fn main() { | ||
// read the input | ||
let input: u32 = env::read(); | ||
|
||
// write public output to the journal | ||
env::commit(&input); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include!(concat!(env!("OUT_DIR"), "/methods.rs")); |