Skip to content

Commit

Permalink
feat: use remote batch prover
Browse files Browse the repository at this point in the history
docs: add PR number to Changelog

remove remote prover from CI and makefile

remove remote prover from README

feat: create BatchProver enum, make remote proving optional

update to latest changes in miden-base

fix: udpate with miden-base latest

review: use multiple statements to print the configs

review: replace warn! with info! in prover init

review: add instrumentation to batch prover

review: rename remote_batch_prover to batch_prover_url

review: remove default batch prover url constant

review: move the batch_prover field from BatchProducer to BatchBuilder

fix: rollback changes in Makefile

docs: update CHANGELOG, add change to readme

fix: make it compatible with miden-base
  • Loading branch information
SantiagoPittella committed Feb 25, 2025
1 parent 540e097 commit 7b80750
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 45 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [BREAKING] Update `GetBlockInputs` RPC (#709).
- [BREAKING] `CheckNullifiersByPrefix` now takes a starting block number (#707).
- [BREAKING] Removed nullifiers from `SyncState` endpoint (#708).
- [BREAKING] Added `batch_prover_url` to block producer configuration (#701).

### Enhancements

Expand Down
111 changes: 105 additions & 6 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ or alternatively start the systemd service if that's how you wish to operate:
systemctl start miden-node.service
```

The `miden-node.toml` can be modified adding a batch prover URL, to delegate the batch proving:

```toml
batch_prover_url = "<BATCH_PROVER_URL>"
```

If this variable is not set, the node will use a local batch prover.

### Monitoring and telemetry

Please see our operator documentation [here](docs/operator.md).
Expand Down
20 changes: 16 additions & 4 deletions bin/node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct NormalizedRpcConfig {
struct NormalizedBlockProducerConfig {
endpoint: Url,
verify_tx_proofs: bool,
batch_prover_url: Option<Url>,
}

impl Default for NormalizedRpcConfig {
Expand All @@ -44,9 +45,17 @@ impl Default for NormalizedRpcConfig {
impl Default for NormalizedBlockProducerConfig {
fn default() -> Self {
// Ensure we stay in sync with the original defaults.
let BlockProducerConfig { endpoint, store_url: _, verify_tx_proofs } =
BlockProducerConfig::default();
Self { endpoint, verify_tx_proofs }
let BlockProducerConfig {
endpoint,
store_url: _,
verify_tx_proofs,
batch_prover_url,
} = BlockProducerConfig::default();
Self {
endpoint,
verify_tx_proofs,
batch_prover_url,
}
}
}

Expand All @@ -58,6 +67,7 @@ impl NodeConfig {
endpoint: block_producer.endpoint,
store_url: store.endpoint.clone(),
verify_tx_proofs: block_producer.verify_tx_proofs,
batch_prover_url: block_producer.batch_prover_url,
};

let rpc = RpcConfig {
Expand Down Expand Up @@ -92,6 +102,7 @@ mod tests {
[block_producer]
endpoint = "http://127.0.0.1:8080"
verify_tx_proofs = true
batch_prover_url = "http://127.0.0.1:8081"
[rpc]
endpoint = "http://127.0.0.1:8080"
Expand All @@ -111,7 +122,8 @@ mod tests {
NodeConfig {
block_producer: NormalizedBlockProducerConfig {
endpoint: Url::parse("http://127.0.0.1:8080").unwrap(),
verify_tx_proofs: true
verify_tx_proofs: true,
batch_prover_url: Some(Url::parse("http://127.0.0.1:8081").unwrap()),
},
rpc: NormalizedRpcConfig {
endpoint: Url::parse("http://127.0.0.1:8080").unwrap(),
Expand Down
2 changes: 2 additions & 0 deletions config/miden-node.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ endpoint = "http://127.0.0.1:48046"
# enables or disables the verification of transaction proofs before they are accepted into the
# transaction queue.
verify_tx_proofs = true
# address of the remote batch prover service
batch_prover_url = "http://127.0.0.1:8082/"

[rpc]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-rpc', 1)) % 2**16
Expand Down
39 changes: 21 additions & 18 deletions crates/block-producer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@ workspace = true
tracing-forest = ["miden-node-utils/tracing-forest"]

[dependencies]
async-trait = { version = "0.1" }
futures = { version = "0.3" }
itertools = { workspace = true }
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-tx = { workspace = true }
async-trait = { version = "0.1" }
futures = { version = "0.3" }
itertools = { workspace = true }
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 = "next", features = [
"batch-prover",
] }
miden-tx = { workspace = true }
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 }
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "sync", "time"] }
tokio-stream = { workspace = true, features = ["net"] }
tonic = { workspace = true }
tracing = { workspace = true }
url = { workspace = true }
rand = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "sync", "time"] }
tokio-stream = { workspace = true, features = ["net"] }
tonic = { workspace = true }
tracing = { workspace = true }
url = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
Expand Down
Loading

0 comments on commit 7b80750

Please sign in to comment.