Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6e4e575
Return signature from validator
sergerad Dec 3, 2025
1cce801
Update base
sergerad Dec 4, 2025
bb10a61
Fix after base update
sergerad Dec 4, 2025
b7efb24
Reverse verification logic
sergerad Dec 4, 2025
08be859
Partial complete - add signature proto and genesis bootstrap
sergerad Dec 8, 2025
331d4b3
Stringified local key
sergerad Dec 9, 2025
e7116b5
Feed signer through
sergerad Dec 9, 2025
659e14e
Update deps
sergerad Dec 9, 2025
e124ff3
Rename validator key
sergerad Dec 10, 2025
0d7fb78
Merge branch 'next' of github.com:0xMiden/miden-node into sergerad-va…
sergerad Dec 10, 2025
c5ed44e
Fix base integration
sergerad Dec 11, 2025
75d0516
Add unit test and wire validator together with filepath secret, enabl…
sergerad Dec 11, 2025
c7835c7
Toml
sergerad Dec 11, 2025
1fdbac0
Changelog
sergerad Dec 11, 2025
1e8e933
Comments and use<>
sergerad Dec 11, 2025
44587b2
Fix signer config name
sergerad Dec 11, 2025
5c481e6
Rename sig proto
sergerad Dec 11, 2025
0f6f969
Rename public key
sergerad Dec 11, 2025
95fe8d1
Update bootstrap validator configuration
sergerad Dec 11, 2025
78b4347
No optional genesis config
sergerad Dec 11, 2025
fc271d8
Use context
sergerad Dec 11, 2025
49d8446
Merge branch 'next' of github.com:0xMiden/miden-node into sergerad-va…
sergerad Dec 11, 2025
d02a6da
Update deps
sergerad Dec 11, 2025
670ca1c
Toml
sergerad Dec 11, 2025
4c89a82
RM bootstrap from dockerfile
sergerad Dec 12, 2025
42331a1
Fix dockerfile dirs
sergerad Dec 12, 2025
63f0455
Rename to block sig
sergerad Dec 12, 2025
f0f3761
Reduce fns and args
sergerad Dec 12, 2025
01b1001
Remove key from toml
sergerad Dec 14, 2025
7fe8b69
Merge branch 'next' of github.com:0xMiden/miden-node into sergerad-va…
sergerad Dec 14, 2025
5250615
Fix test
sergerad Dec 14, 2025
8a9ce85
Remove deser
sergerad Dec 15, 2025
fbd2389
Misc pr fixes
sergerad Dec 15, 2025
8d42710
Add predefined validator key
sergerad Dec 15, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Add `S` generic to `NullifierTree` to allow usage with `LargeSmt`s ([#1353](https://github.com/0xMiden/miden-node/issues/1353)).
- Removed internal errors from the `miden-network-monitor` ([#1424](https://github.com/0xMiden/miden-node/pull/1424)).
- [BREAKING] Re-organized RPC protobuf schema to be independent of internal schema ([#1401](https://github.com/0xMiden/miden-node/pull/1401)).
- [BREAKING] Added block signing capabilities to Validator component and updated gensis bootstrap to sign blocks with configured signer ([#1426](https://github.com/0xMiden/miden-node/pull/1426)).
- Reduced default block interval from `5s` to `2s` ([#1438](https://github.com/0xMiden/miden-node/pull/1438)).
- Increased retained account tree history from 33 to 100 blocks to account for the reduced block interval ([#1438](https://github.com/0xMiden/miden-node/pull/1438)).

Expand Down
32 changes: 17 additions & 15 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 bin/node/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MIDEN_NODE_STORE_RPC_URL=
MIDEN_NODE_STORE_NTX_BUILDER_URL=
MIDEN_NODE_STORE_BLOCK_PRODUCER_URL=
MIDEN_NODE_VALIDATOR_BLOCK_PRODUCER_URL=
MIDEN_NODE_VALIDATOR_INSECURE_SECRET_KEY=
MIDEN_NODE_RPC_URL=http://0.0.0.0:57291
MIDEN_NODE_DATA_DIRECTORY=./
MIDEN_NODE_ENABLE_OTEL=true
1 change: 1 addition & 0 deletions bin/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tracing-forest = ["miden-node-block-producer/tracing-forest"]
anyhow = { workspace = true }
clap = { features = ["env", "string"], workspace = true }
fs-err = { workspace = true }
hex = { workspace = true }
humantime = { workspace = true }
miden-node-block-producer = { workspace = true }
miden-node-ntx-builder = { workspace = true }
Expand Down
7 changes: 1 addition & 6 deletions bin/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ COPY ./crates ./crates
COPY ./proto ./proto

RUN cargo install --path bin/node --locked
RUN rm -rf data accounts && mkdir data accounts
RUN miden-node bundled bootstrap --data-directory ./data --accounts-directory ./accounts

FROM debian:bullseye-slim

Expand All @@ -26,8 +24,6 @@ RUN apt-get update && \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/accounts accounts
COPY --from=builder /app/data data
COPY --from=builder /usr/local/cargo/bin/miden-node /usr/local/bin/miden-node

LABEL org.opencontainers.image.authors=devops@miden.team \
Expand All @@ -47,6 +43,5 @@ LABEL org.opencontainers.image.created=$CREATED \
# Expose RPC port
EXPOSE 57291

# Start the Miden node
# Miden node does not spawn sub-processes, so it can be used as the PID1
CMD miden-node bundled start --rpc.url http://0.0.0.0:57291 --data-directory ./data
CMD miden-node
55 changes: 48 additions & 7 deletions bin/node/src/commands/bundled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ use miden_node_rpc::Rpc;
use miden_node_store::Store;
use miden_node_utils::grpc::UrlExt;
use miden_node_validator::Validator;
use miden_objects::block::BlockSigner;
use miden_objects::crypto::dsa::ecdsa_k256_keccak::SecretKey;
use miden_objects::utils::Deserializable;
use tokio::net::TcpListener;
use tokio::sync::Barrier;
use tokio::task::JoinSet;
Expand All @@ -21,6 +24,8 @@ use crate::commands::{
DEFAULT_TIMEOUT,
ENV_ENABLE_OTEL,
ENV_GENESIS_CONFIG_FILE,
ENV_VALIDATOR_INSECURE_SECRET_KEY,
INSECURE_VALIDATOR_KEY_HEX,
NtxBuilderConfig,
duration_to_human_readable_string,
};
Expand All @@ -43,7 +48,17 @@ pub enum BundledCommand {
accounts_directory: PathBuf,
/// Constructs the genesis block from the given toml file.
#[arg(long, env = ENV_GENESIS_CONFIG_FILE, value_name = "FILE")]
genesis_config_file: Option<PathBuf>,
genesis_config_file: PathBuf,
/// Insecure, hex-encoded validator secret key for development and testing purposes.
///
/// If not provided, a predefined key is used.
#[arg(
long = "validator.insecure.secret-key",
env = ENV_VALIDATOR_INSECURE_SECRET_KEY,
value_name = "VALIDATOR_INSECURE_SECRET_KEY",
default_value = INSECURE_VALIDATOR_KEY_HEX
)]
validator_insecure_secret_key: String,
},

/// Runs all three node components in the same process.
Expand Down Expand Up @@ -82,6 +97,14 @@ pub enum BundledCommand {
value_name = "DURATION"
)]
grpc_timeout: Duration,

/// Insecure, hex-encoded validator secret key for development and testing purposes.
#[arg(
long = "validator.insecure.secret-key",
env = ENV_VALIDATOR_INSECURE_SECRET_KEY,
value_name = "VALIDATOR_INSECURE_SECRET_KEY"
)]
validator_insecure_secret_key: Option<String>,
},
}

Expand All @@ -92,12 +115,14 @@ impl BundledCommand {
data_directory,
accounts_directory,
genesis_config_file,
validator_insecure_secret_key,
} => {
// Currently the bundled bootstrap is identical to the store's bootstrap.
crate::commands::store::StoreCommand::Bootstrap {
data_directory,
accounts_directory,
genesis_config_file,
validator_insecure_secret_key,
}
.handle()
.await
Expand All @@ -110,9 +135,20 @@ impl BundledCommand {
ntx_builder,
enable_otel: _,
grpc_timeout,
validator_insecure_secret_key,
} => {
Self::start(rpc_url, data_directory, ntx_builder, block_producer, grpc_timeout)
.await
let secret_key_hex =
validator_insecure_secret_key.unwrap_or(INSECURE_VALIDATOR_KEY_HEX.into());
let signer = SecretKey::read_from_bytes(hex::decode(secret_key_hex)?.as_ref())?;
Self::start(
rpc_url,
data_directory,
ntx_builder,
block_producer,
grpc_timeout,
signer,
)
.await
},
}
}
Expand All @@ -124,6 +160,7 @@ impl BundledCommand {
ntx_builder: NtxBuilderConfig,
block_producer: BlockProducerConfig,
grpc_timeout: Duration,
signer: impl BlockSigner + Send + Sync + 'static,
) -> anyhow::Result<()> {
// Start listening on all gRPC urls so that inter-component connections can be created
// before each component is fully started up.
Expand Down Expand Up @@ -227,10 +264,14 @@ impl BundledCommand {
let validator_id = join_set
.spawn({
async move {
Validator { address: validator_address, grpc_timeout }
.serve()
.await
.context("failed while serving validator component")
Validator {
address: validator_address,
grpc_timeout,
signer,
}
.serve()
.await
.context("failed while serving validator component")
}
})
.id();
Expand Down
5 changes: 5 additions & 0 deletions bin/node/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pub mod rpc;
pub mod store;
pub mod validator;

/// A predefined, insecure validator key for development purposes.
const INSECURE_VALIDATOR_KEY_HEX: &str =
"0101010101010101010101010101010101010101010101010101010101010101";

const ENV_BLOCK_PRODUCER_URL: &str = "MIDEN_NODE_BLOCK_PRODUCER_URL";
const ENV_VALIDATOR_URL: &str = "MIDEN_NODE_VALIDATOR_URL";
const ENV_BATCH_PROVER_URL: &str = "MIDEN_NODE_BATCH_PROVER_URL";
Expand All @@ -31,6 +35,7 @@ const ENV_GENESIS_CONFIG_FILE: &str = "MIDEN_GENESIS_CONFIG_FILE";
const ENV_MAX_TXS_PER_BATCH: &str = "MIDEN_MAX_TXS_PER_BATCH";
const ENV_MAX_BATCHES_PER_BLOCK: &str = "MIDEN_MAX_BATCHES_PER_BLOCK";
const ENV_MEMPOOL_TX_CAPACITY: &str = "MIDEN_NODE_MEMPOOL_TX_CAPACITY";
const ENV_VALIDATOR_INSECURE_SECRET_KEY: &str = "MIDEN_NODE_VALIDATOR_INSECURE_SECRET_KEY";

const DEFAULT_NTX_TICKER_INTERVAL: Duration = Duration::from_millis(200);
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
Expand Down
Loading