Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use remote batch prover #701

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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
Loading