Nov 20, 5-6 PM (16)
Nov 20, 6-7 PM (33)
Nov 20, 7-8 PM (10)
Nov 20, 8-9 PM (11)
Nov 20, 9-10 PM (21)
Nov 20, 10-11 PM (26)
Nov 20, 11-12 AM (31)
Nov 21, 12-1 AM (7)
Nov 21, 1-2 AM (4)
Nov 21, 2-3 AM (4)
Nov 21, 3-4 AM (5)
Nov 21, 4-5 AM (13)
Nov 21, 5-6 AM (8)
Nov 21, 6-7 AM (13)
Nov 21, 7-8 AM (23)
Nov 21, 8-9 AM (25)
Nov 21, 9-10 AM (29)
Nov 21, 10-11 AM (36)
Nov 21, 11-12 PM (36)
Nov 21, 12-1 PM (29)
Nov 21, 1-2 PM (30)
Nov 21, 2-3 PM (37)
Nov 21, 3-4 PM (37)
Nov 21, 4-5 PM (47)
Nov 21, 5-6 PM (18)
Nov 21, 6-7 PM (12)
Nov 21, 7-8 PM (13)
Nov 21, 8-9 PM (20)
Nov 21, 9-10 PM (11)
Nov 21, 10-11 PM (34)
Nov 21, 11-12 AM (15)
Nov 22, 12-1 AM (8)
Nov 22, 1-2 AM (9)
Nov 22, 2-3 AM (11)
Nov 22, 3-4 AM (7)
Nov 22, 4-5 AM (1)
Nov 22, 5-6 AM (0)
Nov 22, 6-7 AM (2)
Nov 22, 7-8 AM (6)
Nov 22, 8-9 AM (3)
Nov 22, 9-10 AM (3)
Nov 22, 10-11 AM (6)
Nov 22, 11-12 PM (11)
Nov 22, 12-1 PM (13)
Nov 22, 1-2 PM (18)
Nov 22, 2-3 PM (15)
Nov 22, 3-4 PM (20)
Nov 22, 4-5 PM (3)
Nov 22, 5-6 PM (7)
Nov 22, 6-7 PM (2)
Nov 22, 7-8 PM (7)
Nov 22, 8-9 PM (2)
Nov 22, 9-10 PM (14)
Nov 22, 10-11 PM (23)
Nov 22, 11-12 AM (26)
Nov 23, 12-1 AM (1)
Nov 23, 1-2 AM (9)
Nov 23, 2-3 AM (10)
Nov 23, 3-4 AM (6)
Nov 23, 4-5 AM (7)
Nov 23, 5-6 AM (2)
Nov 23, 6-7 AM (0)
Nov 23, 7-8 AM (0)
Nov 23, 8-9 AM (1)
Nov 23, 9-10 AM (3)
Nov 23, 10-11 AM (8)
Nov 23, 11-12 PM (4)
Nov 23, 12-1 PM (6)
Nov 23, 1-2 PM (13)
Nov 23, 2-3 PM (10)
Nov 23, 3-4 PM (5)
Nov 23, 4-5 PM (18)
Nov 23, 5-6 PM (16)
Nov 23, 6-7 PM (2)
Nov 23, 7-8 PM (8)
Nov 23, 8-9 PM (5)
Nov 23, 9-10 PM (7)
Nov 23, 10-11 PM (41)
Nov 23, 11-12 AM (34)
Nov 24, 12-1 AM (6)
Nov 24, 1-2 AM (10)
Nov 24, 2-3 AM (8)
Nov 24, 3-4 AM (15)
Nov 24, 4-5 AM (6)
Nov 24, 5-6 AM (7)
Nov 24, 6-7 AM (11)
Nov 24, 7-8 AM (71)
Nov 24, 8-9 AM (114)
Nov 24, 9-10 AM (39)
Nov 24, 10-11 AM (26)
Nov 24, 11-12 PM (133)
Nov 24, 12-1 PM (88)
Nov 24, 1-2 PM (57)
Nov 24, 2-3 PM (52)
Nov 24, 3-4 PM (34)
Nov 24, 4-5 PM (33)
Nov 24, 5-6 PM (38)
Nov 24, 6-7 PM (22)
Nov 24, 7-8 PM (28)
Nov 24, 8-9 PM (12)
Nov 24, 9-10 PM (29)
Nov 24, 10-11 PM (34)
Nov 24, 11-12 AM (33)
Nov 25, 12-1 AM (8)
Nov 25, 1-2 AM (3)
Nov 25, 2-3 AM (7)
Nov 25, 3-4 AM (6)
Nov 25, 4-5 AM (5)
Nov 25, 5-6 AM (8)
Nov 25, 6-7 AM (20)
Nov 25, 7-8 AM (23)
Nov 25, 8-9 AM (53)
Nov 25, 9-10 AM (52)
Nov 25, 10-11 AM (47)
Nov 25, 11-12 PM (50)
Nov 25, 12-1 PM (76)
Nov 25, 1-2 PM (58)
Nov 25, 2-3 PM (68)
Nov 25, 3-4 PM (42)
Nov 25, 4-5 PM (40)
Nov 25, 5-6 PM (29)
Nov 25, 6-7 PM (32)
Nov 25, 7-8 PM (50)
Nov 25, 8-9 PM (9)
Nov 25, 9-10 PM (30)
Nov 25, 10-11 PM (33)
Nov 25, 11-12 AM (27)
Nov 26, 12-1 AM (10)
Nov 26, 1-2 AM (7)
Nov 26, 2-3 AM (2)
Nov 26, 3-4 AM (4)
Nov 26, 4-5 AM (12)
Nov 26, 5-6 AM (4)
Nov 26, 6-7 AM (4)
Nov 26, 7-8 AM (29)
Nov 26, 8-9 AM (49)
Nov 26, 9-10 AM (83)
Nov 26, 10-11 AM (60)
Nov 26, 11-12 PM (86)
Nov 26, 12-1 PM (72)
Nov 26, 1-2 PM (62)
Nov 26, 2-3 PM (42)
Nov 26, 3-4 PM (58)
Nov 26, 4-5 PM (25)
Nov 26, 5-6 PM (28)
Nov 26, 6-7 PM (14)
Nov 26, 7-8 PM (23)
Nov 26, 8-9 PM (24)
Nov 26, 9-10 PM (18)
Nov 26, 10-11 PM (38)
Nov 26, 11-12 AM (32)
Nov 27, 12-1 AM (4)
Nov 27, 1-2 AM (2)
Nov 27, 2-3 AM (8)
Nov 27, 3-4 AM (5)
Nov 27, 4-5 AM (2)
Nov 27, 5-6 AM (7)
Nov 27, 6-7 AM (11)
Nov 27, 7-8 AM (31)
Nov 27, 8-9 AM (47)
Nov 27, 9-10 AM (42)
Nov 27, 10-11 AM (61)
Nov 27, 11-12 PM (42)
Nov 27, 12-1 PM (125)
Nov 27, 1-2 PM (27)
Nov 27, 2-3 PM (52)
Nov 27, 3-4 PM (49)
Nov 27, 4-5 PM (30)
Nov 27, 5-6 PM (1)
4,097 commits this week Nov 20, 2025 - Nov 27, 2025
Generate security parameter for ChainDB q-s-m test on the fly
After analysing the effect of varying the security parameter (`k`) of
the ChainDB state machine tests (currently hardcoded with 2), we have
observed a tension between:

