Skip to content

Commit 6662172

Browse files
authored
Run Praos experiment for hypotheses of PNSol Leios experiment (#585)
* Designed praos analogs of leios pnsol experiments * Executed simulations for experiment * Analyzed results * Generated plots * Updated logbook * Updated technical report
1 parent 5136bfa commit 6662172

Some content is hidden

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

70 files changed

+3814
-0
lines changed

Logbook.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ The experiment in [analysis/sims/pnsol/](analysis/sims/pnsol/) tests several hyp
2424
|---|---|
2525
| ![The CPU cost of processing per transaction either remains the same or goes down as the load goes up.](analysis/sims/pnsol/plots/load-cpu.svg) | ![The network cost of processing per transaction either remains the same or goes down as the load goes up.](analysis/sims/pnsol/plots/load-egress.svg) |
2626

27+
### Experiment to test hypotheses about Praos performance
28+
29+
The experiment in [analysis/sims/pnsol-praos/](analysis/sims/pnsol-praos/) repeats the [analysis/sims/pnsol/](analysis/sims/pnsol/) experiment, but for Praos.
30+
31+
| | | | | |
32+
|---|---|---|---|---|
33+
| ![Praos throughput is proportional to load until it plateaus when capacity is reached.](analysis/sims/pnsol/plots/load-throughput.svg) | ![The variability of delivery times plateaus until capacity is reached.](analysis/sims/pnsol/plots/load-txvariance.svg) | ![Relative to Praos, Praos incurs a delay for transactions reaching the ledger.](analysis/sims/pnsol/plots/load-delay.svg) | ![The CPU cost of processing per transaction either remains the same or goes down as the load goes up.](analysis/sims/pnsol/plots/load-cpu.svg) | ![The network cost of processing per transaction either remains the same or goes down as the load goes up.](analysis/sims/pnsol/plots/load-egress.svg) |
34+
2735
## 2025-10-13
2836

2937
### Regenerated CIP figures

analysis/sims/pnsol-praos/analysis.ipynb

Lines changed: 651 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p gnused gzip pigz "rWrapper.override { packages = with rPackages; [ data_table R_utils bit64 ggplot2 magrittr stringr ]; }"
3+
4+
set -e
5+
6+
mkdir -p results/$d
7+
for f in lifecycle certified generated resources sizes cpus receipts
8+
do
9+
DIR=$(find experiments -type f -name $f.csv.gz \( -not -empty \) -printf %h\\n -quit)
10+
HL=$(sed -n -e '1p' "$DIR/case.csv")
11+
HR=$(zcat "$DIR/$f.csv.gz" | sed -n -e '1p')
12+
if [[ "$f" == "lifecycle" || "$f" == "resources" || "$f" == "sizes" || "$f" == "certified" || "$f" == "generated" ]]
13+
then
14+
FRACT=1.00
15+
else
16+
FRACT=0.10
17+
fi
18+
(
19+
echo "$HL,$HR"
20+
for g in $(find experiments -type f -name $f.csv.gz \( -not -empty \) -printf %h\\n)
21+
do
22+
if [ ! -e "$g/stderr" ]
23+
then
24+
echo "Skipping $g because it has no stderr." >> /dev/stderr
25+
elif [ -s "$g/stderr" ]
26+
then
27+
echo "Skipping $g because its stderr is not empty." >> /dev/stderr
28+
else
29+
BL=$(sed -n -e '2p' "$g/case.csv")
30+
zcat "$g/$f.csv.gz" | gawk 'FNR > 1 && rand() <= '"$FRACT"' { print "'"$BL"'" "," $0}'
31+
fi
32+
done
33+
) | pigz -p 3 -9c > results/$f.csv.gz
34+
R --vanilla << EOI > /dev/null
35+
require(data.table)
36+
sampleSize <- $FRACT
37+
print(sampleSize)
38+
$f <- fread("results/$f.csv.gz", stringsAsFactors=TRUE)
39+
save($f, sampleSize, file="results/$f.Rdata", compression_level=9)
40+
EOI
41+
done
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
experiments/NA,0.001/run.sh
2+
experiments/NA,0.002/run.sh
3+
experiments/NA,0.003/run.sh
4+
experiments/NA,0.004/run.sh
5+
experiments/NA,0.005/run.sh
6+
experiments/NA,0.010/run.sh
7+
experiments/NA,0.025/run.sh
8+
experiments/NA,0.050/run.sh
9+
experiments/NA,0.075/run.sh
10+
experiments/NA,0.100/run.sh
11+
experiments/NA,0.125/run.sh
12+
experiments/NA,0.150/run.sh
13+
experiments/NA,0.175/run.sh
14+
experiments/NA,0.200/run.sh
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Network,Bandwidth,CPU,Diffusion duration,Voting duration,Max EB size,Tx size,Throughput,Plutus,Tx start [s],Tx stop [s],Sim stop [s]
2+
topology-v2,10 Mb/s,4 vCPU/node,L_diff = 1200 slots,L_vote = 1200 slots,0 MB/EB,1500 B/Tx,0.001 TxMB/s,,0,1200,1200
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"timestamp-resolution-ms": 0.1,
3+
"simulate-transactions": true,
4+
"cleanup-policies": [
5+
"cleanup-expired-vote"
6+
],
7+
"leios-variant": "linear-with-tx-references",
8+
"linear-eb-propagation-criteria": "eb-received",
9+
"linear-vote-stage-length-slots": 1200,
10+
"linear-diffuse-stage-length-slots": 1200,
11+
"praos-fallback-enabled": true,
12+
"leios-stage-active-voting-slots": 1,
13+
"leios-mempool-sampling-strategy": "ordered-by-id",
14+
"relay-strategy": "request-from-first",
15+
"treat-blocks-as-full": false,
16+
"eb-diffusion-strategy": "peer-order",
17+
"eb-referenced-txs-max-size-bytes": 0,
18+
"eb-size-bytes-constant": 240,
19+
"eb-size-bytes-per-ib": 32,
20+
"leios-header-diffusion-time-ms": 1000.0,
21+
"tx-start-time": 0,
22+
"tx-stop-time": 1200,
23+
"tx-generation-distribution": {
24+
"distribution": "constant",
25+
"value": 1500.000
26+
},
27+
"tx-size-bytes-distribution": {
28+
"distribution": "constant",
29+
"value": 1500
30+
},
31+
"tx-conflict-fraction": 0,
32+
"tx-overcollateralization-factor-distribution": {
33+
"distribution": "constant",
34+
"value": 0
35+
},
36+
"tx-validation-cpu-time-ms": 0.6201,
37+
"tx-max-size-bytes": 16384,
38+
"rb-generation-probability": 0.05,
39+
"rb-head-size-bytes": 1024,
40+
"rb-body-max-size-bytes": 90112,
41+
"rb-generation-cpu-time-ms": 71.02,
42+
"rb-head-validation-cpu-time-ms": 0.4438,
43+
"eb-header-validation-cpu-time-ms": 0.4438,
44+
"rb-body-legacy-praos-payload-validation-cpu-time-ms-constant": 0.3539,
45+
"rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte": 0.00002151,
46+
"eb-body-validation-cpu-time-ms-constant": 0.3539,
47+
"eb-body-validation-cpu-time-ms-per-byte": 0.00002151,
48+
"vote-generation-probability": 1,
49+
"vote-threshold": 1000,
50+
"vote-bundle-size-bytes-constant": 0,
51+
"vote-bundle-size-bytes-per-eb": 164,
52+
"vote-generation-cpu-time-ms-constant": 0.28,
53+
"vote-generation-cpu-time-ms-per-tx": 0,
54+
"vote-validation-cpu-time-ms": 2.9,
55+
"vote-diffusion-strategy": "peer-order",
56+
"vote-diffusion-max-bodies-to-request": 1,
57+
"vote-diffusion-max-headers-to-request": 100,
58+
"vote-diffusion-max-window-size": 100,
59+
"cert-size-bytes-constant": 8000,
60+
"cert-size-bytes-per-node": 0,
61+
"cert-generation-cpu-time-ms-constant": 92.5,
62+
"cert-generation-cpu-time-ms-per-node": 0,
63+
"cert-validation-cpu-time-ms-constant": 157.2,
64+
"cert-validation-cpu-time-ms-per-node": 0,
65+
"leios-stage-length-slots": 1200,
66+
"eb-body-avg-size-bytes": 0
67+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../run.sh
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
INFO praos: sim_cli::events: 800 transactions(s) were generated in total.
2+
INFO praos: sim_cli::events: 70 naive praos block(s) were published.
3+
INFO praos: sim_cli::events: 1130 slot(s) had no naive praos blocks.
4+
INFO praos: sim_cli::events: 793 transaction(s) (1.19 MB) finalized in a naive praos block.
5+
INFO praos: sim_cli::events: 7 transaction(s) (10.50 kB) did not reach a naive praos block.
6+
INFO praos: sim_cli::events: Pool 35 published 1 naive praos block(s)
7+
INFO praos: sim_cli::events: Pool 42 published 1 naive praos block(s)
8+
INFO praos: sim_cli::events: Pool 44 published 1 naive praos block(s)
9+
INFO praos: sim_cli::events: Pool 51 published 1 naive praos block(s)
10+
INFO praos: sim_cli::events: Pool 53 published 1 naive praos block(s)
11+
INFO praos: sim_cli::events: Pool 55 published 1 naive praos block(s)
12+
INFO praos: sim_cli::events: Pool 60 published 1 naive praos block(s)
13+
INFO praos: sim_cli::events: Pool 61 published 1 naive praos block(s)
14+
INFO praos: sim_cli::events: Pool 62 published 1 naive praos block(s)
15+
INFO praos: sim_cli::events: Pool 77 published 1 naive praos block(s)
16+
INFO praos: sim_cli::events: Pool 79 published 1 naive praos block(s)
17+
INFO praos: sim_cli::events: Pool 87 published 1 naive praos block(s)
18+
INFO praos: sim_cli::events: Pool 90 published 1 naive praos block(s)
19+
INFO praos: sim_cli::events: Pool 96 published 1 naive praos block(s)
20+
INFO praos: sim_cli::events: Pool 104 published 1 naive praos block(s)
21+
INFO praos: sim_cli::events: Pool 108 published 1 naive praos block(s)
22+
INFO praos: sim_cli::events: Pool 119 published 1 naive praos block(s)
23+
INFO praos: sim_cli::events: Pool 121 published 2 naive praos block(s)
24+
INFO praos: sim_cli::events: Pool 123 published 1 naive praos block(s)
25+
INFO praos: sim_cli::events: Pool 126 published 1 naive praos block(s)
26+
INFO praos: sim_cli::events: Pool 130 published 1 naive praos block(s)
27+
INFO praos: sim_cli::events: Pool 134 published 1 naive praos block(s)
28+
INFO praos: sim_cli::events: Pool 136 published 1 naive praos block(s)
29+
INFO praos: sim_cli::events: Pool 138 published 2 naive praos block(s)
30+
INFO praos: sim_cli::events: Pool 139 published 2 naive praos block(s)
31+
INFO praos: sim_cli::events: Pool 352 published 1 naive praos block(s)
32+
INFO praos: sim_cli::events: Pool 353 published 1 naive praos block(s)
33+
INFO praos: sim_cli::events: Pool 363 published 1 naive praos block(s)
34+
INFO praos: sim_cli::events: Pool 365 published 2 naive praos block(s)
35+
INFO praos: sim_cli::events: Pool 370 published 1 naive praos block(s)
36+
INFO praos: sim_cli::events: Pool 372 published 1 naive praos block(s)
37+
INFO praos: sim_cli::events: Pool 376 published 1 naive praos block(s)
38+
INFO praos: sim_cli::events: Pool 418 published 1 naive praos block(s)
39+
INFO praos: sim_cli::events: Pool 423 published 2 naive praos block(s)
40+
INFO praos: sim_cli::events: Pool 429 published 1 naive praos block(s)
41+
INFO praos: sim_cli::events: Pool 430 published 1 naive praos block(s)
42+
INFO praos: sim_cli::events: Pool 439 published 1 naive praos block(s)
43+
INFO praos: sim_cli::events: Pool 444 published 1 naive praos block(s)
44+
INFO praos: sim_cli::events: Pool 474 published 1 naive praos block(s)
45+
INFO praos: sim_cli::events: Pool 475 published 1 naive praos block(s)
46+
INFO praos: sim_cli::events: Pool 508 published 1 naive praos block(s)
47+
INFO praos: sim_cli::events: Pool 509 published 1 naive praos block(s)
48+
INFO praos: sim_cli::events: Pool 510 published 1 naive praos block(s)
49+
INFO praos: sim_cli::events: Pool 514 published 1 naive praos block(s)
50+
INFO praos: sim_cli::events: Pool 515 published 1 naive praos block(s)
51+
INFO praos: sim_cli::events: Pool 516 published 1 naive praos block(s)
52+
INFO praos: sim_cli::events: Pool 520 published 1 naive praos block(s)
53+
INFO praos: sim_cli::events: Pool 522 published 1 naive praos block(s)
54+
INFO praos: sim_cli::events: Pool 525 published 1 naive praos block(s)
55+
INFO praos: sim_cli::events: Pool 527 published 1 naive praos block(s)
56+
INFO praos: sim_cli::events: Pool 532 published 1 naive praos block(s)
57+
INFO praos: sim_cli::events: Pool 533 published 1 naive praos block(s)
58+
INFO praos: sim_cli::events: Pool 535 published 2 naive praos block(s)
59+
INFO praos: sim_cli::events: Pool 536 published 1 naive praos block(s)
60+
INFO praos: sim_cli::events: Pool 537 published 1 naive praos block(s)
61+
INFO praos: sim_cli::events: Pool 544 published 1 naive praos block(s)
62+
INFO praos: sim_cli::events: Pool 545 published 1 naive praos block(s)
63+
INFO praos: sim_cli::events: Pool 546 published 2 naive praos block(s)
64+
INFO praos: sim_cli::events: Pool 556 published 1 naive praos block(s)
65+
INFO praos: sim_cli::events: Pool 557 published 1 naive praos block(s)
66+
INFO praos: sim_cli::events: Pool 560 published 1 naive praos block(s)
67+
INFO praos: sim_cli::events: Pool 745 published 1 naive praos block(s)
68+
INFO praos: sim_cli::events: Pool 747 published 1 naive praos block(s)
69+
INFO leios: sim_cli::events: 0 IB(s) were generated, on average 0.000 IB(s) per slot.
70+
INFO leios: sim_cli::events: 0 out of 800 transaction(s) were included in at least one IB.
71+
INFO leios: sim_cli::events: The average age of the pending transactions is 5.994s (stddev 3.001).
72+
INFO leios: sim_cli::events: Each transaction was included in an average of NaN IB(s) (stddev NaN).
73+
INFO leios: sim_cli::events: Each IB contained an average of NaN transaction(s) (stddev NaN) and an average of 0 B (stddev 0 B). 0 IB(s) were empty.
74+
INFO leios: sim_cli::events: Each node received an average of 0.000 IB(s) (stddev 0.000).
75+
INFO leios: sim_cli::events: 0 EB(s) were generated; on average there were 0.000 EB(s) per slot.
76+
INFO leios: sim_cli::events: Each EB contained an average of NaN transaction(s) (stddev NaN). 0 EB(s) were empty.
77+
INFO leios: sim_cli::events: Each EB contained an average of NaN IB(s) (stddev NaN). 0 EB(s) were empty.
78+
INFO leios: sim_cli::events: Each IB was included in an average of NaN EB(s) (stddev NaN).
79+
INFO leios: sim_cli::events: 0 out of 0 IBs were included in at least one EB.
80+
INFO leios: sim_cli::events: 0 out of 0 IBs expired before they reached an EB.
81+
INFO leios: sim_cli::events: 0 out of 0 EBs expired before an EB from their stage reached an RB.
82+
INFO leios: sim_cli::events: 0 out of 800 transaction(s) were included in at least one EB.
83+
INFO leios: sim_cli::events: 0 total votes were generated.
84+
INFO leios: sim_cli::events: Each stake pool produced an average of 0.000 vote(s) (stddev 0.000).
85+
INFO leios: sim_cli::events: Each EB received an average of NaN vote(s) (stddev NaN).
86+
INFO leios: sim_cli::events: There were 0 bundle(s) of votes. Each bundle contained NaN vote(s) (stddev NaN).
87+
INFO leios: sim_cli::events: 0 L1 block(s) had a Leios endorsement.
88+
INFO leios: sim_cli::events: 0 tx(s) (0 B) were referenced by a Leios endorsement.
89+
INFO leios: sim_cli::events: 793 tx(s) (1.19 MB) were included directly in a Praos block.
90+
INFO leios: sim_cli::events: Spatial efficiency: 0 B/0 B (NaN%) of Leios bytes were unique transactions.
91+
INFO leios: sim_cli::events: 0 tx(s) (NaN%) referenced by a Leios endorsement were redundant.
92+
INFO leios: sim_cli::events: Each transaction took an average of NaNs (stddev NaN) to be included in an IB.
93+
INFO leios: sim_cli::events: Each transaction took an average of NaNs (stddev NaN) to be included in an EB.
94+
INFO leios: sim_cli::events: Each transaction took an average of 16.478s (stddev 15.485) to be included in a block.
95+
INFO network: sim_cli::events: 599200 TX message(s) were sent. 599200 of them were received (100.000%).
96+
INFO network: sim_cli::events: 0 IB message(s) were sent. 0 of them were received (NaN%).
97+
INFO network: sim_cli::events: 0 EB message(s) were sent. 0 of them were received (NaN%).
98+
INFO network: sim_cli::events: 0 Vote message(s) were sent. 0 of them were received (NaN%).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Network,Bandwidth,CPU,Diffusion duration,Voting duration,Max EB size,Tx size,Throughput,Plutus,Tx start [s],Tx stop [s],Sim stop [s]
2+
topology-v2,10 Mb/s,4 vCPU/node,L_diff = 1200 slots,L_vote = 1200 slots,0 MB/EB,1500 B/Tx,0.002 TxMB/s,,0,1200,1200
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"timestamp-resolution-ms": 0.1,
3+
"simulate-transactions": true,
4+
"cleanup-policies": [
5+
"cleanup-expired-vote"
6+
],
7+
"leios-variant": "linear-with-tx-references",
8+
"linear-eb-propagation-criteria": "eb-received",
9+
"linear-vote-stage-length-slots": 1200,
10+
"linear-diffuse-stage-length-slots": 1200,
11+
"praos-fallback-enabled": true,
12+
"leios-stage-active-voting-slots": 1,
13+
"leios-mempool-sampling-strategy": "ordered-by-id",
14+
"relay-strategy": "request-from-first",
15+
"treat-blocks-as-full": false,
16+
"eb-diffusion-strategy": "peer-order",
17+
"eb-referenced-txs-max-size-bytes": 0,
18+
"eb-size-bytes-constant": 240,
19+
"eb-size-bytes-per-ib": 32,
20+
"leios-header-diffusion-time-ms": 1000.0,
21+
"tx-start-time": 0,
22+
"tx-stop-time": 1200,
23+
"tx-generation-distribution": {
24+
"distribution": "constant",
25+
"value": 750.000
26+
},
27+
"tx-size-bytes-distribution": {
28+
"distribution": "constant",
29+
"value": 1500
30+
},
31+
"tx-conflict-fraction": 0,
32+
"tx-overcollateralization-factor-distribution": {
33+
"distribution": "constant",
34+
"value": 0
35+
},
36+
"tx-validation-cpu-time-ms": 0.6201,
37+
"tx-max-size-bytes": 16384,
38+
"rb-generation-probability": 0.05,
39+
"rb-head-size-bytes": 1024,
40+
"rb-body-max-size-bytes": 90112,
41+
"rb-generation-cpu-time-ms": 71.02,
42+
"rb-head-validation-cpu-time-ms": 0.4438,
43+
"eb-header-validation-cpu-time-ms": 0.4438,
44+
"rb-body-legacy-praos-payload-validation-cpu-time-ms-constant": 0.3539,
45+
"rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte": 0.00002151,
46+
"eb-body-validation-cpu-time-ms-constant": 0.3539,
47+
"eb-body-validation-cpu-time-ms-per-byte": 0.00002151,
48+
"vote-generation-probability": 1,
49+
"vote-threshold": 1000,
50+
"vote-bundle-size-bytes-constant": 0,
51+
"vote-bundle-size-bytes-per-eb": 164,
52+
"vote-generation-cpu-time-ms-constant": 0.28,
53+
"vote-generation-cpu-time-ms-per-tx": 0,
54+
"vote-validation-cpu-time-ms": 2.9,
55+
"vote-diffusion-strategy": "peer-order",
56+
"vote-diffusion-max-bodies-to-request": 1,
57+
"vote-diffusion-max-headers-to-request": 100,
58+
"vote-diffusion-max-window-size": 100,
59+
"cert-size-bytes-constant": 8000,
60+
"cert-size-bytes-per-node": 0,
61+
"cert-generation-cpu-time-ms-constant": 92.5,
62+
"cert-generation-cpu-time-ms-per-node": 0,
63+
"cert-validation-cpu-time-ms-constant": 157.2,
64+
"cert-validation-cpu-time-ms-per-node": 0,
65+
"leios-stage-length-slots": 1200,
66+
"eb-body-avg-size-bytes": 0
67+
}

0 commit comments

Comments
 (0)