Skip to content

Commit d6599b0

Browse files
authored
Merge branch 'main' into conformance-testing
2 parents 5d88406 + 87313b7 commit d6599b0

File tree

169 files changed

+34908
-13813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+34908
-13813
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "crypto-benchmarks-rs"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "crypto-benchmarks.rs/**"
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- "crypto-benchmarks.rs/**"
12+
13+
jobs:
14+
15+
crypto-benchmarks-rs-test:
16+
name: "Test"
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Test Rust packages
21+
working-directory: crypto-benchmarks.rs
22+
run: |
23+
cargo test
24+
if [ $? -ne 0 ]; then
25+
echo "Cargo test failed"
26+
exit 1
27+
fi
28+
29+
crypto-benchmarks-rs-benchmark:
30+
name: "Benchmark"
31+
runs-on: ubuntu-22.04
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Test Rust packages
35+
working-directory: crypto-benchmarks.rs
36+
run: |
37+
if ! cargo bench -- --noplot --sample-size 20 --quiet
38+
then
39+
echo "Cargo benchmarks failed"
40+
exit 1
41+
fi

.github/workflows/sim-rs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- uses: actions/checkout@v4
21+
- uses: actions-rust-lang/setup-rust-toolchain@v1
22+
with:
23+
toolchain: "1.84.1"
24+
cache-workspaces: sim-rs
2125
- name: Test Rust packages
2226
working-directory: sim-rs
2327
run: |

Logbook.md

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,140 @@
11
# Leios logbook
22