1) generating enough tests exercising the new Peras behavior where the
   chain selection mechanism switches to a shorter but heavier chain
   (cert boost is derived from k and must be large enough to overcome
   the weight of a longer chain), and

2) generating enough tests exercising the ImmutableDB logic (the chain
   must have at least k blocks)

Here are some empirical results:

k   -> P(switch to shorter chain), P(generate a chain with >= k blocks)
k=2 -> ~1.3%, ~40%
k=3 -> ~1.9%, ~20%
k=4 -> ~2.4%, ~9%
k=5 -> ~2.5%, ~3%
k=10 -> ~3%,  ~0.05%

We believe that the sweet spot between both desiderata appears to be
around `k=2` and `k=4`.

This commit introduces a random generator for `k` using a geometric
distribution to bias the randomly generated `k`s to be relatively small,
while still allowing larger ones to appear from time to time.

Under the current parameters, roughly 87.5% of the tests use `k<=4`;

```
Security Parameter (k) (10000 in total):
  50.82% 2
  23.83% 3
  12.62% 4
   6.69% 5
   3.08% 6
   1.54% 7
   0.74% 8
   0.37% 9
   0.16% 10
   0.06% 11
   0.05% 12
   0.02% 13
   0.01% 14
   0.01% 17
```

Yielding the following distributions for 1) and 2), respectively:

