Skip to content

Commit 4d2f5a1

Browse files
Saizanwill-break-it
authored andcommitted
Update sizes and timings in default config (#193)
* config.default.yaml: updated default sizes. * config.default.yaml: updated default timings. * simulation: updated in-code defaults
1 parent 93d5b56 commit 4d2f5a1

File tree

2 files changed

+110
-42
lines changed

2 files changed

+110
-42
lines changed

data/simulation/config.default.yaml

Lines changed: 91 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,54 @@ tx-max-size-bytes: 16384
4242
# Ranking Block Configuration
4343
################################################################################
4444

45+
# 1/leios-stage-length-slots, targeting one RB per pipeline.
46+
# Also 20s is current rate of praos blocks.
4547
rb-generation-probability: 5.0e-2
46-
rb-generation-cpu-time-ms: 300.0
47-
rb-head-validation-cpu-time-ms: 1.0
48-
rb-head-size-bytes: 32
48+
# Eng. team targets 1kB as worst case upper bound.
49+
# Actual size fairly close.
50+
rb-head-size-bytes: 1024
4951
rb-body-max-size-bytes: 90112
52+
# Note: certificate generation/validation is not included in the
53+
# timings here, see cert-* fields.
54+
rb-generation-cpu-time-ms: 1.0
55+
rb-head-validation-cpu-time-ms: 1.0
5056

57+
# On average, no Txs directly embedded in blocks.
58+
rb-body-legacy-praos-payload-avg-size-bytes: 0
5159
rb-body-legacy-praos-payload-validation-cpu-time-ms-constant: 50.0
60+
# the -per-byte component is meant to be using size as a (bad)
61+
# proxy for the complexity of the Txs included.
5262
rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte: 0.0005
53-
rb-body-legacy-praos-payload-avg-size-bytes: 0
5463

5564
################################################################################
5665
# Input Block Configuration
5766
################################################################################
5867

5968
ib-generation-probability: 5.0
60-
ib-generation-cpu-time-ms: 300.0
6169
ib-shards: 1
62-
ib-head-size-bytes: 32
70+
71+
# ProducerId 32
72+
# SlotNo 64
73+
# VRF proof 80
74+
# Body hash 32
75+
# RB Ref 32
76+
# Signature 64
77+
# Total 304
78+
#
79+
# NOTE: using a KES Signature (like for Praos headers)
80+
# would instead more than double the total to 668.
81+
# And even 828 including Op Cert.
82+
ib-head-size-bytes: 304
83+
# 100kB, using praos max size as ballpark estimate.
84+
ib-body-avg-size-bytes: 102400
85+
ib-body-max-size-bytes: 327680
86+
# Here we also use praos blocks as ballpark estimate.
87+
# Sec 2.3 Forging, of the benchmark cluster report, lists
88+
# * Slot start to announced: 0.12975s
89+
ib-generation-cpu-time-ms: 130.0
6390
ib-head-validation-cpu-time-ms: 1.0
6491
ib-body-validation-cpu-time-ms-constant: 50.0
6592
ib-body-validation-cpu-time-ms-per-byte: 0.0005
66-
ib-body-max-size-bytes: 327680
67-
ib-body-avg-size-bytes: 327680
6893
ib-diffusion-strategy: "freshest-first"
6994

7095
# Haskell prototype relay mini-protocol parameters.
@@ -76,11 +101,27 @@ ib-diffusion-max-window-size: 100
76101
# Endorsement Block Configuration
77102
################################################################################
78103

79-
eb-generation-probability: 5.0
80-
eb-generation-cpu-time-ms: 300.0
81-
eb-validation-cpu-time-ms: 1.0
104+
# We want one per pipeline, but not too many.
105+
eb-generation-probability: 1.5
106+
# ProducerId 32
107+
# SlotNo 64
108+
# VRF proof 80
109+
# Signature 64
110+
# Total 240
111+
#
112+
# See Note about signatures on ib-head-size-bytes.
82113
eb-size-bytes-constant: 32
114+
# IB hash
83115
eb-size-bytes-per-ib: 32
116+
# Collecting the IBs to reference and cryptography are the main tasks.
117+
# A comparable task is maybe mempool snapshotting.
118+
# Sec 2.3 Forging, of the benchmark cluster report, lists
119+
# * Mempool snapshotting: 0.07252s
120+
# 75ms then seems a generous estimate for eb generation.
121+
eb-generation-cpu-time-ms: 75.0
122+
# Validating signature and vrf proof, as in other headers.
123+
eb-validation-cpu-time-ms: 1.0
124+
84125
eb-diffusion-strategy: "peer-order"
85126

86127
# Haskell prototype relay mini-protocol parameters.
@@ -92,13 +133,32 @@ eb-diffusion-max-window-size: 100
92133
# Vote Configuration
93134
################################################################################
94135

136+
# Cryptography related values taken from [vote-spec](crypto-benchmarks.rs/Specification.md)
137+
# using weighted averages of 80% persistent and 20% non-persistent.
138+
139+
# vote-spec#Committe and quorum size
140+
#
141+
# Note: this is used as the expected amount of total weight of
142+
# generated votes in the sims.
95143
vote-generation-probability: 500.0
96-
vote-generation-cpu-time-ms-constant: 1.0
97-
vote-generation-cpu-time-ms-per-ib: 1.0
98-
vote-validation-cpu-time-ms: 3.0
99-
vote-threshold: 150
100-
vote-bundle-size-bytes-constant: 32
101-
vote-bundle-size-bytes-per-eb: 32
144+
# vote-spec#"Committe and quorum size"
145+
# 60% of `vote-generation-probability`
146+
vote-threshold: 300
147+
# vote-spec#"Generate vote" 0.8*135e-3 + 0.2*280e-3
148+
vote-generation-cpu-time-ms-constant: 164e-3
149+
# No benchmark yet.
150+
vote-generation-cpu-time-ms-per-ib: 0
151+
# vote-spec#"Verify vote" 0.8*670e-3 + 0.2*1.4
152+
vote-validation-cpu-time-ms: 816e-3
153+
# The `Vote` structure counted in the -per-eb already identifies slot
154+
# (in Eid) and voter. We can assume a vote bundle is all for the same
155+
# voter and slot, so for non-persistent voters we could factor their
156+
# PoolKeyHash (28bytes) here, but that is for 20% of cases.
157+
# More relevant if EB generation is very high.
158+
vote-bundle-size-bytes-constant: 0
159+
# vote-spec#Votes 0.8*90 + 0.2*164
160+
vote-bundle-size-bytes-per-eb: 105
161+
102162
vote-diffusion-strategy: "peer-order"
103163

104164
# Haskell prototype relay mini-protocol parameters.
@@ -110,9 +170,17 @@ vote-diffusion-max-window-size: 100
110170
# Certificate Configuration
111171
################################################################################
112172

113-
cert-generation-cpu-time-ms-constant: 50.0
114-
cert-generation-cpu-time-ms-per-node: 1.0
115-
cert-validation-cpu-time-ms-constant: 50.0
116-
cert-validation-cpu-time-ms-per-node: 1.0
117-
cert-size-bytes-constant: 32
118-
cert-size-bytes-per-node: 32
173+
# vote-spec#"certificate bytes"
174+
cert-size-bytes-constant: 136
175+
# vote-spec#"certificate bytes" ((80/8) + 76 * (100 - 80))/100
176+
cert-size-bytes-per-node: 15
177+
178+
# For certificate timings we have bulk figures for realistic scenarios,
179+
# so we do not attempt to give -per-node (i.e. per-voter) timings.
180+
#
181+
# vote-spec#"Generate certificate"
182+
cert-generation-cpu-time-ms-constant: 90.0
183+
cert-generation-cpu-time-ms-per-node: 0
184+
# vote-spec#"Verify certificate"
185+
cert-validation-cpu-time-ms-constant: 130.0
186+
cert-validation-cpu-time-ms-per-node: 0

simulation/src/LeiosProtocol/Config.hs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,27 @@ instance Default Config where
132132
, txValidationCpuTimeMs = 1.5
133133
, txMaxSizeBytes = 16384
134134
, rbGenerationProbability = 5.0e-2
135-
, rbGenerationCpuTimeMs = 300.0
135+
, rbGenerationCpuTimeMs = 1.0
136136
, rbHeadValidationCpuTimeMs = 1.0
137-
, rbHeadSizeBytes = 32
137+
, rbHeadSizeBytes = 1024
138138
, rbBodyMaxSizeBytes = 90112
139139
, rbBodyLegacyPraosPayloadValidationCpuTimeMsConstant = 50.0
140140
, rbBodyLegacyPraosPayloadValidationCpuTimeMsPerByte = 0.0005
141141
, rbBodyLegacyPraosPayloadAvgSizeBytes = 0
142142
, ibGenerationProbability = 5
143-
, ibGenerationCpuTimeMs = 300.0
144-
, ibHeadSizeBytes = 32
143+
, ibGenerationCpuTimeMs = 130.0
144+
, ibHeadSizeBytes = 304
145145
, ibHeadValidationCpuTimeMs = 1.0
146146
, ibBodyValidationCpuTimeMsConstant = 50.0
147147
, ibBodyValidationCpuTimeMsPerByte = 0.0005
148148
, ibBodyMaxSizeBytes = 327680
149-
, ibBodyAvgSizeBytes = 327680
149+
, ibBodyAvgSizeBytes = 102400
150150
, ibDiffusionStrategy = FreshestFirst
151151
, ibDiffusionMaxWindowSize = 100
152152
, ibDiffusionMaxHeadersToRequest = 100
153153
, ibDiffusionMaxBodiesToRequest = 1
154-
, ebGenerationProbability = 5.0
155-
, ebGenerationCpuTimeMs = 300.0
154+
, ebGenerationProbability = 1.5
155+
, ebGenerationCpuTimeMs = 75.0
156156
, ebValidationCpuTimeMs = 1.0
157157
, ebSizeBytesConstant = 32
158158
, ebSizeBytesPerIb = 32
@@ -161,22 +161,22 @@ instance Default Config where
161161
, ebDiffusionMaxHeadersToRequest = 100
162162
, ebDiffusionMaxBodiesToRequest = 1
163163
, voteGenerationProbability = 500.0
164-
, voteGenerationCpuTimeMsConstant = 1.0
165-
, voteGenerationCpuTimeMsPerIb = 1.0
166-
, voteValidationCpuTimeMs = 3.0
167-
, voteThreshold = 150
168-
, voteBundleSizeBytesConstant = 32
169-
, voteBundleSizeBytesPerEb = 32
164+
, voteGenerationCpuTimeMsConstant = 0.164
165+
, voteGenerationCpuTimeMsPerIb = 0.0
166+
, voteValidationCpuTimeMs = 0.816
167+
, voteThreshold = 300
168+
, voteBundleSizeBytesConstant = 0
169+
, voteBundleSizeBytesPerEb = 105
170170
, voteDiffusionStrategy = PeerOrder
171171
, voteDiffusionMaxWindowSize = 100
172172
, voteDiffusionMaxHeadersToRequest = 100
173173
, voteDiffusionMaxBodiesToRequest = 1
174-
, certGenerationCpuTimeMsConstant = 50.0
175-
, certGenerationCpuTimeMsPerNode = 1.0
176-
, certValidationCpuTimeMsConstant = 50.0
177-
, certValidationCpuTimeMsPerNode = 1.0
178-
, certSizeBytesConstant = 32
179-
, certSizeBytesPerNode = 32
174+
, certGenerationCpuTimeMsConstant = 90.0
175+
, certGenerationCpuTimeMsPerNode = 0.0
176+
, certValidationCpuTimeMsConstant = 130.0
177+
, certValidationCpuTimeMsPerNode = 0.0
178+
, certSizeBytesConstant = 136
179+
, certSizeBytesPerNode = 15
180180
}
181181

182182
configToJSONWith :: Getter Config -> Config -> Value

0 commit comments

Comments
 (0)