Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Migrate batch kernel parts from miden-node #1105

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e8c8d30
fix: Set supported types correctly (#1103)
igamigo Jan 24, 2025
779b9ac
docs: missing types (#1100)
igamigo Jan 24, 2025
99fa9d5
chore: increment miden-objects version to v0.7.1 and update changelog…
bobbinth Jan 24, 2025
fb2284b
Merge branch 'main' into next
bobbinth Jan 24, 2025
6058a36
feat: Add miden-batch-prover crate
PhilippGackstatter Jan 23, 2025
2035767
feat: Add `BatchId`
PhilippGackstatter Jan 24, 2025
e7f84d8
Introduce `AccountUpdateError`
PhilippGackstatter Jan 24, 2025
e32b134
feat: Add `ProposedBatch`
PhilippGackstatter Jan 24, 2025
3a7f03f
feat: Add `LocalBatchProver`
PhilippGackstatter Jan 24, 2025
179dd65
feat: Add `ProvenBatch`
PhilippGackstatter Jan 24, 2025
2119ed1
feat: Migrate `LocalBatchProver` from node
PhilippGackstatter Jan 24, 2025
a1ac710
chore: Rename `NoteAuthenticationInfo`
PhilippGackstatter Jan 27, 2025
3414313
feat:Add batch expiration block num
PhilippGackstatter Jan 27, 2025
523bc16
chore: Use core instead of std for `Display`
PhilippGackstatter Jan 27, 2025
b0768a5
feat: Migrate `MockProvenTxBuilder`
PhilippGackstatter Jan 27, 2025
7e82a7c
feat: Test tx ordering in batches
PhilippGackstatter Jan 27, 2025
a7f1b5d
feat: Add `BatchAccountUpdate`
PhilippGackstatter Jan 27, 2025
8961ad0
chore: Extend test assertions
PhilippGackstatter Jan 28, 2025
a72e5b7
feat: Refactor and document batch output note tracker
PhilippGackstatter Jan 28, 2025
89630b0
feat: Add input/output notes commitment test
PhilippGackstatter Jan 28, 2025
ad52eb1
feat: Remove `BlockNumber::from_usize`
PhilippGackstatter Jan 28, 2025
dc57f9d
feat: Check for duplicate input notes
PhilippGackstatter Jan 28, 2025
dc38f1f
feat: Add unauthenticated/authenticated scenario tests
PhilippGackstatter Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

- [BREAKING] Incremented minimum supported Rust version to 1.84.

## 0.7.1 (2025-01-24) - `miden-objects` crate only

### Fixes

- Added missing doc comments (#1100).
- Fixed setting of supporting types when instantiating `AccountComponent` from templates (#1103).


## 0.7.0 (2025-01-22)

### Highlights
Expand Down
40 changes: 34 additions & 6 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "2"
members = [
"bin/bench-tx",
"bin/proving-service",
"crates/miden-batch-prover",
"crates/miden-lib",
"crates/miden-objects",
"crates/miden-proving-service-client",
Expand Down
41 changes: 41 additions & 0 deletions crates/miden-batch-prover/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[package]
name = "miden-batch-prover"
version = "0.8.0"
description = "Miden rollup batch executor and prover"
readme = "README.md"
categories = ["no-std"]
keywords = ["miden", "batch", "prover"]
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true

[[test]]
name = "miden-batch-prover"
path = "tests/integration/main.rs"

[lib]
bench = false

[features]
default = ["std"]
std = ["assembly/std", "miden-objects/std", "miden-crypto/std", "miden-verifier/std", "vm-core/std", "vm-processor/std"]
testing = ["dep:rand", "dep:miden-lib", "dep:winterfell", "dep:anyhow"]

[dependencies]
anyhow = { version = "1.0", default-features = false, optional = true }
assembly = { workspace = true }
miden-crypto = { workspace = true }
miden-lib = { workspace = true, optional = true, features = ["testing"]}
miden-objects = { workspace = true }
miden-verifier = { workspace = true }
rand = { workspace = true, optional = true, features = ["small_rng"]}
thiserror = { workspace = true }
vm-core = { workspace = true }
vm-processor = { workspace = true }
winterfell = { version = "0.11", optional = true }

[dev-dependencies]
anyhow = { version = "1.0", features = ["std", "backtrace"] }
7 changes: 7 additions & 0 deletions crates/miden-batch-prover/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Miden Batch Prover

This crate contains tools for executing and proving Miden rollup transaction batches.

## License

This project is [MIT licensed](../LICENSE).
43 changes: 43 additions & 0 deletions crates/miden-batch-prover/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use miden_objects::{
account::AccountId,
block::BlockNumber,
note::{NoteId, Nullifier},
transaction::TransactionId,
BatchAccountUpdateError,
};
use thiserror::Error;
use vm_processor::Digest;

/// Error encountered while building a batch.
#[derive(Debug, Error)]
pub enum BatchError {
#[error("transaction {second_transaction_id} consumes the note with nullifier {note_nullifier} that is also consumed by another transaction {first_transaction_id} in the batch")]
DuplicateInputNote {
note_nullifier: Nullifier,
first_transaction_id: TransactionId,
second_transaction_id: TransactionId,
},

#[error("transaction {second_transaction_id} creates the note with id {note_id} that is also created by another transaction {first_transaction_id} in the batch")]
DuplicateOutputNote {
note_id: NoteId,
first_transaction_id: TransactionId,
second_transaction_id: TransactionId,
},

#[error("note hashes mismatch for note {id}: (input: {input_hash}, output: {output_hash})")]
NoteHashesMismatch {
id: NoteId,
input_hash: Digest,
output_hash: Digest,
},

#[error("failed to merge transaction delta into account {account_id}")]
AccountUpdateError {
account_id: AccountId,
source: BatchAccountUpdateError,
},

#[error("unauthenticated input note with id {note_id} for which an inclusion proof was provided was not created in block {block_num}")]
UnauthenticatedNoteAuthenticationFailed { note_id: NoteId, block_num: BlockNumber },
}
22 changes: 22 additions & 0 deletions crates/miden-batch-prover/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![no_std]

#[macro_use]
extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

mod proven_batch;
pub use proven_batch::ProvenBatch;

mod proposed_batch;
pub use proposed_batch::ProposedBatch;

mod error;
pub use error::BatchError;

mod local_batch_prover;
pub use local_batch_prover::LocalBatchProver;

#[cfg(any(feature = "testing", test))]
pub mod testing;
Loading