ouroboros-consensus-cardano-0.16.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.ThreadNet.Infra.TwoEras

Description

Definitions used in ThreadNet tests that involve two eras.

Synopsis

Generators

data Partition Source #

When and for how long the nodes are partitioned

The nodes are divided via message delays into two sub-networks by the parity of their CoreNodeId.

Constructors

Partition SlotNo NumSlots

the scheduled start slot and duration (which includes the start slot)

Instances

Instances details
Show Partition Source # 
Instance details

Defined in Test.ThreadNet.Infra.TwoEras

Methods

showsPrecIntPartitionShowS #

showPartitionString #

showList ∷ [Partition] → ShowS #

genPartitionNumCoreNodesNumSlotsSecurityParamGen Partition Source #

Generate setupPartition

genTestConfigSecurityParam → (EpochSize, EpochSize) → Gen TestConfig Source #

Generate a setupTestConfig relevant to the case where the first era (eg Byron) lasts for one epoch and the second era (eg Shelley) lasts for an interesting number of slots.

Era inspection

data ReachesEra2 Source #

Whether the test included second era blocks and (pre)reqs relevant to that

Note these fields are ordered alphabetically not semantically; see label_ReachesEra2.

Constructors

ReachesEra2 

Fields

  • rsEra1SlotsPrereq

    enough slots in the first era to enable a block in the second era

  • rsPVPrereq

    sufficient protocol version to enable a block in the second era

  • rsEra2BlocksBool

    blocks from the second era included in final chains

  • rsEra2SlotsRequirement

    enough slots in the second era to necessitate a block in the second era

Instances

Instances details
Generic ReachesEra2 Source # 
Instance details

Defined in Test.ThreadNet.Infra.TwoEras

Associated Types

type Rep ReachesEra2TypeType #

Show ReachesEra2 Source # 
Instance details

Defined in Test.ThreadNet.Infra.TwoEras

CollectReqs ReachesEra2 Source # 
Instance details

Defined in Test.ThreadNet.Infra.TwoEras

type Rep ReachesEra2 Source # 
Instance details

Defined in Test.ThreadNet.Infra.TwoEras

type Rep ReachesEra2 = D1 ('MetaData "ReachesEra2" "Test.ThreadNet.Infra.TwoEras" "ouroboros-consensus-cardano-0.16.0.0-inplace-unstable-cardano-testlib" 'False) (C1 ('MetaCons "ReachesEra2" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rsEra1Slots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Prereq) :*: S1 ('MetaSel ('Just "rsPV") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Prereq)) :*: (S1 ('MetaSel ('Just "rsEra2Blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "rsEra2Slots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Requirement))))

activeSlotCoeffRational Source #

The active slot coefficient, f.

Some of these tests include epochs in the second era in which stakepools are actually leading. In that case, the k, d, and f parameters and the length of any scheduled network partitions need to be balanced so that Common Prefix violations (in particular, wedges) are extremely unlikely.

isFirstEraBlockHardForkBlock (era ': eras) → Bool Source #

ledgerReachesEra2ReachesEra2Bool Source #

Is the update proposal adopted?

mkMessageDelayPartitionCalcMessageDelay blk Source #

The temporary partition as a CalcMessageDelay

Calculates the delays that implement setupPartition.

numFirstEraEpochsNum a ⇒ a Source #

The number of epochs in the first era in this test

All nodes join in slot 0, we generate the proposal in slot 0, we also generate the votes in slot 0, and the nodes are endorsing the proposal as of slot 0. Thus we expect that the first era will end after one epoch. Otherwise it would indicate some sort of protocol failure.

secondEraOverlaySlotsNumSlotsNumSlotsUnitIntervalEpochSizeSet SlotNo Source #

All OBFT overlay slots in the second era.

Properties

label_ReachesEra2ReachesEra2String Source #

List the (pre)reqs in semantic order, followed by the observation

label_hadActiveNonOverlaySlotsTestOutput (HardForkBlock (era ': eras)) → Set SlotNoString Source #

Whether there was a block forged in a non-overlay slot in the second era.

This event evidences that the stake pools were correctly created and delegated to.

prop_ReachesEra2ReachesEra2Property Source #

Checks if the observation satisfies the (pre)reqs