Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e8c6e6f
feat(rpc): expose protocol config over the gRPC APIs
kkovaacs Sep 8, 2026
a6e4330
Update proto/proto/rpc.proto
kkovaacs Sep 9, 2026
66dd34e
Update proto/proto/rpc.proto
kkovaacs Sep 9, 2026
b10d799
Update proto/proto/rpc.proto
kkovaacs Sep 9, 2026
6f42953
Update proto/proto/types/block_proving.proto
kkovaacs Sep 9, 2026
8c74349
Update proto/proto/internal/validator.proto
kkovaacs Sep 9, 2026
21e93bb
fix: compile after rebase
kkovaacs Sep 10, 2026
4159caf
fix(network-monitor): simplify deployment fee checks
kkovaacs Sep 10, 2026
56c5460
test(network-monitor): remove obsolete probe startup test
kkovaacs Sep 10, 2026
b778d9f
refactor(validator): hoist protocol config persistence checks
kkovaacs Sep 10, 2026
1fe9eeb
refactor(store): validate protocol configs in the block writer
kkovaacs Sep 10, 2026
f4a201c
fix(validator): migrate protocol config storage separately
kkovaacs Sep 10, 2026
914b4e8
fix(db): implement FromSqlValue and ToSqlValue for ProtocolConfig
kkovaacs Sep 10, 2026
3bc0bcc
fix: remove bogus test
kkovaacs Sep 10, 2026
f108bf0
fix: remove more tests
kkovaacs Sep 10, 2026
aeacafb
fix: rename to config_required
kkovaacs Sep 10, 2026
b4252c7
refactor: apply block tests
kkovaacs Sep 10, 2026
3851775
fix: compile after rebase
kkovaacs Sep 11, 2026
090ceb0
fix(db): protocol config is not verified when loading from db
kkovaacs Sep 11, 2026
9b20862
refactor(validator/block_subscription): load protocol config only if …
kkovaacs Sep 11, 2026
9f3c57e
refactor(store): add activation block number for protocol configs
kkovaacs Sep 13, 2026
a23a51e
refactor: rename decode_protocol_config
kkovaacs Sep 13, 2026
8302aa3
refactor(validator/db): remove unnecessary DB load
kkovaacs Sep 13, 2026
d5a7824
refactor(rpc): move helper function to helper section
kkovaacs Sep 13, 2026
b32eb69
fix: clippy
kkovaacs Sep 14, 2026
41f6e86
fix: diesel schema ordering fix
kkovaacs Sep 14, 2026
843100f
fix: document when protocol configuration needs to be present
kkovaacs Sep 14, 2026
39de88e
refactor(validator): add activation block number to protocol_configs
kkovaacs Sep 14, 2026
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 Cargo.lock

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

6 changes: 2 additions & 4 deletions bin/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ make install-benchmark
```sh
miden-benchmark create-proofs \
--rpc-url http://127.0.0.1:57291 \
--fee-faucet-id <ACCOUNT_ID> \
--num-transactions 100
```

`--fee-faucet-id` identifies the native faucet whose asset pays transaction fees. Block headers commit to the protocol
configuration but do not contain its full value. `miden-validator genesis` prints this account ID.
The benchmark obtains the active protocol configuration from RPC and verifies it against the reference block before it
generates transactions.

Writes the bundle to `./benchmark-proofs/`:

Expand Down Expand Up @@ -72,7 +71,6 @@ locally:
```sh
miden-benchmark create-proofs \
--rpc-url http://127.0.0.1:57291 \
--fee-faucet-id <ACCOUNT_ID> \
--num-transactions 100 \
--remote-prover-url http://prover.example.com:50051
```
Expand Down
49 changes: 7 additions & 42 deletions bin/benchmark/src/create_proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use rayon::prelude::*;
use url::Url;