3+
## 2025-02-13
4+
5+
### Certificate CPU benchmarks as a function of number of voters
6+
7+
In support of the Haskell and Rust simulations, we've benchmarked certificate operations as a function of the number of voters. A realistic distribution of stake is used in these measurements.
8+
9+
| Number of pools | Number of committee seats | Generate certificate | Verify certificate | Weigh certificate |
10+
|----------------:|--------------------------:|---------------------:|-------------------:|------------------:|
11+
| 2500 | 500 | 63.4 ms | 104.8 ms | 10.6 ms |
12+
| 2500 | 600 | 71.1 ms | 116.9 ms | 12.0 ms |
13+
| 2500 | 700 | 77.4 ms | 125.5 ms | 12.3 ms |
14+
| 2500 | 800 | 83.5 ms | 134.4 ms | 12.8 ms |
15+
| 2500 | 900 | 88.2 ms | 141.1 ms | 12.4 ms |
16+
| 2500 | 1000 | 92.5 ms | 144.9 ms | 12.3 ms |
17+
18+
Serialization and deserialization likely also exhibit the same trend.
19+
20+
A recipe for parallelizing parts of the certificate operations has been added to the [Specification for BLS certificates](crypto-benchmarks.rs/Specification.md).
21+
22+
## 2025-02-12
23+
24+
### Added BLS crypto to CI
25+
26+
The CI job [crypto-benchmarks-rs](.github/workflows/crypto-benchmarks-rs.yaml) does the following:
27+
28+
- Runs the tests for the BLS reference implementation
29+
- Runs the BLS vote and certificate benchmarks
30+
31+
## 2025-02-11
32+
33+
### Reference implementation and benchmarking BLS certificates
34+
35+
The [BLS benchmarking Rust code for Leios](crypto-benchmarks.rs/) was overhauled and expanded with the following capabilities:
36+
37+
- Reference implementation of every aspect of a viable BLS certificate scheme for Leios.
38+
- Property-based tests providing basic coverage of all functionality.
39+
- Benchmarks for the inputs to the Leios and Haskell, Rust, and DeltaQ simulations.
40+
- CBOR serialization and deserialization of Leios messages.
41+
- Command-line interface (with example) for trying out Leios's cryptography: create and verity votes, certificates, etc.
42+
* Document specifying the algorithms and tabulating benchmark results.
43+
44+
Note that this BLS scheme is just one viable option for Leios. Ongoing work and ALBA, MUSEN, and SNARKs might result in schemes superior to this BLS approach. The key drawback is the need for periodic registration of ephemeral keys. Overall, this scheme provides the following:
45+
46+
- Certificates smaller than 10 kB.
47+
- Certificate generation and verification in 90 ms and 130 ms, respectively.
48+
- Votes smaller than 200 bytes.
49+
50+
## 2025-02-07
51+
52+
### Haskell simulation
53+
54+
- Added support for:
55+
- Send and Receive Voting stages, rather than just a single Vote stage.
56+
- See `leios-vote-send-recv-stages` config.
57+
- If used, should also set `leios-stage-active-voting-slots` to length of
58+
stage.
59+
- oldest-first diffusion strategy, and strategy configuration for EBs and
60+
votes.
61+
- See `ib-diffusion-strategy`, `eb-diffusion-strategy`, and
62+
`vote-diffusion-strategy`.
63+
- Added `data/simulation/small` scenario with config for 100 nodes with 2000kBs
64+
links.
65+
- The IB size and generation rate is tuned to utilize a third of 2000kBs, as
66+
Short-Leios targets.
67+
- One config file for single-stage and one for send-recv voting (also covering
68+
5 and 20 stage lengths).
69+
- Other size and timing parameters are mostly the defaults, which should be
70+
reviewed.
71+
- Used trace and metrics from `small` scenario to investigate simulation
72+
behaviour.
73+
- Added more details to block generation and `Sent` events.
74+
- Fixed block generation so own blocks are considered on-par with validated
75+
blocks a node received.
76+
- Made sure an EB cannot be included more than once in the base chain.
77+
- Confirmed trace shows EBs are regularly included in RBs that are generated
78+
more than 5s after votes start diffusing.
79+
- Main difference observed between single-stage and send-recv is the former
80+
shows a longer tail in the CPU usage CDF when simulation is run with unlimited
81+
cores.
82+
83+
### Reference implementation and benchmarking of Leios cryptography
84+
85+
The Rust benchmarks for Leios cryptography were redesigned and throroughly
86+
revised so that they are a reference implementation for a viable realization of
87+
Leios.
88+
89+
- Implemented the Fait Accompli sortition
90+
- Sortition now uses rational arithmetic instead of quad-precision floats, and
91+
is independent of machine precision
92+
- Quickcheck tests for all capabilities
93+
- Benchmarks for serialization
94+
- Squeezed more bytes out of the votes and certificate
95+
96+
The package still needs documentation and a few more benchmarks.
97+
98+
### Formal Methods
99+
100+
- Initial conformance testing is setup using quickcheck-dynamic with the
101+
executable spec of Short Leios as model. Next steps are conformance testing
102+
the Leios simulators
103+
- Performance improvements of the proofs in the executable spec module
104+
105+
### Refresh of throughput simulator
106+
107+
The
108+
[Cardano througput simulatior](https://www.insightmaker.com/insight/4DU4kmFVCFDaq30ux29PCe/Cardano-Throughput-v0-3)
109+
has been updated with the latest cloud-computing cost model, synchronized with
110+
the assumptions in the
111+
[online Leios cost calculator](https://leios.cardano-scaling.org/cost-estimator/).
112+
113+
### Rust simulation
114+
115+
- Minor fixes to new graph generation strategy
116+
- Planned out a roadmap for visualization work; next steps will be to show more
117+
about the lifecycle of Leios transactions
118+
119+
## 2025-02-06
120+
121+
### Enhancements to online cost calculator
122+
123+
In response to queries and suggestions, the
124+
[online Leios cost calculator](https://leios.cardano-scaling.org/cost-estimator/)
125+
has been enhanced:
126+
127+
- Users can select costs for either hyperscale providers (like AWS, Azure, and
128+
GCP) or discount providers (Hetzner, OVH Cloud, etc.).
129+
- Costs default to that of a discount provider.
130+
- Users can optionally amortize ledger storage costs perpetually vs compute a
131+
first-month snapshot of storage costs.
132+
- Deployments default to a single relay instead of two.
133+
- The disk compression default was reduced to a conservative 50%.
134+
3135
## 2025-01-31
4136

5-
## Formal Methods
137+
### Formal Methods
6138

7139
- Finalizing executable specifications for Simplified and Short Leios
8140
- Short Leios spec extracted to Haskell for conformance testing

0 commit comments

Comments
 (0)