Skip to content

Commit aa2ebce

Browse files
Merge branch 'next' into santiagopittella-ntx-builder-account-blacklisting
2 parents aab733a + e38509c commit aa2ebce

17 files changed

Lines changed: 259 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Enhancements
66

7+
- Expose per-tree RocksDB tuning options ([#1782](https://github.com/0xMiden/node/pull/1782)).
78
- Added verbose `info!`-level logging to the network transaction builder for transaction execution, note filtering failures, and transaction outcomes ([#1770](https://github.com/0xMiden/node/pull/1770)).
89
- [BREAKING] Move block proving from Blocker Producer to the Store ([#1579](https://github.com/0xMiden/node/pull/1579)).
910
- [BREAKING] Updated miden-base dependencies to use `next` branch; renamed `NoteInputs` to `NoteStorage`, `.inputs()` to `.storage()`, and database `inputs` column to `storage` ([#1595](https://github.com/0xMiden/node/pull/1595)).

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node/src/commands/bundled.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use anyhow::Context;
55
use miden_node_block_producer::BlockProducer;
66
use miden_node_rpc::Rpc;
77
use miden_node_store::Store;
8-
use miden_node_utils::clap::GrpcOptionsExternal;
8+
use miden_node_utils::clap::{GrpcOptionsExternal, StorageOptions};
99
use miden_node_utils::grpc::UrlExt;
1010
use miden_node_validator::{Validator, ValidatorSigner};
1111
use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey;
@@ -84,6 +84,9 @@ pub enum BundledCommand {
8484

8585
#[command(flatten)]
8686
grpc_options: GrpcOptionsExternal,
87+
88+
#[command(flatten)]
89+
storage_options: StorageOptions,
8790
},
8891
}
8992

@@ -121,6 +124,7 @@ impl BundledCommand {
121124
validator,
122125
enable_otel: _,
123126
grpc_options,
127+
storage_options,
124128
} => {
125129
Self::start(
126130
rpc_url,
@@ -130,13 +134,14 @@ impl BundledCommand {
130134
ntx_builder,
131135
validator,
132136
grpc_options,
137+
storage_options,
133138
)
134139
.await
135140
},
136141
}
137142
}
138143

139-
#[expect(clippy::too_many_lines)]
144+
#[expect(clippy::too_many_lines, clippy::too_many_arguments)]
140145
async fn start(
141146
rpc_url: Url,
142147
block_prover_url: Option<Url>,
@@ -145,6 +150,7 @@ impl BundledCommand {
145150
ntx_builder: NtxBuilderConfig,
146151
validator: BundledValidatorConfig,
147152
grpc_options: GrpcOptionsExternal,
153+
storage_options: StorageOptions,
148154
) -> anyhow::Result<()> {
149155
// Start listening on all gRPC urls so that inter-component connections can be created
150156
// before each component is fully started up.
@@ -202,6 +208,7 @@ impl BundledCommand {
202208
data_directory: data_directory_clone,
203209
block_prover_url,
204210
grpc_options: grpc_options.into(),
211+
storage_options,
205212
}
206213
.serve()
207214
.await

bin/node/src/commands/store.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
33
use anyhow::Context;
44
use miden_node_store::Store;
55
use miden_node_store::genesis::GenesisBlock;
6-
use miden_node_utils::clap::GrpcOptionsInternal;
6+
use miden_node_utils::clap::{GrpcOptionsInternal, StorageOptions};
77
use miden_node_utils::fs::ensure_empty_directory;
88
use miden_node_utils::grpc::UrlExt;
99
use miden_protocol::block::ProvenBlock;
@@ -67,6 +67,9 @@ pub enum StoreCommand {
6767

6868
#[command(flatten)]
6969
grpc_options: GrpcOptionsInternal,
70+
71+
#[command(flatten)]
72+
storage_options: StorageOptions,
7073
},
7174
}
7275

@@ -86,6 +89,7 @@ impl StoreCommand {
8689
data_directory,
8790
enable_otel: _,
8891
grpc_options,
92+
storage_options,
8993
} => {
9094
Self::start(
9195
rpc_url,
@@ -94,6 +98,7 @@ impl StoreCommand {
9498
block_prover_url,
9599
data_directory,
96100
grpc_options,
101+
storage_options,
97102
)
98103
.await
99104
},
@@ -115,6 +120,7 @@ impl StoreCommand {
115120
block_prover_url: Option<Url>,
116121
data_directory: PathBuf,
117122
grpc_options: GrpcOptionsInternal,
123+
storage_options: StorageOptions,
118124
) -> anyhow::Result<()> {
119125
let rpc_listener = rpc_url
120126
.to_socket()
@@ -144,6 +150,7 @@ impl StoreCommand {
144150
block_producer_listener,
145151
data_directory,
146152
grpc_options,
153+
storage_options,
147154
}
148155
.serve()
149156
.await

bin/stress-test/src/seeding/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use miden_node_block_producer::store::StoreClient;
99
use miden_node_proto::domain::batch::BatchInputs;
1010
use miden_node_proto::generated::store::rpc_client::RpcClient;
1111
use miden_node_store::{DataDirectory, GenesisState, Store};
12-
use miden_node_utils::clap::GrpcOptionsInternal;
12+
use miden_node_utils::clap::{GrpcOptionsInternal, StorageOptions};
1313
use miden_node_utils::tracing::grpc::OtelInterceptor;
1414
use miden_protocol::account::auth::AuthScheme;
1515
use miden_protocol::account::delta::AccountUpdateDetails;
@@ -555,6 +555,7 @@ pub async fn start_store(
555555
block_producer_listener,
556556
data_directory: dir,
557557
grpc_options: GrpcOptionsInternal::bench(),
558+
storage_options: StorageOptions::bench(),
558559
}
559560
.serve()
560561
.await

bin/stress-test/src/store/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use futures::{StreamExt, stream};
55
use miden_node_proto::generated::store::rpc_client::RpcClient;
66
use miden_node_proto::generated::{self as proto};
77
use miden_node_store::state::State;
8+
use miden_node_utils::clap::StorageOptions;
89
use miden_node_utils::tracing::grpc::OtelInterceptor;
910
use miden_protocol::account::AccountId;
1011
use miden_protocol::note::{NoteDetails, NoteTag};
@@ -490,7 +491,9 @@ struct SyncChainMmrRun {
490491
pub async fn load_state(data_directory: &Path) {
491492
let start = Instant::now();
492493
let (termination_ask, _) = tokio::sync::mpsc::channel(1);
493-
let _state = State::load(data_directory, termination_ask).await.unwrap();
494+
let _state = State::load(data_directory, StorageOptions::default(), termination_ask)
495+
.await
496+
.unwrap();
494497
let elapsed = start.elapsed();
495498

496499
// Get database path and run SQL commands to count records

crates/block-producer/src/server/tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::time::Duration;
33

44
use miden_node_proto::generated::block_producer::api_client as block_producer_client;
55
use miden_node_store::{GenesisState, Store};
6-
use miden_node_utils::clap::GrpcOptionsInternal;
6+
use miden_node_utils::clap::{GrpcOptionsInternal, StorageOptions};
77
use miden_node_utils::fee::test_fee_params;
88
use miden_node_validator::{Validator, ValidatorSigner};
99
use miden_protocol::testing::random_secret_key::random_secret_key;
@@ -159,6 +159,7 @@ async fn start_store(
159159
block_prover_url: None,
160160
data_directory: dir,
161161
grpc_options: GrpcOptionsInternal::bench(),
162+
storage_options: StorageOptions::bench(),
162163
}
163164
.serve()
164165
.await

crates/rpc/src/tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use miden_node_proto::generated::rpc::api_client::ApiClient as ProtoClient;
99
use miden_node_proto::generated::{self as proto};
1010
use miden_node_store::Store;
1111
use miden_node_store::genesis::config::GenesisConfig;
12-
use miden_node_utils::clap::{GrpcOptionsExternal, GrpcOptionsInternal};
12+
use miden_node_utils::clap::{GrpcOptionsExternal, GrpcOptionsInternal, StorageOptions};
1313
use miden_node_utils::fee::test_fee;
1414
use miden_node_utils::limiter::{
1515
QueryParamAccountIdLimit,
@@ -480,6 +480,7 @@ async fn start_store(store_listener: TcpListener) -> (Runtime, TempDir, Word, So
480480
block_producer_listener,
481481
data_directory: dir,
482482
grpc_options: GrpcOptionsInternal::test(),
483+
storage_options: StorageOptions::default(),
483484
}
484485
.serve()
485486
.await
@@ -522,6 +523,7 @@ async fn restart_store(store_addr: SocketAddr, data_directory: &std::path::Path)
522523
block_producer_listener,
523524
data_directory: dir,
524525
grpc_options: GrpcOptionsInternal::test(),
526+
storage_options: StorageOptions::default(),
525527
}
526528
.serve()
527529
.await

crates/store/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ termtree = "1.0"
7272

7373
[features]
7474
default = ["rocksdb"]
75-
rocksdb = ["dep:miden-large-smt-backend-rocksdb"]
75+
rocksdb = ["dep:miden-large-smt-backend-rocksdb", "miden-node-utils/rocksdb"]
7676

7777
[[bench]]
7878
harness = false

crates/store/src/server/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use miden_node_proto_build::{
1010
store_ntx_builder_api_descriptor,
1111
store_rpc_api_descriptor,
1212
};
13-
use miden_node_utils::clap::GrpcOptionsInternal;
13+
use miden_node_utils::clap::{GrpcOptionsInternal, StorageOptions};
1414
use miden_node_utils::panic::{CatchPanicLayer, catch_panic_layer_fn};
1515
use miden_node_utils::tracing::grpc::grpc_trace_fn;
1616
use tokio::net::TcpListener;
@@ -41,6 +41,7 @@ pub struct Store {
4141
/// URL for the Block Prover client. Uses local prover if `None`.
4242
pub block_prover_url: Option<Url>,
4343
pub data_directory: PathBuf,
44+
pub storage_options: StorageOptions,
4445
pub grpc_options: GrpcOptionsInternal,
4546
}
4647

@@ -90,7 +91,7 @@ impl Store {
9091
let (termination_ask, mut termination_signal) =
9192
tokio::sync::mpsc::channel::<ApplyBlockError>(1);
9293
let state = Arc::new(
93-
State::load(&self.data_directory, termination_ask)
94+
State::load(&self.data_directory, self.storage_options, termination_ask)
9495
.await
9596
.context("failed to load state")?,
9697
);

0 commit comments

Comments
 (0)