Skip to content

Commit 1999072

Browse files
bwbushBrian W Bush
andauthored
Rerun of attack simulations (#515)
* Designed repeat of attack experiment * Completed analysis and generated figures * Updated logbook --------- Co-authored-by: Brian W Bush <[email protected]>
1 parent a404588 commit 1999072

40 files changed

+5848
-3
lines changed

Logbook.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Leios logbook
22

3+
## 2025-08-23
4+
5+
### Re-ran late-release attack experiment
6+
7+
The [late-release attack experiment](analysis/sims/attack) was rerun with the latest version of the Rust simulation. The findings remain unchanged.
8+
9+
### Re-ran simulation experiment for CIP figures
10+
11+
The [simulation experiment for the CIP figures](analysis/sims/cip/) was rerun with the latest version of the Rust simulation, and several improvements were made:
12+
13+
- Semi-optimal settings for protocol parameters
14+
- Improved assumptions for validation costs
15+
- Explored effects of increased Plutus execution steps
16+
317
## 2025-08-22
418

519
### Analysis for regressions in Rust simulator
@@ -35,9 +49,9 @@ Findings:
3549

3650
Artifacts:
3751

38-
- [Slides](analysis/simms/2025w33b/ReadMe.pdf)
39-
- [Notebook](analysis/simms/2025w33b/analysis.ipynb)
40-
- [Configurations](analysis/simms/2025w33b/experiments/)
52+
- [Slides](analysis/sims/2025w33b/ReadMe.pdf)
53+
- [Notebook](analysis/sims/2025w33b/analysis.ipynb)
54+
- [Configurations](analysis/sims/2025w33b/experiments/)
4155

4256
### Rust simulation
4357

analysis/sims/attack/ReadMe.pdf

2.79 MB
Binary file not shown.

analysis/sims/attack/analysis.ipynb

Lines changed: 3733 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 resources receipts cpus sizes
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" ]]
13+
then
14+
FRACT=1.00
15+
else
16+
FRACT=0.15
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
experiments/0.0,0/run.sh
2+
experiments/0.0,1/run.sh
3+
experiments/6.5,0/run.sh
4+
experiments/6.5,1/run.sh
5+
experiments/7.0,0/run.sh
6+
experiments/7.0,1/run.sh
7+
experiments/7.5,0/run.sh
8+
experiments/7.5,1/run.sh
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Adversary,EB delay,Tx attack,Tx size,Throughput,Tx start [s],Tx stop [s],Sim stop [s]
2+
33% adversary,EB attack: none,Tx attack: none,1500 B/Tx,0.150 TxMB/s,60,660,900
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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": 7,
10+
"linear-diffuse-stage-length-slots": 7,
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": 12000000,
18+
"eb-size-bytes-constant": 240,
19+
"eb-size-bytes-per-ib": 32,
20+
"leios-header-diffusion-time-ms": 2000.0,
21+
"tx-start-time": 60,
22+
"tx-stop-time": 660,
23+
"tx-generation-distribution": {
24+
"distribution": "constant",
25+
"value": 10.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": 600,
49+
"vote-threshold": 450,
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": 7,
66+
"eb-body-avg-size-bytes": 12000000,
67+
"late-eb-attack": {
68+
"attackers": {
69+
"nodes": []
70+
},
71+
"propagation-delay-ms": 0
72+
},
73+
"late-tx-attack": {
74+
"attackers": {
75+
"nodes": []
76+
},
77+
"attack-probability": 0,
78+
"tx-generation-distribution": {
79+
"distribution": "constant",
80+
"value": 0
81+
}
82+
}
83+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../run.sh
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
INFO praos: sim_cli::events: 60001 transactions(s) were generated in total.
2+
INFO praos: sim_cli::events: 38 naive praos block(s) were published.
3+
INFO praos: sim_cli::events: 862 slot(s) had no naive praos blocks.
4+
INFO praos: sim_cli::events: 60001 transaction(s) (90.00 MB) finalized in a naive praos block.
5+
INFO praos: sim_cli::events: 0 transaction(s) (0 B) did not reach a naive praos block.
6+
INFO praos: sim_cli::events: Pool 3 published 1 naive praos block(s)
7+
INFO praos: sim_cli::events: Pool 35 published 1 naive praos block(s)
8+
INFO praos: sim_cli::events: Pool 38 published 1 naive praos block(s)
9+
INFO praos: sim_cli::events: Pool 40 published 1 naive praos block(s)
10+
INFO praos: sim_cli::events: Pool 46 published 1 naive praos block(s)
11+
INFO praos: sim_cli::events: Pool 53 published 1 naive praos block(s)
12+
INFO praos: sim_cli::events: Pool 54 published 1 naive praos block(s)
13+
INFO praos: sim_cli::events: Pool 55 published 1 naive praos block(s)
14+
INFO praos: sim_cli::events: Pool 58 published 1 naive praos block(s)
15+
INFO praos: sim_cli::events: Pool 59 published 2 naive praos block(s)
16+
INFO praos: sim_cli::events: Pool 67 published 1 naive praos block(s)
17+
INFO praos: sim_cli::events: Pool 68 failed to publish 1 naive praos block(s) due to slot battles.
18+
INFO praos: sim_cli::events: Pool 69 published 1 naive praos block(s)
19+
INFO praos: sim_cli::events: Pool 73 published 1 naive praos block(s)
20+
INFO praos: sim_cli::events: Pool 86 published 1 naive praos block(s)
21+
INFO praos: sim_cli::events: Pool 109 published 1 naive praos block(s)
22+
INFO praos: sim_cli::events: Pool 121 published 1 naive praos block(s)
23+
INFO praos: sim_cli::events: Pool 132 published 1 naive praos block(s)
24+
INFO praos: sim_cli::events: Pool 136 published 1 naive praos block(s)
25+
INFO praos: sim_cli::events: Pool 351 published 1 naive praos block(s)
26+
INFO praos: sim_cli::events: Pool 431 published 1 naive praos block(s)
27+
INFO praos: sim_cli::events: Pool 477 published 1 naive praos block(s)
28+
INFO praos: sim_cli::events: Pool 518 published 1 naive praos block(s)
29+
INFO praos: sim_cli::events: Pool 519 published 1 naive praos block(s)
30+
INFO praos: sim_cli::events: Pool 528 published 1 naive praos block(s)
31+
INFO praos: sim_cli::events: Pool 534 published 1 naive praos block(s)
32+
INFO praos: sim_cli::events: Pool 535 published 2 naive praos block(s)
33+
INFO praos: sim_cli::events: Pool 539 published 1 naive praos block(s)
34+
INFO praos: sim_cli::events: Pool 540 published 1 naive praos block(s)
35+
INFO praos: sim_cli::events: Pool 542 published 1 naive praos block(s)
36+
INFO praos: sim_cli::events: Pool 544 published 1 naive praos block(s)
37+
INFO praos: sim_cli::events: Pool 560 published 1 naive praos block(s)
38+
INFO praos: sim_cli::events: Pool 562 published 1 naive praos block(s)
39+
INFO praos: sim_cli::events: Pool 741 published 1 naive praos block(s)
40+
INFO praos: sim_cli::events: Pool 742 published 1 naive praos block(s)
41+
INFO praos: sim_cli::events: Pool 745 published 1 naive praos block(s)
42+
INFO praos: sim_cli::events: Pool 747 published 1 naive praos block(s)
43+
INFO leios: sim_cli::events: 0 IB(s) were generated, on average 0.000 IB(s) per slot.
44+
INFO leios: sim_cli::events: 0 out of 60001 transaction(s) were included in at least one IB.
45+
INFO leios: sim_cli::events: The average age of the pending transactions is NaNs (stddev NaN).
46+
INFO leios: sim_cli::events: Each transaction was included in an average of NaN IB(s) (stddev NaN).
47+
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.
48+
INFO leios: sim_cli::events: Each node received an average of 0.000 IB(s) (stddev 0.000).
49+
INFO leios: sim_cli::events: 39 EB(s) were generated; on average there were 0.043 EB(s) per slot.
50+
INFO leios: sim_cli::events: Each EB contained an average of 3584.487 transaction(s) (stddev 2616.815). 7 EB(s) were empty.
51+
INFO leios: sim_cli::events: Each EB contained an average of 0.000 IB(s) (stddev 0.000). 7 EB(s) were empty.
52+
INFO leios: sim_cli::events: Each IB was included in an average of NaN EB(s) (stddev NaN).
53+
INFO leios: sim_cli::events: 0 out of 0 IBs were included in at least one EB.
54+
INFO leios: sim_cli::events: 0 out of 0 IBs expired before they reached an EB.
55+
INFO leios: sim_cli::events: 9 out of 39 EBs expired before an EB from their stage reached an RB.
56+
INFO leios: sim_cli::events: 59941 out of 60001 transaction(s) were included in at least one EB.
57+
INFO leios: sim_cli::events: 18257 total votes were generated.
58+
INFO leios: sim_cli::events: Each stake pool produced an average of 84.523 vote(s) (stddev 17.789).
59+
INFO leios: sim_cli::events: Each EB received an average of 480.447 vote(s) (stddev 233.432).
60+
INFO leios: sim_cli::events: There were 6106 bundle(s) of votes. Each bundle contained 2.990 vote(s) (stddev 1.636).
61+
INFO leios: sim_cli::events: 32 L1 block(s) had a Leios endorsement.
62+
INFO leios: sim_cli::events: 59581 tx(s) (89.37 MB) were referenced by a Leios endorsement.
63+
INFO leios: sim_cli::events: 420 tx(s) (630 kB) were included directly in a Praos block.
64+
INFO leios: sim_cli::events: Spatial efficiency: 89.37 MB/4.74 MB (1885.952%) of Leios bytes were unique transactions.
65+
INFO leios: sim_cli::events: 44258 tx(s) (42.622%) referenced by a Leios endorsement were redundant.
66+
INFO leios: sim_cli::events: Each transaction took an average of NaNs (stddev NaN) to be included in an IB.
67+
INFO leios: sim_cli::events: Each transaction took an average of 21.355s (stddev 18.541) to be included in an EB.
68+
INFO leios: sim_cli::events: Each transaction took an average of 48.296s (stddev 29.229) to be included in a block.
69+
INFO network: sim_cli::events: 44940749 TX message(s) were sent. 44940749 of them were received (100.000%).
70+
INFO network: sim_cli::events: 0 IB message(s) were sent. 0 of them were received (NaN%).
71+
INFO network: sim_cli::events: 28751 EB message(s) were sent. 28751 of them were received (100.000%).
72+
INFO network: sim_cli::events: 4573394 Vote message(s) were sent. 4573394 of them were received (100.000%).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Adversary,EB delay,Tx attack,Tx size,Throughput,Tx start [s],Tx stop [s],Sim stop [s]
2+
33% adversary,EB attack: none,Tx attack: 100%,1500 B/Tx,0.150 TxMB/s,60,660,900

0 commit comments

Comments
 (0)