Skip to content

Commit 590852c

Browse files
authored
Allow Azks parallelism to be configurable (#457)
* Simplify append only proof parallelism * Introduce configurable parallelism * Prepare for 0.12.0-pre.11 release * Adopt review suggestions * Re-export parallelism structs at top-level for convenience
1 parent 0feee6e commit 590852c

File tree

20 files changed

+448
-217
lines changed

20 files changed

+448
-217
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.12.0-pre.11 (Nov 21, 2024)
4+
* Added parallelization for node preloads during audit proof generation
5+
* Removed `parallel_azks` feature in favor of explicit parallelism configuration object allowing the
6+
setting of static or dynamic parallelism across insertion and preloads
7+
38
## 0.12.0-pre.10 (Oct 17, 2024)
49
* Added parallelization for node preloads during insertion
510
* Added support for [tracing](https://docs.rs/tracing/latest/tracing/index.html)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Installation
2222
Add the following line to the dependencies of your `Cargo.toml`:
2323

2424
```
25-
akd = "0.12.0-pre.10"
25+
akd = "0.12.0-pre.11"
2626
```
2727

2828
### Minimum Supported Rust Version

akd/Cargo.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "akd"
3-
version = "0.12.0-pre.10"
3+
version = "0.12.0-pre.11"
44
authors = ["akd contributors"]
55
description = "An implementation of an auditable key directory"
66
license = "MIT OR Apache-2.0"
@@ -18,7 +18,6 @@ experimental = ["akd_core/experimental"]
1818
default = [
1919
"public_auditing",
2020
"parallel_vrf",
21-
"parallel_azks",
2221
"preload_history",
2322
"greedy_lookup_preload",
2423
"experimental",
@@ -28,8 +27,6 @@ bench = ["experimental", "public_tests", "tokio/rt-multi-thread"]
2827
# Greedy loading of lookup proof nodes
2928
greedy_lookup_preload = []
3029
public_auditing = ["dep:protobuf", "akd_core/protobuf"]
31-
# Parallelize node fetch and insertion during publish
32-
parallel_azks = []
3330
# Parallelize VRF calculations during publish
3431
parallel_vrf = ["akd_core/parallel_vrf"]
3532
# Enable pre-loading of the nodes when generating history proofs
@@ -56,7 +53,7 @@ tracing_instrument = ["tracing/attributes"]
5653

5754
[dependencies]
5855
## Required dependencies ##
59-
akd_core = { version = "0.12.0-pre.10", path = "../akd_core", default-features = false, features = [
56+
akd_core = { version = "0.12.0-pre.11", path = "../akd_core", default-features = false, features = [
6057
"vrf",
6158
] }
6259
async-recursion = "1"

akd/benches/azks.rs

+23-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate criterion;
1010

1111
mod common;
1212

13-
use akd::append_only_zks::InsertMode;
13+
use akd::append_only_zks::{AzksParallelismConfig, InsertMode};
1414
use akd::auditor;
1515
use akd::storage::manager::StorageManager;
1616
use akd::storage::memory::AsyncInMemoryDatabase;
@@ -57,6 +57,7 @@ fn batch_insertion<TC: NamedConfiguration>(c: &mut Criterion) {
5757
&db,
5858
initial_node_set.clone(),
5959
InsertMode::Directory,
60+
AzksParallelismConfig::default(),
6061
))
6162
.unwrap();
6263
(azks, db, node_set.clone())
@@ -67,6 +68,7 @@ fn batch_insertion<TC: NamedConfiguration>(c: &mut Criterion) {
6768
&db,
6869
node_set,
6970
InsertMode::Directory,
71+
AzksParallelismConfig::default(),
7072
))
7173
.unwrap();
7274
},
@@ -107,6 +109,7 @@ fn audit_verify<TC: NamedConfiguration>(c: &mut Criterion) {
107109
&db,
108110
initial_node_set.clone(),
109111
InsertMode::Directory,
112+
AzksParallelismConfig::default(),
110113
))
111114
.unwrap();
112115

@@ -118,12 +121,18 @@ fn audit_verify<TC: NamedConfiguration>(c: &mut Criterion) {
118121
&db,
119122
node_set.clone(),
120123
InsertMode::Directory,
124+
AzksParallelismConfig::default(),
121125
))
122126
.unwrap();
123127

124128
let end_hash = runtime.block_on(azks.get_root_hash::<TC, _>(&db)).unwrap();
125129
let proof = runtime
126-
.block_on(azks.get_append_only_proof::<TC, _>(&db, 1, 2))
130+
.block_on(azks.get_append_only_proof::<TC, _>(
131+
&db,
132+
1,
133+
2,
134+
AzksParallelismConfig::default(),
135+
))
127136
.unwrap();
128137

129138
(start_hash, end_hash, proof)
@@ -157,7 +166,12 @@ fn audit_generate<TC: NamedConfiguration>(c: &mut Criterion) {
157166
for _epoch in 0..num_epochs {
158167
let node_set = gen_nodes(&mut rng, num_leaves);
159168
runtime
160-
.block_on(azks.batch_insert_nodes::<TC, _>(&db, node_set, InsertMode::Directory))
169+
.block_on(azks.batch_insert_nodes::<TC, _>(
170+
&db,
171+
node_set,
172+
InsertMode::Directory,
173+
AzksParallelismConfig::default(),
174+
))
161175
.unwrap();
162176
}
163177
let epoch = azks.get_latest_epoch();
@@ -172,7 +186,12 @@ fn audit_generate<TC: NamedConfiguration>(c: &mut Criterion) {
172186
|| {},
173187
|_| {
174188
let _proof = runtime
175-
.block_on(azks.get_append_only_proof::<TC, _>(&db, epoch - 1, epoch))
189+
.block_on(azks.get_append_only_proof::<TC, _>(
190+
&db,
191+
epoch - 1,
192+
epoch,
193+
AzksParallelismConfig::default(),
194+
))
176195
.unwrap();
177196
},
178197
BatchSize::PerIteration,

akd/benches/directory.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extern crate criterion;
1010

1111
mod common;
1212

13+
use akd::append_only_zks::AzksParallelismConfig;
1314
use akd::ecvrf::HardCodedAkdVRF;
1415
use akd::storage::manager::StorageManager;
1516
use akd::storage::memory::AsyncInMemoryDatabase;
@@ -56,7 +57,9 @@ fn history_generation<TC: NamedConfiguration>(c: &mut Criterion) {
5657
);
5758
let db_clone = db.clone();
5859
let directory = runtime
59-
.block_on(async move { Directory::<TC, _, _>::new(db, vrf).await })
60+
.block_on(async move {
61+
Directory::<TC, _, _>::new(db, vrf, AzksParallelismConfig::default()).await
62+
})
6063
.unwrap();
6164

6265
for _epoch in 1..num_updates {

0 commit comments

Comments
 (0)