Skip to content

Commit

Permalink
Merge pull request #34 from anton-rs/cl/public-streams
Browse files Browse the repository at this point in the history
✨ Make streams public
  • Loading branch information
clabby authored Feb 13, 2024
2 parents 629aa46 + 4ea83a8 commit 5ab846a
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 370 deletions.
788 changes: 436 additions & 352 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ authors = ["clabby"]

[workspace.dependencies]
# types
alloy-primitives = "0.4.2"
alloy-primitives = "0.6.2"

# ser
serde = { version = "1.0.192", features = ["derive"] }
serde_json = "1.0.108"
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"

# runtime
tokio = { version = "1.34.0", features = ["full"] }
tokio = { version = "1.36.0", features = ["full"] }

# misc
anyhow = "1.0.75"
anyhow = "1.0.79"

[profile.release]
opt-level = 3
Expand Down
2 changes: 1 addition & 1 deletion crates/cannon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ command-fds = "0.2.3"
tracing = { version = "0.1.40", optional = true }

[dev-dependencies]
proptest = "1.2.0"
proptest = "1.4.0"

[features]
tracing = ["dep:tracing"]
8 changes: 4 additions & 4 deletions crates/mipsevm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ anyhow.workspace = true
preimage-oracle = { path = "../preimage" }

# types
alloy-sol-types = "0.4.2"
alloy-sol-types = "0.6.2"

# misc
once_cell = "1.18.0"
elf = "0.7.3"
once_cell = "1.19.0"
elf = "0.7.4"
revm = { version = "3.5.0", features = ["no_gas_measuring"] }
tracing = { version = "0.1.40", optional = true }

Expand All @@ -34,7 +34,7 @@ keccak256-aarch64-simd = { git = "https://github.com/clabby/keccak256-aarch64",
rand = "0.8.5"
criterion = { version = "0.5.1", features = ["html_reports"] }
pprof = { version = "0.13.0", features = ["criterion", "flamegraph", "frame-pointer"] }
proptest = "1.2.0"
proptest = "1.4.0"

[features]
tracing = ["dep:tracing"]
Expand Down
10 changes: 10 additions & 0 deletions crates/mipsevm/src/mips/instrumented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ where

Ok(witness)
}

/// Returns the stdout buffer.
pub fn std_out(&self) -> &[u8] {
self.std_out.buffer()
}

/// Returns the stderr buffer.
pub fn std_err(&self) -> &[u8] {
self.std_err.buffer()
}
}

#[cfg(test)]
Expand Down
4 changes: 2 additions & 2 deletions crates/mipsevm/src/test_utils/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
//! that has the MIPS & PreimageOracle smart contracts deployed at deterministic addresses.
use crate::{StateWitness, StateWitnessHasher, StepWitness};
use alloy_primitives::{hex, Address, U256};
use anyhow::Result;
use revm::{
db::{CacheDB, EmptyDB},
primitives::{
AccountInfo, Bytecode, Bytes, CreateScheme, Output, ResultAndState, TransactTo, TxEnv, B256,
hex, AccountInfo, Address, Bytecode, Bytes, CreateScheme, Output, ResultAndState,
TransactTo, TxEnv, B256, U256,
},
Database, EVM,
};
Expand Down
8 changes: 3 additions & 5 deletions crates/mipsevm/src/witness.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//! This module contains the various witness types.
use crate::{utils::keccak256, State, StateWitness, StateWitnessHasher};
use alloy_primitives::{Bytes, B256, U256};
use alloy_primitives::{B256, U256};
use alloy_sol_types::{sol, SolCall};
use preimage_oracle::KeyType;
use revm::primitives::Bytes;

/// The size of an encoded [StateWitness] in bytes.
pub const STATE_WITNESS_SIZE: usize = 226;
Expand Down Expand Up @@ -70,10 +71,7 @@ impl StepWitness {
/// - `Some(input)` if the [StepWitness] has a preimage request.
/// - `None` if the [StepWitness] does not have a preimage request.
pub fn encode_preimage_oracle_input(&self) -> Option<Bytes> {
let Some(preimage_key) = self.preimage_key else {
crate::error!(target: "mipsevm::step_witness", "Cannot encode preimage oracle input without preimage key");
return None;
};
let preimage_key = self.preimage_key?;

match KeyType::from(preimage_key[0]) {
KeyType::_Illegal => {
Expand Down
2 changes: 1 addition & 1 deletion crates/preimage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ anyhow.workspace = true
tokio.workspace = true

# misc
os_pipe = "1.1.4"
os_pipe = "1.1.5"
tracing = { version = "0.1.40", optional = true }

[dev-dependencies]
Expand Down

0 comments on commit 5ab846a

Please sign in to comment.