Skip to content

Commit 8c9bf5f

Browse files
authored
Sim rs 1.2 (#506)
* sim-rs: add tx-validation-cpu-time-ms-per-byte * sim-rs: respect cert cpu settings * sim-rs: bump version to 1.2.0
1 parent ac74cdf commit 8c9bf5f

File tree

14 files changed

+54
-14
lines changed

14 files changed

+54
-14
lines changed

data/simulation/config.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ export interface Config {
113113
/** Only supported by Rust simulation. */
114114
"tx-validation-cpu-time-ms": number;
115115
/** Only supported by Rust simulation. */
116+
"tx-validation-cpu-time-ms-per-byte": number;
117+
/** Only supported by Rust simulation. */
116118
"tx-max-size-bytes": bigint;
117119
/**
118120
* What fraction of TXs (from 0 to 1) should introduce conflicts with transactions which were produced before?

data/simulation/config.default.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ tx-overcollateralization-factor-distribution:
6161
distribution: constant
6262
value: 0
6363
tx-validation-cpu-time-ms: 1.5
64+
tx-validation-cpu-time-ms-per-byte: 0
6465
tx-max-size-bytes: 16384
6566
tx-conflict-fraction: 0
6667

data/simulation/config.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@
511511
"description": "Only supported by Rust simulation.",
512512
"type": "number"
513513
},
514+
"tx-validation-cpu-time-ms-per-byte": {
515+
"description": "Only supported by Rust simulation.",
516+
"type": "number"
517+
},
514518
"vote-bundle-size-bytes-constant": {
515519
"additionalProperties": false,
516520
"properties": {},

sim-rs/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## v1.2.0
4+
5+
### All Leios variants
6+
7+
Add a `tx-validation-cpu-time-ms-per-byte` setting, a CPU cost which applies to transactions before adding them to the mempool (or to an EB in Linear Leios).
8+
9+
### Linear Leios
10+
11+
Respect cerificate CPU time settings:
12+
- `cert-generation-cpu-time-ms-constant`
13+
- `cert-generation-cpu-time-ms-per-node` (currently set to 0)
14+
- `cert-validation-cpu-time-ms-constant`
15+
- `cert-validation-cpu-time-ms-per-node` (currently set to 0)
16+
317
## v1.1.0
418

519
### Linear Leios

sim-rs/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sim-rs/implementations/CLASSIC_LEIOS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ If more than one EB matches all of these criteria, we use for tiebreakers
7676
## CPU model
7777
|Task name in logs|Task name in code|When does it run|What happens when it completes|CPU cost
7878
|---|---|---|---|---|
79-
|`ValTX`|`TransactionValidated`|After a transaction has been received from a peer.|That TX is announced to other peers.|`tx-validation-cpu-time-ms`|
79+
|`ValTX`|`TransactionValidated`|After a transaction has been received from a peer.|That TX is announced to other peers.|`tx-validation-cpu-time-ms` + `tx-validation-cpu-time-ms-per-byte` for each byte of TX|
8080
|`GenRB`|`RBBlockGenerated`|After a new ranking block has been generated.|That RB is announced to peers.|`rb-generation-cpu-time-ms` + `cert-generation-cpu-time-ms-constant` + `cert-generation-cpu-time-ms-per-node` for each node that voted for the endorsed EB|
8181
|`ValRB`|`RBBlockValidated`|After a ranking block has been received.|That RB body is announced to peers and (potentially) accepted as the tip of the chain.|`rb-body-legacy-praos-payload-validation-cpu-time-ms-constant` + `rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte` for each byte of TX + `cert-generation-cpu-time-ms-constant` + `cert-generation-cpu-time-ms-per-node` for each node that voted for the endorsed EB|
8282
|`GenIB`|`IBBlockGenerated`|After a new IB has been generated.|That IB is announced to peers.|`ib-generation-cpu-time-ms`|

sim-rs/implementations/LINEAR_LEIOS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ When a node receives an RB body, it immediately removes all referenced/conflicti
6565
## CPU model
6666
|Task name in logs|Task name in code|When does it run|What happens when it completes|CPU cost
6767
|---|---|---|---|---|
68-
|`ValTX`|`TransactionValidated`|After a transaction has been received from a peer.|That TX is announced to other peers.|`tx-validation-cpu-time-ms`|
69-
|`GenRB`|`RBBlockGenerated`|After a new ranking block has been generated.|That RB and its EB are announced to peers.|RB generation and EB generation run in parallel.</br>**RB generation**: `rb-generation-cpu-time-ms` + the CPU time of `ValRB`<br/>**EB generation**: `eb-generation-cpu-time-ms` + the CPU time of `ValEB`|
68+
|`ValTX`|`TransactionValidated`|After a transaction has been received from a peer.|That TX is announced to other peers.|`tx-validation-cpu-time-ms` + `tx-validation-cpu-time-ms-per-byte` for each byte of TX|
69+
|`GenRB`|`RBBlockGenerated`|After a new ranking block has been generated.|That RB and its EB are announced to peers.|RB generation and EB generation run in parallel.</br>**RB generation**: `rb-generation-cpu-time-ms` + `cert-generation-cpu-time-ms-constant` + `cert-generation-cpu-time-ms-per-node` for each node that voted for the endorsed EB + `rb-body-legacy-praos-payload-validation-cpu-time-ms-constant` + `rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte` for each byte of TX<br/>**EB generation**: `eb-generation-cpu-time-ms` + the CPU time of `ValEB`|
7070
|`ValRH`|`RBHeaderValidated`|After a ranking block header has been received.|That RB is announced to peers.<br/>The referenced EB is queued to be downloaded when available.|`rb-head-validation-cpu-time-ms`|
71-
|`ValRB`|`RBBlockValidated`|After a ranking block body has been received.|That RB body is announced to peers and (potentially) accepted as the tip of the chain.|`rb-body-legacy-praos-payload-validation-cpu-time-ms-constant` + `rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte` for each byte of TX|
71+
|`ValRB`|`RBBlockValidated`|After a ranking block body has been received.|That RB body is announced to peers and (potentially) accepted as the tip of the chain.|`rb-body-legacy-praos-payload-validation-cpu-time-ms-constant` + `rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte` for each byte of TX + `cert-validation-cpu-time-ms-constant` + `cert-validation-cpu-time-ms-per-node` for each node that voted for the endorsed EB|
7272
|`ValEH`|`EBHeaderValidated`|After an EB header has been received and validated.|That EB is announced to peers, and body validation begins in the background.|`eb-header-validation-cpu-time-ms`|
7373
|`ValEB`|`EBBlockValidated`|After an EB's body has been validated.|If eligible, the node will vote for that EB.|`eb-body-validation-cpu-time-ms-constant` + `eb-body-validation-cpu-time-ms-per-byte` for each byte of TX|
7474
|`GenVote`|`VTBundleGenerated`|After a vote bundle has been generated.|That vote bundle is announced to peers.|`vote-generation-cpu-time-ms-constant` + `vote-generation-cpu-time-ms-per-tx` for each TX in the EB|

sim-rs/implementations/STRACCIATELLA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Voting for endorser blocks also behaves mostly the same as in the original Leios
1515
## CPU model
1616
|Task name in logs|Task name in code|When does it run|What happens when it completes|CPU cost
1717
|---|---|---|---|---|
18-
|`ValTX`|`TransactionValidated`|After a transaction has been received from a peer.|That TX is announced to other peers.|`tx-validation-cpu-time-ms`|
18+
|`ValTX`|`TransactionValidated`|After a transaction has been received from a peer.|That TX is announced to other peers.|`tx-validation-cpu-time-ms` + `tx-validation-cpu-time-ms-per-byte` for each byte of TX|
1919
|`GenRB`|`RBBlockGenerated`|After a new ranking block has been generated.|That RB is announced to peers.|`rb-generation-cpu-time-ms` + `cert-generation-cpu-time-ms-constant` + `cert-generation-cpu-time-ms-per-node` for each node that voted for the endorsed EB|
2020
|`ValRB`|`RBBlockValidated`|After a ranking block has been received.|That RB body is announced to peers and (potentially) accepted as the tip of the chain.|`rb-body-legacy-praos-payload-validation-cpu-time-ms-constant` + `rb-body-legacy-praos-payload-validation-cpu-time-ms-per-byte` for each byte of TX + `cert-generation-cpu-time-ms-constant` + `cert-generation-cpu-time-ms-per-node` for each node that voted for the endorsed EB|
2121
|`GenEB`|`EBBlockGenerated`|After a new EB has been generated.|That EB is announced to peers.|`eb-generation-cpu-time-ms`|

sim-rs/sim-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sim-cli"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
edition = "2024"
55
default-run = "sim-cli"
66
rust-version = "1.88"

sim-rs/sim-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sim-core"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
edition = "2024"
55
rust-version = "1.88"
66

0 commit comments

Comments
 (0)