Skip to content

Commit

Permalink
chore: Upgrade to latest tasm-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Sword-Smith committed Apr 30, 2024
1 parent 9a79732 commit d46dfcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
7 changes: 4 additions & 3 deletions Cargo.lock

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

10 changes: 1 addition & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tarpc = { version = "^0.34", features = [
"serde-transport-json",
"tcp",
] }
tasm-lib = "0.2"
tasm-lib = { git = "https://github.com/TritonVM/tasm-lib.git", rev = "694f27daf78aade0ed0dc07e3babaab036cd5572" }
tiny-bip39 = "1.0"
tokio = { version = "1.37", features = ["full", "tracing"] }
tokio-serde = { version = "0.8", features = ["bincode", "json"] }
Expand Down Expand Up @@ -119,11 +119,3 @@ harness = false
[[bench]]
name = "archival_mmr"
harness = false


[patch.crates-io]
# aa759b66efa9b5ea77e96d73bf27ed1edfbcfc3f is tip of branch: master as of 2024-04-24
tasm-lib = { git = "https://github.com/TritonVM/tasm-lib.git", rev = "aa759b66efa9b5ea77e96d73bf27ed1edfbcfc3f" }

# 0d2cb98c0495d30e53d28e82a35de44dc655c3ea = tip of branch: master, on 2024-04-24
twenty-first = { git = "https://github.com/Neptune-Crypto/twenty-first.git", rev = "0d2cb98c0495d30e53d28e82a35de44dc655c3ea" }
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use tasm_lib::list::set_length::SetLength;
use tasm_lib::snippet_bencher::BenchmarkCase;
use tasm_lib::traits::basic_snippet::BasicSnippet;
use tasm_lib::traits::function::{Function, FunctionInitialState};
use tasm_lib::{rust_shadowing_helper_functions, ExecutionState};
use tasm_lib::{rust_shadowing_helper_functions, InitVmState};
use triton_vm::{prelude::BFieldElement, triton_asm};
use twenty_first::math::bfield_codec::BFieldCodec;
use twenty_first::{
Expand All @@ -35,9 +35,7 @@ impl TransactionKernelMastHash {
pub(crate) fn input_state_with_kernel_in_memory(
address: BFieldElement,
transaction_kernel_encoded: &[BFieldElement],
) -> ExecutionState {
use triton_vm::prelude::NonDeterminism;

) -> InitVmState {
assert!(address.value() > 1);
// populate memory
let mut memory: HashMap<BFieldElement, BFieldElement> = HashMap::new();
Expand All @@ -51,11 +49,7 @@ impl TransactionKernelMastHash {

let mut stack = tasm_lib::empty_stack();
stack.push(address);
ExecutionState {
stack,
std_in: vec![],
nondeterminism: NonDeterminism::default().with_ram(memory),
}
InitVmState::with_stack_and_memory(stack, memory)
}
}

Expand Down Expand Up @@ -457,7 +451,7 @@ mod tests {
let mut output_with_known_digest = test_rust_equivalence_given_complete_state(
&ShadowedFunction::new(TransactionKernelMastHash),
&execution_state.stack,
&execution_state.std_in,
&execution_state.public_input,
&nondeterminism,
&Some(Tip5::new(Domain::FixedLength)),
None,
Expand Down

0 comments on commit d46dfcb

Please sign in to comment.