Skip to content

Commit d75224a

Browse files
committed
sim-rs: update configuration docs
1 parent a93b03d commit d75224a

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

data/simulation/config.d.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ export interface Config {
248248
* where nodes deliberately withhold EBs until near the end of the voting phase.
249249
*/
250250
"late-eb-attack"?: LateEBAttackConfig | null;
251+
/**
252+
* Configuration for a "late TX" attack,
253+
* where EB producers create TXs which they do not disseminate until also disseminating the EB.
254+
*/
255+
"late-tx-attack"?: LateTXAttackConfig | null;
251256
}
252257

253258
export type CleanupPolicies = "all" | CleanupPolicy[];
@@ -327,7 +332,25 @@ export enum MempoolSamplingStrategy {
327332
*/
328333
export interface LateEBAttackConfig {
329334
/** The set of stake pools which are participating in the attack. */
330-
"attacker-nodes": string[],
335+
"attackers": NodeSelection,
331336
/** How long the attackers will wait before diffusing their EBs */
332337
"propagation-delay-ms": number,
338+
}
339+
340+
/**
341+
* Configuration for a "late TX" attack,
342+
* where EB producers create TXs which they do not disseminate until also disseminating the EB.
343+
*/
344+
export interface LateTXAttackConfig {
345+
/** The set of stake pools which are participating in the attack. */
346+
attackers: NodeSelection,
347+
/** How often does one of these nodes perform this attack when they get the chance? */
348+
"attack-probability": number,
349+
/** How many transactions are generated as part of the attack? */
350+
"tx-generation-distribution": Distribution,
351+
}
352+
353+
export type NodeSelection = NodesNodeSelection;
354+
export interface NodesNodeSelection {
355+
"nodes": string[];
333356
}

data/simulation/config.schema.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@
7575
"LateEBAttackConfig": {
7676
"description": "Configuration for a \"late EB\" attack,\nwhere nodes deliberately withhold EBs until near the end of the voting phase.",
7777
"properties": {
78-
"attacker-nodes": {
79-
"description": "The set of stake pools which are participating in the attack.",
80-
"items": {
81-
"type": "string"
82-
},
83-
"type": "array"
78+
"attackers": {
79+
"$ref": "#/definitions/NodesNodeSelection",
80+
"description": "The set of stake pools which are participating in the attack."
8481
},
8582
"propagation-delay-ms": {
8683
"description": "How long the attackers will wait before diffusing their EBs",
@@ -89,6 +86,24 @@
8986
},
9087
"type": "object"
9188
},
89+
"LateTXAttackConfig": {
90+
"description": "Configuration for a \"late TX\" attack,\nwhere EB producers create TXs which they do not disseminate until also disseminating the EB.",
91+
"properties": {
92+
"attack-probability": {
93+
"description": "How often does one of these nodes perform this attack when they get the chance?",
94+
"type": "number"
95+
},
96+
"attackers": {
97+
"$ref": "#/definitions/NodesNodeSelection",
98+
"description": "The set of stake pools which are participating in the attack."
99+
},
100+
"tx-generation-distribution": {
101+
"$ref": "#/definitions/Distribution",
102+
"description": "How many transactions are generated as part of the attack?"
103+
}
104+
},
105+
"type": "object"
106+
},
92107
"LeiosVariant": {
93108
"enum": [
94109
"short",
@@ -119,6 +134,17 @@
119134
"enum": ["ordered-by-id", "random"],
120135
"type": "string"
121136
},
137+
"NodesNodeSelection": {
138+
"properties": {
139+
"nodes": {
140+
"items": {
141+
"type": "string"
142+
},
143+
"type": "array"
144+
}
145+
},
146+
"type": "object"
147+
},
122148
"NormalDistribution": {
123149
"properties": {
124150
"distribution": {
@@ -311,6 +337,10 @@
311337
"$ref": "#/definitions/LateEBAttackConfig",
312338
"description": "Configuration for a \"late EB\" attack,\nwhere nodes deliberately withhold EBs until near the end of the voting phase."
313339
},
340+
"late-tx-attack": {
341+
"$ref": "#/definitions/LateTXAttackConfig",
342+
"description": "Configuration for a \"late TX\" attack,\nwhere EB producers create TXs which they do not disseminate until also disseminating the EB."
343+
},
314344
"leios-header-diffusion-time-ms": {
315345
"description": "The expected time it takes a header to fully diffuse across the network.\nThis is Δhdr from the Leios paper.",
316346
"type": "number"

0 commit comments

Comments
 (0)