```
Tags (5398 in total):
38.70% TagGetIsValidJust
29.23% TagChainSelReprocessKeptSelection
26.25% TagGetIsValidNothing
 3.98% TagChainSelReprocessChangedSelection
 1.83% TagSwitchedToShorterChain  <- HERE
```

```
Chain length >= k (10000 in total):
  73.25% False
  26.75% True  <- HERE
```

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Disable EBB generation in ChainDB q-s-m tests when k>2
This commit addresses
https://github.com/IntersectMBO/ouroboros-consensus/issues/1745
by selectively disabling EBB generation when the security parameter (k)
is larger than 2.

This is needed to allow generating k>2 on the fly, which is necessary
for testing that certain Peras-related events are properly handled by
weight-based chain selection algorithm.

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Avoid exposing Peras boostPerCert in tests
Since the Peras boost per certificate will likely become a protocol
parameter, we proactively avoid exposing the current hardcoded value,
replacing it with an instantiation of the (currently trivial) PerasCfg
record.

In the special cases where it's interesting to vary the boost
dynamically (ChainDB q-s-m), validated Peras certs now contain randomly
generated boost weights.

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Tweak generation frequencies in ChainDB q-s-m tests
This commit increases the generation frequencies of both the
'genAddBlock' and 'genAddPerasCert' constructions to help producing
denser chains of blocks. This way, some of the events that were
harder to trigger (especially TagSwitchedToShorterChain) are much
more common now:

* Before:
    Tags (5867 in total):
    39.36% TagGetIsValidJust
    29.76% TagGetIsValidNothing
    28.50% TagChainSelReprocessKeptSelection
     2.35% TagChainSelReprocessChangedSelection
     0.03% TagSwitchedToShorterChain

* After:
    Tags (5202 in total):
    37.57% TagGetIsValidJust
    28.24% TagGetIsValidNothing
    27.25% TagChainSelReprocessKeptSelection
     6.41% TagChainSelReprocessChangedSelection
     0.53% TagSwitchedToShorterChain

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Refactor ChainDB q-s-m test to carry gap blocks between commands
Extends the ChainDB model with generator state to support carrying gap
blocks in state machine tests. This increases the chances of generating
and adding (possibly out-of-order) branching sequences of blocks. This,
in turn increases the chances of observing the event where the
chain selection logic switches from a longer to a shorter (but heavier)
chain containing a boosted block.

Before:
    Tags (5202 in total):
    37.57% TagGetIsValidJust
    28.24% TagGetIsValidNothing
    27.25% TagChainSelReprocessKeptSelection
     6.41% TagChainSelReprocessChangedSelection
     0.53% TagSwitchedToShorterChain

After:
    Tags (5176 in total):
    39.10% TagGetIsValidJust
    27.94% TagChainSelReprocessKeptSelection
    26.49% TagGetIsValidNothing
     5.37% TagChainSelReprocessChangedSelection
     1.10% TagSwitchedToShorterChain

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>