Skip to content

Commit

Permalink
Re-export postcard in runtime (#280)
Browse files Browse the repository at this point in the history
* re-export postcard in runtime

* bump version

* unfreeze version

* add postcard usage to guest example

* disable postcard default features

* fmt

* fix
  • Loading branch information
evan-schott authored Aug 22, 2024
1 parent 4864895 commit 2e3fba3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cli/src/command/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@ fn setup_crate(host_path: PathBuf, rev: Option<String>, tag: Option<String>) ->
)?;

// add postcard because it is used for (de)serializing from/to the input/output tapes
// Hardcode postcard version to 1.0.8
cargo(
Some(&guest_path),
[
"add",
"postcard@=1.0.8",
"postcard@1.0.10",
"-F",
"alloc",
"--no-default-features",
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/input_output.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#![cfg_attr(target_arch = "riscv32", no_std, no_main)]

use nexus_rt::{println, read_private_input, write_output};
use nexus_rt::{postcard, println, read_private_input, write_output};

#[nexus_rt::main]
fn main() {
let input = read_private_input::<(u32, u32)>();
let input: Result<(u32, u32), postcard::Error> = read_private_input::<(u32, u32)>();

let mut z: i32 = -1;
if let Ok((x, y)) = input {
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = { workspace = true }

[dependencies]
nexus-rt-macros = { path = "macros", version = "0.1.0" }
postcard = { version = "=1.0.8", features = ["alloc"] }
postcard = { version = "1.0.10", features = ["alloc"], default_features = false }
serde = { version = "1.0", default-features = false }

[lib]
Expand Down
1 change: 1 addition & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ pub use nexus_rt_macros::{main, profile};

mod ecalls;
pub use ecalls::*;
pub use postcard;
2 changes: 1 addition & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ serde.workspace = true

nexus-core = { path = "../core", features = ["prover_nova", "prover_jolt", "prover_hypernova"] }
nexus-macro = { path = "../macro" }
postcard = { version = "=1.0.8", features = ["alloc"] }
postcard = { version = "1.0.10", features = ["alloc"], default_features = false }
uuid = { version = "1.9.1", features = ["v4", "fast-rng"] }
thiserror = "1.0.61"

Expand Down

0 comments on commit 2e3fba3

Please sign in to comment.