use crate::prover::BenchmarkProver;
use crate::rpc_state::{fetch_chain_tip_header, fetch_partial_blockchain};
use crate::rpc_state::fetch_chain_tip_state;
use crate::summary::print_proving_summary;
use crate::{
PROOFS_DIR,
Expand All @@ -69,9 +69,6 @@ use crate::{
write_to_file,
};

/// Maximum attempts to observe a stable chain tip.
const MAX_TIP_FETCH_ATTEMPTS: u32 = 10;

// CONSTANTS
// ================================================================================================

Expand Down Expand Up @@ -176,12 +173,7 @@ impl ProofCollector {
reason = "single linear orchestration of genesis fetch + mint phase + consume phase; \
splitting would just shuffle locals (faucet, data_store, authenticator) around"
)]
pub(crate) async fn run(
rpc_url: Url,
num_transactions: u64,
fee_faucet_id: AccountId,
remote_prover_url: Option<String>,
) {
pub(crate) async fn run(rpc_url: Url, num_transactions: u64, remote_prover_url: Option<String>) {
let mut rpc_client = create_genesis_aware_rpc_client(&rpc_url, Duration::from_secs(10))
.await
.unwrap();
Expand All @@ -195,38 +187,11 @@ pub(crate) async fn run(
.block_header
.expect("RPC returned no block header");
let genesis_header: BlockHeader = genesis_header_proto.try_into().unwrap();
let protocol_config = ProtocolConfig::current(AssetId::new_fungible(fee_faucet_id))
.expect("fee faucet should produce a valid protocol configuration");
assert_eq!(
protocol_config.to_commitment(),
genesis_header.protocol_config_commitment(),
"--fee-faucet-id does not match the target chain's protocol configuration",
);

// The tip header and chain MMR come from separate RPC calls, so retry until they refer to the
// same chain tip.
let mut tip_state = None;
for _ in 0..MAX_TIP_FETCH_ATTEMPTS {
println!("Fetching chain tip header...");
let ref_block_header = fetch_chain_tip_header(&mut rpc_client).await;
let ref_block_num = ref_block_header.block_num();

println!("Fetching chain MMR up to ref block...");
let partial_blockchain =
fetch_partial_blockchain(&mut rpc_client, ref_block_num.as_u32(), &genesis_header)
.await;

if partial_blockchain.chain_length() == ref_block_num {
tip_state = Some((ref_block_header, partial_blockchain));
break;
}
}
let (ref_block_header, partial_blockchain) = tip_state.unwrap_or_else(|| {
panic!(
"failed to fetch a consistent tip header and chain MMR after \
{MAX_TIP_FETCH_ATTEMPTS} attempts",
)
});
println!("Fetching chain tip state...");
let (ref_block_header, protocol_config, partial_blockchain) =
fetch_chain_tip_state(&mut rpc_client, &genesis_header)
.await
.expect("failed to fetch the chain tip transaction anchor");
let ref_block_num = ref_block_header.block_num();

println!("Creating faucet...");
Expand Down
1 change: 1 addition & 0 deletions bin/benchmark/src/inclusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ pub(crate) async fn current_block_height(mut client: RpcClient) -> u32 {
.get_block_header_by_number(BlockHeaderByNumberRequest {
block_num: None,
include_mmr_proof: None,
include_protocol_config: None,
})
.await
.expect("failed to fetch latest block header")
Expand Down
17 changes: 2 additions & 15 deletions bin/benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use miden_node_proto::domain::encryption::{
};
use miden_node_proto::generated::rpc::BlockHeaderByNumberRequest;
use miden_protocol::Word;
use miden_protocol::account::AccountId;
use miden_protocol::block::{BlockHeader, BlockNumber};
use miden_protocol::crypto::dsa::ecdsa_k256_keccak::PublicKey as ValidatorPublicKey;
use miden_protocol::utils::serde::{Deserializable, Serializable};
Expand Down Expand Up @@ -58,11 +57,6 @@ pub enum Command {
/// STARK proving, so start small.
#[arg(long, default_value_t = 10)]
num_transactions: u64,
/// Faucet account whose fungible asset the target chain uses for fees.
///
/// Block headers commit to the protocol configuration but do not contain its preimage.
#[arg(long, value_parser = parse_account_id)]
fee_faucet_id: AccountId,
/// If set, proofs are produced by the remote prover at this URL instead of locally.
/// Dispatch is rate-limited: starts at 1 req/s, bumps by 1 req/s every 3 minutes up to 10
/// req/s, and freezes at the current step if the prover returns a retryable error
Expand Down Expand Up @@ -112,11 +106,9 @@ impl Cli {
Command::CreateProofs {
rpc_url,
num_transactions,
fee_faucet_id,
remote_prover_url,
} => {
create_proofs::run(rpc_url, num_transactions, fee_faucet_id, remote_prover_url)
.await;
create_proofs::run(rpc_url, num_transactions, remote_prover_url).await;
},
Command::RunBenchmark {
rpc_url,
Expand All @@ -138,12 +130,6 @@ impl Cli {
}
}

fn parse_account_id(value: &str) -> std::result::Result<AccountId, String> {
AccountId::parse(value)
.map(|(account_id, _network_id)| account_id)
.map_err(|err| err.to_string())
}

// SHARED INFRA
// ================================================================================================

Expand Down Expand Up @@ -247,6 +233,7 @@ pub(crate) fn get_genesis_header_request() -> BlockHeaderByNumberRequest {
BlockHeaderByNumberRequest {
block_num: Some(BlockNumber::GENESIS.as_u32()),
include_mmr_proof: None,
include_protocol_config: None,
}
}

Expand Down
Loading
Loading