Skip to content

Commit 337719b

Browse files
authored
Analysis of simulations at tag leios-2025w11 (#241)
* Retesting simulations at tag `leios-2025w11` * Implemented analysis queries for rust simulator output * Comparative analysis of haskell and leios simulation results * Reran haskell with `treat-blocks-as-full: false` * Updated logbook with comparative analysis at tag `leios-2025w11`
1 parent 38bcd78 commit 337719b

29 files changed

+8007
-0
lines changed

Logbook.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Leios logbook
22

3+
## 2025-03-11
4+
5+
### Simulation comparison
6+
7+
The notebook [analysis/sims/2025w11/analysis.ipynb](analysis/sims/2025w11/analysis.ipynb) compares 90 scenarios of the Rust and Haskell simulations at tag [leios-2025w11](https://github.com/input-output-hk/ouroboros-leios/releases/tag/leios-2025w11). This is notable because recent fixes and adjustments to those simulations make it meaningful to compare them now and diagnose differences. Github issues will be created for any significant differences between the pairs of simulation results.
8+
39
## 2025-03-07
410

511
### Formal methods

analysis/sims/2025w11/ReadMe.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Workflow for running experiments
2+
3+
1. Copy Haskell executable to this folder.
4+
2. Edit [env.sh](env.sh) to set the MongoDB host and database names.
5+
3. Execute [run-experiment.sh](run-experiment.sh).
6+
4. Execute [run-queries.sh](run-queries.sh).
7+
5. Execute `nix run ..` to launch a Jupyter server.
8+
6. Run Jupyter notebook [analysis.ipynb](analysis.ipynb).

analysis/sims/2025w11/analysis.ipynb

+2,688
Large diffs are not rendered by default.
+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# yaml-language-server: $schema=./config.schema.json
2+
3+
################################################################################
4+
# Simulation Configuration File
5+
################################################################################
6+
#
7+
# This file contains the default configuration for running Leios simulations in
8+
# the Haskell simulation (`simulation/`) and the Rust simulation (`sim-rs/`).
9+
#
10+
################################################################################
11+
# Simulation Configuration
12+
################################################################################
13+
14+
relay-strategy: "request-from-first"
15+
tcp-congestion-control: true
16+
multiplex-mini-protocols: true
17+
simulate-transactions: false
18+
treat-blocks-as-full: false
19+
20+
################################################################################
21+
# Leios Protocol Configuration
22+
################################################################################
23+
24+
leios-stage-length-slots: 20
25+
leios-stage-active-voting-slots: 1
26+
leios-vote-send-recv-stages: false
27+
28+
################################################################################
29+
# Transaction Configuration
30+
################################################################################
31+
32+
tx-generation-distribution:
33+
distribution: exp
34+
lambda: 0.85
35+
scale: 1000.0
36+
tx-size-bytes-distribution:
37+
distribution: log-normal
38+
mu: 6.833
39+
sigma: 1.127
40+
tx-validation-cpu-time-ms: 1.5
41+
tx-max-size-bytes: 16384
42+
43+
################################################################################
44+
# Ranking Block Configuration
45+
################################################################################
46+
47+
# 1/leios-stage-length-slots, targeting one RB per pipeline.
48+
# Also 20s is current rate of praos blocks.
49+
rb-generation-probability: 5.0e-2
50+
# Eng. team targets 1kB as worst case upper bound.
51+
# Actual size fairly close.
52+
rb-head-size-bytes: 1024
53+
rb-body-max-size-bytes: 90112
54+
# Note: certificate generation/validation is not included in the
55+
# timings here, see cert-* fields.
56+
rb-generation-cpu-time-ms: 1.0
57+
rb-head-validation-cpu-time-ms: 1.0
58+
59+
# On average, no Txs directly embedded in blocks.
60+
rb-body-legacy-praos-payload-avg-size-bytes: 0
61+
rb-body-legacy-praos-payload-validation-cpu-time-ms-constant: 50.0
62+
# the -per-byte component is meant to be using size as a (bad)
63+
# proxy for the complexity of the Txs included.
64+
rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte: 0.0005
65+
66+
################################################################################
67+
# Input Block Configuration
68+
################################################################################
69+
70+
ib-generation-probability: 5.0
71+
ib-shards: 1
72+
73+
# ProducerId 32
74+
# SlotNo 64
75+
# VRF proof 80
76+
# Body hash 32
77+
# RB Ref 32
78+
# Signature 64
79+
# Total 304
80+
#
81+
# NOTE: using a KES Signature (like for Praos headers)
82+
# would instead more than double the total to 668.
83+
# And even 828 including Op Cert.
84+
ib-head-size-bytes: 304
85+
# 98KB to optimize for 3 TCP round trips
86+
ib-body-avg-size-bytes: 98304
87+
ib-body-max-size-bytes: 327680
88+
# Here we also use praos blocks as ballpark estimate.
89+
# Sec 2.3 Forging, of the benchmark cluster report, lists
90+
# * Slot start to announced: 0.12975s
91+
ib-generation-cpu-time-ms: 130.0
92+
ib-head-validation-cpu-time-ms: 1.0
93+
ib-body-validation-cpu-time-ms-constant: 50.0
94+
ib-body-validation-cpu-time-ms-per-byte: 0.0005
95+
ib-diffusion-strategy: "freshest-first"
96+
97+
# Haskell prototype relay mini-protocol parameters.
98+
ib-diffusion-max-bodies-to-request: 1
99+
ib-diffusion-max-headers-to-request: 100
100+
ib-diffusion-max-window-size: 100
101+
102+
################################################################################
103+
# Endorsement Block Configuration
104+
################################################################################
105+
106+
# We want one per pipeline, but not too many.
107+
eb-generation-probability: 1.5
108+
# ProducerId 32
109+
# SlotNo 64
110+
# VRF proof 80
111+
# Signature 64
112+
# Total 240
113+
#
114+
# See Note about signatures on ib-head-size-bytes.
115+
eb-size-bytes-constant: 240
116+
# IB hash
117+
eb-size-bytes-per-ib: 32
118+
# Collecting the IBs to reference and cryptography are the main tasks.
119+
# A comparable task is maybe mempool snapshotting.
120+
# Sec 2.3 Forging, of the benchmark cluster report, lists
121+
# * Mempool snapshotting: 0.07252s
122+
# 75ms then seems a generous estimate for eb generation.
123+
eb-generation-cpu-time-ms: 75.0
124+
# Validating signature and vrf proof, as in other headers.
125+
eb-validation-cpu-time-ms: 1.0
126+
127+
eb-diffusion-strategy: "peer-order"
128+
129+
# Haskell prototype relay mini-protocol parameters.
130+
eb-diffusion-max-bodies-to-request: 1
131+
eb-diffusion-max-headers-to-request: 100
132+
eb-diffusion-max-window-size: 100
133+
134+
################################################################################
135+
# Vote Configuration
136+
################################################################################
137+
138+
# Cryptography related values taken from [vote-spec](crypto-benchmarks.rs/Specification.md)
139+
# using weighted averages of 80% persistent and 20% non-persistent.
140+
141+
# vote-spec#Committe and quorum size
142+
#
143+
# Note: this is used as the expected amount of total weight of
144+
# generated votes in the sims.
145+
vote-generation-probability: 500.0
146+
# vote-spec#"Committe and quorum size"
147+
# 60% of `vote-generation-probability`
148+
vote-threshold: 300
149+
# vote-spec#"Generate vote" 0.8*135e-3 + 0.2*280e-3
150+
vote-generation-cpu-time-ms-constant: 164.0e-3
151+
# No benchmark yet.
152+
vote-generation-cpu-time-ms-per-ib: 0
153+
# vote-spec#"Verify vote" 0.8*670e-3 + 0.2*1.4
154+
vote-validation-cpu-time-ms: 816.0e-3
155+
# The `Vote` structure counted in the -per-eb already identifies slot
156+
# (in Eid) and voter. We can assume a vote bundle is all for the same
157+
# voter and slot, so for non-persistent voters we could factor their
158+
# PoolKeyHash (28bytes) here, but that is for 20% of cases.
159+
# More relevant if EB generation is very high.
160+
vote-bundle-size-bytes-constant: 0
161+
# vote-spec#Votes 0.8*90 + 0.2*164
162+
vote-bundle-size-bytes-per-eb: 105
163+
164+
vote-diffusion-strategy: "peer-order"
165+
166+
# Haskell prototype relay mini-protocol parameters.
167+
vote-diffusion-max-bodies-to-request: 1
168+
vote-diffusion-max-headers-to-request: 100
169+
vote-diffusion-max-window-size: 100
170+
171+
################################################################################
172+
# Certificate Configuration
173+
################################################################################
174+
175+
# vote-spec#"certificate bytes"
176+
cert-size-bytes-constant: 136
177+
# vote-spec#"certificate bytes" ((80/8) + 76 * (100 - 80))/100
178+
cert-size-bytes-per-node: 15
179+
180+
# For certificate timings we have bulk figures for realistic scenarios,
181+
# so we do not attempt to give -per-node (i.e. per-voter) timings.
182+
#
183+
# vote-spec#"Generate certificate"
184+
cert-generation-cpu-time-ms-constant: 90.0
185+
cert-generation-cpu-time-ms-per-node: 0
186+
# vote-spec#"Verify certificate"
187+
cert-validation-cpu-time-ms-constant: 130.0
188+
cert-validation-cpu-time-ms-per-node: 0
+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# yaml-language-server: $schema=./config.schema.json
2+
3+
################################################################################
4+
# Simulation Configuration File
5+
################################################################################
6+
#
7+
# This file contains the default configuration for running Leios simulations in
8+
# the Haskell simulation (`simulation/`) and the Rust simulation (`sim-rs/`).
9+
#
10+
################################################################################
11+
# Simulation Configuration
12+
################################################################################
13+
14+
relay-strategy: "request-from-first"
15+
tcp-congestion-control: true
16+
multiplex-mini-protocols: true
17+
simulate-transactions: false
18+
treat-blocks-as-full: false
19+
20+
################################################################################
21+
# Leios Protocol Configuration
22+
################################################################################
23+
24+
leios-stage-length-slots: 20
25+
leios-stage-active-voting-slots: 1
26+
leios-vote-send-recv-stages: false
27+
28+
################################################################################
29+
# Transaction Configuration
30+
################################################################################
31+
32+
tx-generation-distribution:
33+
distribution: exp
34+
lambda: 0.85
35+
scale: 1000.0
36+
tx-size-bytes-distribution:
37+
distribution: log-normal
38+
mu: 6.833
39+
sigma: 1.127
40+
tx-validation-cpu-time-ms: 1.5
41+
tx-max-size-bytes: 16384
42+
43+
################################################################################
44+
# Ranking Block Configuration
45+
################################################################################
46+
47+
# 1/leios-stage-length-slots, targeting one RB per pipeline.
48+
# Also 20s is current rate of praos blocks.
49+
rb-generation-probability: 5.0e-2
50+
# Eng. team targets 1kB as worst case upper bound.
51+
# Actual size fairly close.
52+
rb-head-size-bytes: 1024
53+
rb-body-max-size-bytes: 90112
54+
# Note: certificate generation/validation is not included in the
55+
# timings here, see cert-* fields.
56+
rb-generation-cpu-time-ms: 1.0
57+
rb-head-validation-cpu-time-ms: 1.0
58+
59+
# On average, no Txs directly embedded in blocks.
60+
rb-body-legacy-praos-payload-avg-size-bytes: 0
61+
rb-body-legacy-praos-payload-validation-cpu-time-ms-constant: 50.0
62+
# the -per-byte component is meant to be using size as a (bad)
63+
# proxy for the complexity of the Txs included.
64+
rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte: 0.0005
65+
66+
################################################################################
67+
# Input Block Configuration
68+
################################################################################
69+
70+
ib-generation-probability: 5.0
71+
ib-shards: 1
72+
73+
# ProducerId 32
74+
# SlotNo 64
75+
# VRF proof 80
76+
# Body hash 32
77+
# RB Ref 32
78+
# Signature 64
79+
# Total 304
80+
#
81+
# NOTE: using a KES Signature (like for Praos headers)
82+
# would instead more than double the total to 668.
83+
# And even 828 including Op Cert.
84+
ib-head-size-bytes: 304
85+
# 98KB to optimize for 3 TCP round trips
86+
ib-body-avg-size-bytes: 98304
87+
ib-body-max-size-bytes: 98304
88+
# Here we also use praos blocks as ballpark estimate.
89+
# Sec 2.3 Forging, of the benchmark cluster report, lists
90+
# * Slot start to announced: 0.12975s
91+
ib-generation-cpu-time-ms: 130.0
92+
ib-head-validation-cpu-time-ms: 1.0
93+
ib-body-validation-cpu-time-ms-constant: 50.0
94+
ib-body-validation-cpu-time-ms-per-byte: 0.0005
95+
ib-diffusion-strategy: "freshest-first"
96+
97+
# Haskell prototype relay mini-protocol parameters.
98+
ib-diffusion-max-bodies-to-request: 1
99+
ib-diffusion-max-headers-to-request: 100
100+
ib-diffusion-max-window-size: 100
101+
102+
################################################################################
103+
# Endorsement Block Configuration
104+
################################################################################
105+
106+
# We want one per pipeline, but not too many.
107+
eb-generation-probability: 1.5
108+
# ProducerId 32
109+
# SlotNo 64
110+
# VRF proof 80
111+
# Signature 64
112+
# Total 240
113+
#
114+
# See Note about signatures on ib-head-size-bytes.
115+
eb-size-bytes-constant: 240
116+
# IB hash
117+
eb-size-bytes-per-ib: 32
118+
# Collecting the IBs to reference and cryptography are the main tasks.
119+
# A comparable task is maybe mempool snapshotting.
120+
# Sec 2.3 Forging, of the benchmark cluster report, lists
121+
# * Mempool snapshotting: 0.07252s
122+
# 75ms then seems a generous estimate for eb generation.
123+
eb-generation-cpu-time-ms: 75.0
124+
# Validating signature and vrf proof, as in other headers.
125+
eb-validation-cpu-time-ms: 1.0
126+
127+
eb-diffusion-strategy: "peer-order"
128+
129+
# Haskell prototype relay mini-protocol parameters.
130+
eb-diffusion-max-bodies-to-request: 1
131+
eb-diffusion-max-headers-to-request: 100
132+
eb-diffusion-max-window-size: 100
133+
134+
################################################################################
135+
# Vote Configuration
136+
################################################################################
137+
138+
# Cryptography related values taken from [vote-spec](crypto-benchmarks.rs/Specification.md)
139+
# using weighted averages of 80% persistent and 20% non-persistent.
140+
141+
# vote-spec#Committe and quorum size
142+
#
143+
# Note: this is used as the expected amount of total weight of
144+
# generated votes in the sims.
145+
vote-generation-probability: 500.0
146+
# vote-spec#"Committe and quorum size"
147+
# 60% of `vote-generation-probability`
148+
vote-threshold: 300
149+
# vote-spec#"Generate vote" 0.8*135e-3 + 0.2*280e-3
150+
vote-generation-cpu-time-ms-constant: 164.0e-3
151+
# No benchmark yet.
152+
vote-generation-cpu-time-ms-per-ib: 0
153+
# vote-spec#"Verify vote" 0.8*670e-3 + 0.2*1.4
154+
vote-validation-cpu-time-ms: 816.0e-3
155+
# The `Vote` structure counted in the -per-eb already identifies slot
156+
# (in Eid) and voter. We can assume a vote bundle is all for the same
157+
# voter and slot, so for non-persistent voters we could factor their
158+
# PoolKeyHash (28bytes) here, but that is for 20% of cases.
159+
# More relevant if EB generation is very high.
160+
vote-bundle-size-bytes-constant: 0
161+
# vote-spec#Votes 0.8*90 + 0.2*164
162+
vote-bundle-size-bytes-per-eb: 105
163+
164+
vote-diffusion-strategy: "peer-order"
165+
166+
# Haskell prototype relay mini-protocol parameters.
167+
vote-diffusion-max-bodies-to-request: 1
168+
vote-diffusion-max-headers-to-request: 100
169+
vote-diffusion-max-window-size: 100
170+
171+
################################################################################
172+
# Certificate Configuration
173+
################################################################################
174+
175+
# vote-spec#"certificate bytes"
176+
cert-size-bytes-constant: 136
177+
# vote-spec#"certificate bytes" ((80/8) + 76 * (100 - 80))/100
178+
cert-size-bytes-per-node: 15
179+
180+
# For certificate timings we have bulk figures for realistic scenarios,
181+
# so we do not attempt to give -per-node (i.e. per-voter) timings.
182+
#
183+
# vote-spec#"Generate certificate"
184+
cert-generation-cpu-time-ms-constant: 90.0
185+
cert-generation-cpu-time-ms-per-node: 0
186+
# vote-spec#"Verify certificate"
187+
cert-validation-cpu-time-ms-constant: 130.0
188+
cert-validation-cpu-time-ms-per-node: 0

0 commit comments

Comments
 (0)