Skip to content

Commit 7c58bdd

Browse files
committed
Added quick run of no IBs and small transactions
1 parent fcc8b1e commit 7c58bdd

File tree

2 files changed

+267
-0
lines changed

2 files changed

+267
-0
lines changed
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
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: true
18+
treat-blocks-as-full: false
19+
cleanup-policies: ["cleanup-expired-vote"]
20+
timestamp-resolution-ms: 0.1
21+
22+
################################################################################
23+
# Leios Protocol Configuration
24+
################################################################################
25+
26+
leios-variant: full-without-ibs
27+
leios-stage-length-slots: 5
28+
leios-stage-active-voting-slots: 1
29+
leios-vote-send-recv-stages: false
30+
leios-late-ib-inclusion: true
31+
leios-header-diffusion-time-ms: 1000.0
32+
leios-mempool-sampling-strategy: ordered-by-id
33+
leios-mempool-aggressive-pruning: true
34+
# TODO: revise default
35+
praos-chain-quality: 100
36+
praos-fallback-enabled: false
37+
38+
################################################################################
39+
# Transaction Configuration
40+
################################################################################
41+
42+
tx-generation-distribution:
43+
distribution: exp
44+
lambda: 0.85
45+
scale: 1.20
46+
tx-size-bytes-distribution:
47+
distribution: constant
48+
value: 300
49+
tx-conflict-fraction: 0
50+
tx-overcollateralization-factor-distribution:
51+
distribution: constant
52+
value: 0
53+
tx-validation-cpu-time-ms: 0.065
54+
tx-max-size-bytes: 16384
55+
tx-start-time: 60
56+
tx-stop-time: 360
57+
58+
################################################################################
59+
# Ranking Block Configuration
60+
################################################################################
61+
62+
# 1/leios-stage-length-slots, targeting one RB per pipeline.
63+
# Also 20s is current rate of praos blocks.
64+
rb-generation-probability: 5.0e-2
65+
# Eng. team targets 1kB as worst case upper bound.
66+
# Actual size fairly close.
67+
rb-head-size-bytes: 1024
68+
rb-body-max-size-bytes: 90112
69+
# Note: certificate generation/validation is not included in the
70+
# timings here, see cert-* fields.
71+
rb-generation-cpu-time-ms: 1.0
72+
rb-head-validation-cpu-time-ms: 1.0
73+
74+
# On average, no Txs directly embedded in blocks.
75+
rb-body-legacy-praos-payload-avg-size-bytes: 0
76+
rb-body-legacy-praos-payload-validation-cpu-time-ms-constant: 50.0
77+
# the -per-byte component is meant to be using size as a (bad)
78+
# proxy for the complexity of the Txs included.
79+
rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte: 0.0005
80+
81+
################################################################################
82+
# Input Block Configuration
83+
################################################################################
84+
85+
ib-generation-probability: 2.0
86+
ib-shards: 1
87+
ib-shard-period-length-slots: 1
88+
ib-shard-group-count: 1
89+
90+
# ProducerId 32
91+
# SlotNo 64
92+
# VRF proof 80
93+
# Body hash 32
94+
# RB Ref 32
95+
# Signature 64
96+
# Total 304
97+
#
98+
# NOTE: using a KES Signature (like for Praos headers)
99+
# would instead more than double the total to 668.
100+
# And even 828 including Op Cert.
101+
ib-head-size-bytes: 304
102+
# 98KB to optimize for 3 TCP round trips
103+
ib-body-avg-size-bytes: 98304
104+
ib-body-max-size-bytes: 262144
105+
# Here we also use praos blocks as ballpark estimate.
106+
# Sec 2.3 Forging, of the benchmark cluster report, lists
107+
# * Slot start to announced: 0.12975s
108+
ib-generation-cpu-time-ms: 130.0
109+
ib-head-validation-cpu-time-ms: 1.0
110+
ib-body-validation-cpu-time-ms-constant: 50.0
111+
ib-body-validation-cpu-time-ms-per-byte: 0.0005
112+
ib-diffusion-strategy: "freshest-first"
113+
114+
# Haskell prototype relay mini-protocol parameters.
115+
ib-diffusion-max-bodies-to-request: 1
116+
ib-diffusion-max-headers-to-request: 100
117+
ib-diffusion-max-window-size: 100
118+
119+
################################################################################
120+
# Endorsement Block Configuration
121+
################################################################################
122+
123+
# We want one per pipeline, but not too many.
124+
eb-generation-probability: 2.5
125+
# ProducerId 32
126+
# SlotNo 64
127+
# VRF proof 80
128+
# Signature 64
129+
# Total 240
130+
#
131+
# See Note about signatures on ib-head-size-bytes.
132+
eb-size-bytes-constant: 240
133+
# IB hash
134+
eb-size-bytes-per-ib: 32
135+
# Collecting the IBs to reference and cryptography are the main tasks.
136+
# A comparable task is maybe mempool snapshotting.
137+
# Sec 2.3 Forging, of the benchmark cluster report, lists
138+
# * Mempool snapshotting: 0.07252s
139+
# 75ms then seems a generous estimate for eb generation.
140+
eb-generation-cpu-time-ms: 75.0
141+
# Validating signature and vrf proof, as in other headers.
142+
eb-validation-cpu-time-ms: 1.0
143+
144+
eb-diffusion-strategy: "peer-order"
145+
146+
# Haskell prototype relay mini-protocol parameters.
147+
eb-diffusion-max-bodies-to-request: 1
148+
eb-diffusion-max-headers-to-request: 100
149+
eb-diffusion-max-window-size: 100
150+
151+
# The maximum age of EBs included in RBs.
152+
# A an EB from slot `s` can only be included in RBs
153+
# up to slot `s+eb-max-age-slots`.
154+
# In short leios we expect votes to diffuse within 3 stages lengths of
155+
# EB generation, we allow for 2 more stage lengths to account for
156+
# variance in the interval within RBs.
157+
eb-max-age-slots: 240
158+
159+
# The maximum age of EBs to be relayed.
160+
# An EB from slot `s` will only be relayed
161+
# up to slot `s+eb-max-age-for-relay-slots`.
162+
eb-max-age-for-relay-slots: 40
163+
164+
# The maximum size of transactions (in bytes) which an EB can reference.
165+
# Only relevant when running with the "full-without-ibs" variant.
166+
eb-referenced-txs-max-size-bytes: 16384000
167+
168+
################################################################################
169+
# Vote Configuration
170+
################################################################################
171+
172+
# Cryptography related values taken from [vote-spec](crypto-benchmarks.rs/Specification.md)
173+
# using weighted averages of 80% persistent and 20% non-persistent.
174+
175+
# vote-spec#Committe and quorum size
176+
#
177+
# Note: this is used as the expected amount of total weight of
178+
# generated votes in the sims.
179+
vote-generation-probability: 500.0
180+
# vote-spec#"Committe and quorum size"
181+
# 60% of `vote-generation-probability`
182+
vote-threshold: 300
183+
# vote-spec#"Generate vote" 0.8*135e-3 + 0.2*280e-3
184+
vote-generation-cpu-time-ms-constant: 164.0e-3
185+
# No benchmark yet.
186+
vote-generation-cpu-time-ms-per-ib: 0
187+
# vote-spec#"Verify vote" 0.8*670e-3 + 0.2*1.4
188+
vote-validation-cpu-time-ms: 816.0e-3
189+
# The `Vote` structure counted in the -per-eb already identifies slot
190+
# (in Eid) and voter. We can assume a vote bundle is all for the same
191+
# voter and slot, so for non-persistent voters we could factor their
192+
# PoolKeyHash (28bytes) here, but that is for 20% of cases.
193+
# More relevant if EB generation is very high.
194+
vote-bundle-size-bytes-constant: 0
195+
# vote-spec#Votes 0.8*90 + 0.2*164
196+
vote-bundle-size-bytes-per-eb: 105
197+
198+
vote-diffusion-strategy: "peer-order"
199+
200+
# Haskell prototype relay mini-protocol parameters.
201+
vote-diffusion-max-bodies-to-request: 1
202+
vote-diffusion-max-headers-to-request: 100
203+
vote-diffusion-max-window-size: 100
204+
205+
################################################################################
206+
# Certificate Configuration
207+
################################################################################
208+
209+
# vote-spec - certificate size plot.
210+
# Realistic stake distributions need about 7 kilobytes for the certificate.
211+
cert-size-bytes-constant: 7168
212+
cert-size-bytes-per-node: 0
213+
214+
# For certificate timings we have bulk figures for realistic scenarios,
215+
# so we do not attempt to give -per-node (i.e. per-voter) timings.
216+
#
217+
# vote-spec#"Generate certificate"
218+
cert-generation-cpu-time-ms-constant: 90.0
219+
cert-generation-cpu-time-ms-per-node: 0
220+
# vote-spec#"Verify certificate"
221+
cert-validation-cpu-time-ms-constant: 130.0
222+
cert-validation-cpu-time-ms-per-node: 0

