Skip to content

Commit

Permalink
Tests are failing
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Jan 23, 2024
1 parent 410754f commit 7725c09
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 8 deletions.
20 changes: 12 additions & 8 deletions block-producer/src/state_view/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::BTreeSet, fmt::write, sync::Arc};
use std::{collections::BTreeSet, sync::Arc};

use async_trait::async_trait;
use miden_objects::{
Expand Down Expand Up @@ -52,15 +52,19 @@ where
&self,
candidate_tx: SharedProvenTx,
) -> Result<(), VerifyTxError> {
// Verifiy transaction proof
let tx_verifier = Verifier::new(10);
let _ = tx_verifier.verify(candidate_tx.as_ref().clone()).map_err(|_| {
// 1. Verifiy transaction proof
//
// This check makes sure that the transaction proof that has been attached to the transaction
// is valid
let tx_verifier = Verifier::new(0);
let _ = tx_verifier.verify(candidate_tx.as_ref().clone()).map_err(|e| {
println!("Error: {e}");
VerifyTxError::TransactionInputError(
TransactionInputError::AccountSeedNotProvidedForNewAccount,
)
});
})?;

// 1. soft-check if `tx` violates in-flight requirements.
// 2. soft-check if `tx` violates in-flight requirements.
//
// This is a "soft" check, because we'll need to redo it at the end. We do this soft check
// to quickly reject clearly infracting transactions before hitting the store (slow).
Expand All @@ -70,11 +74,11 @@ where
&*self.nullifiers_in_flight.read().await,
)?;

// 2. Fetch the transaction inputs from the store, and check tx input constraints
// 3. Fetch the transaction inputs from the store, and check tx input constraints
let tx_inputs = self.store.get_tx_inputs(candidate_tx.clone()).await?;
ensure_tx_inputs_constraints(candidate_tx.clone(), tx_inputs)?;

// 3. Re-check in-flight transaction constraints, and if verification passes, register
// 4. Re-check in-flight transaction constraints, and if verification passes, register
// transaction
//
// Note: We need to re-check these constraints because we dropped the locks since we last
Expand Down
72 changes: 72 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

running 2 tests
test commands::start::tests::test_node_config ... ok
Genesis input file: genesis.dat has successfully been loaded.
Creating basic wallet account...Creating fungible faucet account...
Accounts have successfully been created at: /accounts/
Miden node genesis successful: genesis.dat has been created
test commands::genesis::tests::test_make_genesis ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.63s


running 30 tests
test block_builder::prover::tests::test_block_witness_validation_inconsistent_account_ids ... ok
test block_builder::prover::tests::test_block_witness_validation_inconsistent_account_hashes ... ok
test batch_builder::tests::test_build_block_called_when_no_batches ... ok
test batch_builder::tests::test_batches_added_back_to_queue_on_block_build_failure ... ok
test block_builder::prover::tests::test_compute_chain_mmr_root_empty_mmr ... ok
test block_builder::prover::tests::test_compute_chain_mmr_root_mmr_1_peak ... ok
test block_builder::prover::tests::test_compute_note_root_empty_batches_success ... ok
test block_builder::prover::tests::test_compute_note_root_empty_notes_success ... ok
test config::tests::test_block_producer_config ... ok
test batch_builder::tests::test_block_size_doesnt_exceed_limit ... ok
test block_builder::prover::tests::test_compute_account_root_empty_batches ... ok
test block_builder::tests::test_apply_block_called_empty_batches ... ok
test block_builder::tests::test_build_block_failure ... ok
test block_builder::tests::test_apply_block_called_nonempty_batches ... ok
test block_builder::prover::tests::test_compute_note_root_success ... ok
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::apply_block::test_apply_block_ab1 ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_happy_path ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_vt1 ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::apply_block::test_apply_block_ab2 ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test txqueue::tests::test_build_batch_failure ... ok
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test txqueue::tests::test_build_batch_success ... ok
test state_view::tests::apply_block::test_apply_block_ab3 ... FAILED
test txqueue::tests::test_tx_verify_failure ... ok
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_vt2 ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_vt3 ... FAILED
test block_builder::prover::tests::test_compute_account_root_success ... ok
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_vt4 ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_vt5 ... FAILED
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
Error: TransactionVerificationFailed(VerifierError(UnacceptableProofOptions))
test state_view::tests::verify_tx::test_verify_tx_happy_path_concurrent ... FAILED
test block_builder::prover::tests::test_compute_chain_mmr_root_mmr_17_peaks ... ok

failures:

failures:
state_view::tests::apply_block::test_apply_block_ab1
state_view::tests::apply_block::test_apply_block_ab2
state_view::tests::apply_block::test_apply_block_ab3
state_view::tests::verify_tx::test_verify_tx_happy_path
state_view::tests::verify_tx::test_verify_tx_happy_path_concurrent
state_view::tests::verify_tx::test_verify_tx_vt1
state_view::tests::verify_tx::test_verify_tx_vt2
state_view::tests::verify_tx::test_verify_tx_vt3
state_view::tests::verify_tx::test_verify_tx_vt4
state_view::tests::verify_tx::test_verify_tx_vt5

test result: FAILED. 20 passed; 10 failed; 0 ignored; 0 measured; 0 filtered out; finished in 16.53s

0 comments on commit 7725c09

Please sign in to comment.