Skip to content

Commit cd0f726

Browse files
Update to use TransactionHeader (#781)
* feat: Update to use `TransactionHeader` * chore: Add changelog * chore: make lint * chore: Remove changelog entry * chore: Update used miden-base version * chore: Update to latest miden base * chore: Use next branch of miden-base
1 parent 3c534a0 commit cd0f726

16 files changed

Lines changed: 166 additions & 130 deletions

File tree

Cargo.lock

Lines changed: 39 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ assert_matches = { version = "1.5" }
3535
http = { version = "1.3" }
3636
itertools = { version = "0.14" }
3737
miden-air = { version = "0.13" }
38-
miden-lib = { version = "0.8" }
38+
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
3939
miden-node-block-producer = { path = "crates/block-producer", version = "0.9" }
4040
miden-node-proto = { path = "crates/proto", version = "0.9" }
4141
miden-node-proto-build = { path = "proto", version = "0.9" }
4242
miden-node-rpc = { path = "crates/rpc", version = "0.9" }
4343
miden-node-store = { path = "crates/store", version = "0.9" }
4444
miden-node-test-macro = { path = "crates/test-macro" }
4545
miden-node-utils = { path = "crates/utils", version = "0.9" }
46-
miden-objects = { version = "0.8" }
46+
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
4747
miden-processor = { version = "0.13" }
48-
miden-tx = { version = "0.8" }
48+
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
4949
prost = { version = "0.13" }
5050
rand = { version = "0.9" }
5151
thiserror = { version = "2.0", default-features = false }

bin/stress-test/Cargo.toml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ version.workspace = true
1616
workspace = true
1717

1818
[dependencies]
19-
anyhow = { workspace = true }
20-
clap = { version = "4.5", features = ["derive", "string"] }
21-
miden-air = { workspace = true }
22-
miden-block-prover = { version = "0.8", features = ["testing"] }
23-
miden-lib = { workspace = true }
19+
anyhow = { workspace = true }
20+
clap = { version = "4.5", features = ["derive", "string"] }
21+
miden-air = { workspace = true }
22+
miden-block-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next", features = [
23+
"testing",
24+
] }
25+
miden-lib = { workspace = true }
2426
miden-node-block-producer = { workspace = true }
25-
miden-node-proto = { workspace = true }
26-
miden-node-store = { workspace = true }
27-
miden-node-utils = { workspace = true }
28-
miden-objects = { workspace = true, features = ["testing"] }
29-
rand = { version = "0.9" }
30-
rayon = { version = "1.5" }
31-
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "sync", "time"] }
32-
tonic = { workspace = true }
33-
winterfell = { version = "0.12" }
27+
miden-node-proto = { workspace = true }
28+
miden-node-store = { workspace = true }
29+
miden-node-utils = { workspace = true }
30+
miden-objects = { workspace = true, features = ["testing"] }
31+
rand = { version = "0.9" }
32+
rayon = { version = "1.5" }
33+
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "sync", "time"] }
34+
tonic = { workspace = true }
35+
winterfell = { version = "0.12" }

bin/stress-test/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ use miden_objects::{
3333
rand::RpoRandomCoin,
3434
},
3535
note::{Note, NoteHeader, NoteId, NoteInclusionProof},
36-
transaction::{InputNote, InputNotes, OutputNote, ProvenTransaction, ProvenTransactionBuilder},
36+
transaction::{
37+
InputNote, InputNotes, OrderedTransactionHeaders, OutputNote, ProvenTransaction,
38+
ProvenTransactionBuilder, TransactionHeader,
39+
},
3740
vm::ExecutionProof,
3841
};
3942
use rand::Rng;
@@ -353,6 +356,7 @@ fn create_batch(txs: &[ProvenTransaction], block_ref: &BlockHeader) -> ProvenBat
353356
InputNotes::new(input_notes).unwrap(),
354357
output_notes,
355358
BlockNumber::from(u32::MAX),
359+
OrderedTransactionHeaders::new_unchecked(txs.iter().map(TransactionHeader::from).collect()),
356360
)
357361
}
358362

crates/block-producer/Cargo.toml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,29 @@ workspace = true
1818
tracing-forest = ["miden-node-utils/tracing-forest"]
1919

2020
[dependencies]
21-
async-trait = { version = "0.1" }
22-
futures = { version = "0.3" }
23-
itertools = { workspace = true }
24-
miden-block-prover = { version = "0.8" }
25-
miden-lib = { workspace = true }
26-
miden-node-proto = { workspace = true }
27-
miden-node-utils = { workspace = true }
28-
miden-objects = { workspace = true }
29-
miden-processor = { workspace = true }
30-
miden-proving-service-client = { version = "0.8", features = ["batch-prover", "block-prover"] }
31-
miden-tx = { workspace = true }
32-
miden-tx-batch-prover = { version = "0.8" }
33-
rand = { version = "0.9" }
34-
thiserror = { workspace = true }
35-
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "sync", "time"] }
36-
tokio-stream = { workspace = true, features = ["net"] }
37-
tonic = { workspace = true, features = ["transport"] }
38-
tower-http = { workspace = true, features = ["util"] }
39-
tracing = { workspace = true }
40-
url = { workspace = true }
21+
async-trait = { version = "0.1" }
22+
futures = { version = "0.3" }
23+
itertools = { workspace = true }
24+
miden-block-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
25+
miden-lib = { workspace = true }
26+
miden-node-proto = { workspace = true }
27+
miden-node-utils = { workspace = true }
28+
miden-objects = { workspace = true }
29+
miden-processor = { workspace = true }
30+
miden-proving-service-client = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next", features = [
31+
"batch-prover",
32+
"block-prover",
33+
] }
34+
miden-tx = { workspace = true }
35+
miden-tx-batch-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", branch = "next" }
36+
rand = { version = "0.9" }
37+
thiserror = { workspace = true }
38+
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "sync", "time"] }
39+
tokio-stream = { workspace = true, features = ["net"] }
40+
tonic = { workspace = true, features = ["transport"] }
41+
tower-http = { workspace = true, features = ["util"] }
42+
tracing = { workspace = true }
43+
url = { workspace = true }
4144

4245
[dev-dependencies]
4346
assert_matches = { workspace = true }

crates/block-producer/src/block_builder/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,11 @@ impl TelemetryInjectorExt for ProposedBlock {
319319
.expect("should have less than u32::MAX output notes"),
320320
);
321321

322-
let num_batch_created_notes =
323-
self.batches().iter().fold(0, |acc, batch| acc + batch.output_notes().len());
322+
let num_batch_created_notes = self
323+
.batches()
324+
.as_slice()
325+
.iter()
326+
.fold(0, |acc, batch| acc + batch.output_notes().len());
324327
span.set_attribute(
325328
"block.batches.output_notes.count",
326329
u32::try_from(num_batch_created_notes)

0 commit comments

Comments
 (0)