analysis/sims/2025w27/quick/run.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
cd "$(dirname "${BASH_SOURCE[0]}")"
6+
7+
BW=50
8+
9+
ulimit -S -m 64000000 -v 64000000
10+
11+
mkfifo sim.log
12+
13+
sed -e 's/"bandwidth-bytes-per-second":125000000/"bandwidth-bytes-per-second":'"$((125000 * BW))"'/g' \
14+
../../../../data/simulation/pseudo-mainnet/topology-v2.yaml \
15+
> network.yaml
16+
17+
function cleanup() {
18+
rm sim.log
19+
rm network.yaml
20+
}
21+
trap cleanup EXIT
22+
23+
grep -E -v '(Slot|No.*Generated|CpuTask|Lottery)' sim.log | pigz -p 3 -9c > sim.log.gz &
24+
25+
../sim-cli --parameters config.yaml network.yaml --slots 900 --conformance-events sim.log > stdout 2> stderr
26+
27+
wait
28+
29+
cat << EOI > case.csv
30+
Simulator,Variant,Sharding
31+
Rust,full-without-ibs,unsharded
32+
EOI
33+
34+
zcat sim.log.gz \
35+
| ../leios-trace-processor \
36+
+RTS -N5 -RTS \
37+
--trace-file /dev/stdin \
38+
--lifecycle-file lifecycle.csv \
39+
--cpu-file cpus.csv \
40+
--resource-file resources.csv \
41+
--receipt-file receipts.csv
42+
43+
pigz -p 3 -9f {lifecycle,cpus,resources,receipts}.csv
44+
45+
cat case.csv

0 commit comments

Comments
 (0)