Skip to content

Commit

Permalink
Merge branch 'santiagopittella-use-remote-batch-prover' into santiago…
Browse files Browse the repository at this point in the history
…pittella-use-remote-block-prover
  • Loading branch information
SantiagoPittella committed Feb 25, 2025
2 parents 2d25220 + c0e0b04 commit baf3f44
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 24 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: machete
uses: bnjbvr/cargo-machete@main
- name: Install cargo-machete
uses: clechasseur/rs-cargo@v2
with:
command: install
args: [email protected]
- name: Machete
uses: clechasseur/rs-cargo@v2
with:
command: machete

proto:
name: proto check
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ version = "0.8.0"
assert_matches = { version = "1.5" }
itertools = { version = "0.14" }
miden-air = { version = "0.12" }
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "santiagopittella-clonable-batch-provers" }
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next" }
miden-node-block-producer = { path = "crates/block-producer", version = "0.8" }
miden-node-proto = { path = "crates/proto", version = "0.8" }
miden-node-rpc = { path = "crates/rpc", version = "0.8" }
miden-node-store = { path = "crates/store", version = "0.8" }
miden-node-test-macro = { path = "crates/test-macro" }
miden-node-utils = { path = "crates/utils", version = "0.8" }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "santiagopittella-clonable-batch-provers" }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next" }
miden-processor = { version = "0.12" }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "santiagopittella-clonable-batch-provers" }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next" }
prost = { version = "0.13" }
rand = { version = "0.8" }
thiserror = { version = "2.0", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions crates/block-producer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ tracing-forest = ["miden-node-utils/tracing-forest"]
async-trait = { version = "0.1" }
futures = { version = "0.3" }
itertools = { workspace = true }
miden-block-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "santiagopittella-clonable-batch-provers" }
miden-block-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
miden-lib = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-utils = { workspace = true }
miden-objects = { workspace = true }
miden-processor = { workspace = true }
miden-proving-service-client = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "santiagopittella-clonable-batch-provers", features = [
miden-proving-service-client = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next", features = [
"batch-prover",
"block-prover",
] }
miden-tx = { workspace = true }
miden-tx-batch-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "santiagopittella-clonable-batch-provers" }
miden-tx-batch-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
rand = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
thiserror = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/block-producer/src/test_utils/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub(crate) fn flatten_output_notes<'a>(
) -> impl Iterator<Item = (BlockNoteIndex, &'a OutputNote)> {
batches.enumerate().flat_map(|(batch_idx, batch)| {
batch.iter().map(move |(note_idx_in_batch, note)| {
(BlockNoteIndex::new(batch_idx, *note_idx_in_batch), note)
(BlockNoteIndex::new(batch_idx, *note_idx_in_batch).unwrap(), note)
})
})
}
Expand Down
3 changes: 2 additions & 1 deletion crates/store/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ impl NoteRecord {
let note_idx_in_batch = row.get(2)?;
// SAFETY: We can assume the batch and note indices stored in the DB are valid so this
// should never panic.
let note_index = BlockNoteIndex::new(batch_idx, note_idx_in_batch);
let note_index = BlockNoteIndex::new(batch_idx, note_idx_in_batch)
.expect("batch and note index from DB should be valid");
let note_id = row.get_ref(3)?.as_blob()?;
let note_id = RpoDigest::read_from_bytes(note_id)?;
let note_type = row.get::<_, u8>(4)?.try_into()?;
Expand Down
7 changes: 5 additions & 2 deletions crates/store/src/db/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ pub fn select_notes_since_block_by_tag_and_sender(
let note_idx_in_batch = row.get(2)?;
// SAFETY: We can assume the batch and note indices stored in the DB are valid so this
// should never panic.
let note_index = BlockNoteIndex::new(batch_idx, note_idx_in_batch);
let note_index = BlockNoteIndex::new(batch_idx, note_idx_in_batch)
.expect("batch and note index from DB should be valid");
let note_id = read_from_blob_column(row, 3)?;
let note_type = row.get::<_, u8>(4)?;
let sender = read_from_blob_column(row, 5)?;
Expand Down Expand Up @@ -881,7 +882,9 @@ pub fn select_note_inclusion_proofs(
let note_index = row.get(3)?;
// SAFETY: We can assume the batch and note indices stored in the DB are valid so this
// should never panic.
let node_index_in_block = BlockNoteIndex::new(batch_index, note_index).leaf_index_value();
let node_index_in_block = BlockNoteIndex::new(batch_index, note_index)
.expect("batch and note index from DB should be valid")
.leaf_index_value();

let merkle_path_data = row.get_ref(4)?.as_blob()?;
let merkle_path = MerklePath::read_from_bytes(merkle_path_data)?;
Expand Down
12 changes: 6 additions & 6 deletions crates/store/src/db/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn sql_select_notes() {
for i in 0..10 {
let note = NoteRecord {
block_num,
note_index: BlockNoteIndex::new(0, i as usize),
note_index: BlockNoteIndex::new(0, i as usize).unwrap(),
note_id: num_to_rpo_digest(u64::from(i)),
metadata: NoteMetadata::new(
ACCOUNT_ID_OFF_CHAIN_SENDER.try_into().unwrap(),
Expand Down Expand Up @@ -220,7 +220,7 @@ fn sql_select_notes_different_execution_hints() {

let note_none = NoteRecord {
block_num,
note_index: BlockNoteIndex::new(0, 0),
note_index: BlockNoteIndex::new(0, 0).unwrap(),
note_id: num_to_rpo_digest(0),
metadata: NoteMetadata::new(
ACCOUNT_ID_OFF_CHAIN_SENDER.try_into().unwrap(),
Expand All @@ -244,7 +244,7 @@ fn sql_select_notes_different_execution_hints() {

let note_always = NoteRecord {
block_num,
note_index: BlockNoteIndex::new(0, 1),
note_index: BlockNoteIndex::new(0, 1).unwrap(),
note_id: num_to_rpo_digest(1),
metadata: NoteMetadata::new(
ACCOUNT_ID_OFF_CHAIN_SENDER.try_into().unwrap(),
Expand All @@ -268,7 +268,7 @@ fn sql_select_notes_different_execution_hints() {

let note_after_block = NoteRecord {
block_num,
note_index: BlockNoteIndex::new(0, 2),
note_index: BlockNoteIndex::new(0, 2).unwrap(),
note_id: num_to_rpo_digest(2),
metadata: NoteMetadata::new(
ACCOUNT_ID_OFF_CHAIN_SENDER.try_into().unwrap(),
Expand Down Expand Up @@ -317,7 +317,7 @@ fn sql_unconsumed_network_notes() {
};
let note = NoteRecord {
block_num,
note_index: BlockNoteIndex::new(0, i as usize),
note_index: BlockNoteIndex::new(0, i as usize).unwrap(),
note_id: num_to_rpo_digest(i),
metadata: NoteMetadata::new(
account_id,
Expand Down Expand Up @@ -883,7 +883,7 @@ fn notes() {
assert!(res.is_empty());

// test insertion
let note_index = BlockNoteIndex::new(0, 2);
let note_index = BlockNoteIndex::new(0, 2).unwrap();
let note_id = num_to_rpo_digest(3);
let tag = 5u32;
let sender = AccountId::try_from(ACCOUNT_ID_OFF_CHAIN_SENDER).unwrap();
Expand Down

0 comments on commit baf3f44

Please sign in to comment.