Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.ThreadNet.Infra.Shelley
Synopsis
- data CoreNode c = CoreNode {
- cnGenesisKey ∷ !(SignKeyDSIGN DSIGN)
- cnDelegateKey ∷ !(SignKeyDSIGN DSIGN)
- cnStakingKey ∷ !(SignKeyDSIGN DSIGN)
- cnVRF ∷ !(SignKeyVRF (VRF c))
- cnKES ∷ !(UnsoundPureSignKeyKES (KES c))
- cnOCert ∷ !(OCert c)
- data CoreNodeKeyInfo c = CoreNodeKeyInfo {
- cnkiKeyPair ∷ (KeyPair 'Payment, KeyPair 'Staking)
- cnkiCoreNode ∷ (KeyPair 'Genesis, AllIssuerKeys c 'GenesisDelegate)
- newtype DecentralizationParam = DecentralizationParam {}
- data KesConfig = KesConfig {}
- coreNodeKeys ∷ CoreNode c → CoreNodeKeyInfo c
- genCoreNode ∷ Crypto c ⇒ KESPeriod → Gen (CoreNode c)
- incrementMinorProtVer ∷ ProtVer → ProtVer
- initialLovelacePerCoreNode ∷ Word64
- mkCredential ∷ ∀ (r ∷ KeyRole). SignKeyDSIGN DSIGN → Credential r
- mkEpochSize ∷ SecurityParam → Rational → EpochSize
- mkGenesisConfig ∷ PraosCrypto c ⇒ ProtVer → SecurityParam → Rational → DecentralizationParam → Word64 → SlotLength → KesConfig → [CoreNode c] → ShelleyGenesis
- mkKesConfig ∷ ∀ proxy c. Crypto c ⇒ proxy c → NumSlots → KesConfig
- mkKeyHash ∷ ∀ (r ∷ KeyRole). SignKeyDSIGN DSIGN → KeyHash r
- mkKeyHashVrf ∷ ∀ c (r ∷ KeyRoleVRF). Crypto c ⇒ SignKeyVRF (VRF c) → VRFVerKeyHash r
- mkKeyPair ∷ ∀ (r ∷ KeyRole). SignKeyDSIGN DSIGN → KeyPair r
- mkLeaderCredentials ∷ CoreNode c → ShelleyLeaderCredentials c
- mkMASetDecentralizationParamTxs ∷ ∀ proto era. (ShelleyBasedEra era, AllegraEraTxBody era, ShelleyEraTxBody era, AtMostEra AlonzoEra era) ⇒ [CoreNode (ProtoCrypto proto)] → ProtVer → SlotNo → DecentralizationParam → [GenTx (ShelleyBlock proto era)]
- mkProtocolShelley ∷ (IOLike m, ShelleyCompatible (TPraos c) ShelleyEra) ⇒ ShelleyGenesis → Nonce → ProtVer → CoreNode c → (ProtocolInfo (ShelleyBlock (TPraos c) ShelleyEra), m [BlockForging m (ShelleyBlock (TPraos c) ShelleyEra)])
- mkSetDecentralizationParamTxs ∷ ShelleyBasedEra ShelleyEra ⇒ [CoreNode c] → ProtVer → SlotNo → DecentralizationParam → [GenTx (ShelleyBlock (TPraos c) ShelleyEra)]
- mkVerKey ∷ ∀ (r ∷ KeyRole). SignKeyDSIGN DSIGN → VKey r
- networkId ∷ Network
- tpraosSlotLength ∷ SlotLength
Documentation
Constructors
CoreNode | |
Fields
|
data CoreNodeKeyInfo c Source #
Constructors
CoreNodeKeyInfo | |
Fields
|
newtype DecentralizationParam Source #
A suitable value for the d
protocol parameter
In the range 0
to 1
, inclusive. Beware the misnomer: 0
means fully
decentralized, and 1
means fully centralized.
Constructors
DecentralizationParam | |
Instances
Currently
is the max number of
slots the test can run without needing new ocerts.maxEvolutions
* slotsPerEvolution
TODO This limitation may be lifted by PR #2107, see https://github.com/IntersectMBO/ouroboros-network/issues/2107.
Constructors
KesConfig | |
Fields |
coreNodeKeys ∷ CoreNode c → CoreNodeKeyInfo c Source #
mkCredential ∷ ∀ (r ∷ KeyRole). SignKeyDSIGN DSIGN → Credential r Source #
mkEpochSize ∷ SecurityParam → Rational → EpochSize Source #
The epoch size, given k
and f
.
INVARIANT: 10 * k / f
must be a whole number.
Arguments
∷ PraosCrypto c | |
⇒ ProtVer | Initial protocol version |
→ SecurityParam | |
→ Rational | Initial active slot coefficient |
→ DecentralizationParam | |
→ Word64 | Max Lovelace supply, must be >= #coreNodes * initialLovelacePerCoreNode |
→ SlotLength | |
→ KesConfig | |
→ [CoreNode c] | |
→ ShelleyGenesis |
Note: a KES algorithm supports a particular max number of KES evolutions, but we can configure a potentially lower maximum for the ledger, that's why we take it as an argument.
mkKesConfig ∷ ∀ proxy c. Crypto c ⇒ proxy c → NumSlots → KesConfig Source #
A KesConfig
that will not require more evolutions than this test's crypto
allows.
mkKeyHashVrf ∷ ∀ c (r ∷ KeyRoleVRF). Crypto c ⇒ SignKeyVRF (VRF c) → VRFVerKeyHash r Source #
mkMASetDecentralizationParamTxs Source #
Arguments
∷ ∀ proto era. (ShelleyBasedEra era, AllegraEraTxBody era, ShelleyEraTxBody era, AtMostEra AlonzoEra era) | |
⇒ [CoreNode (ProtoCrypto proto)] | |
→ ProtVer | The proposed protocol version |
→ SlotNo | The TTL |
→ DecentralizationParam | The new value |
→ [GenTx (ShelleyBlock proto era)] |
TODO This is a copy-paste-edit of mkSetDecentralizationParamTxs
Our current plan is to replace all of this infrastructure with the ThreadNet rewrite; so we're minimizing the work and maintenance here for now.
mkProtocolShelley ∷ (IOLike m, ShelleyCompatible (TPraos c) ShelleyEra) ⇒ ShelleyGenesis → Nonce → ProtVer → CoreNode c → (ProtocolInfo (ShelleyBlock (TPraos c) ShelleyEra), m [BlockForging m (ShelleyBlock (TPraos c) ShelleyEra)]) Source #
mkSetDecentralizationParamTxs Source #
Arguments
∷ ShelleyBasedEra ShelleyEra | |
⇒ [CoreNode c] | |
→ ProtVer | The proposed protocol version |
→ SlotNo | The TTL |
→ DecentralizationParam | The new value |
→ [GenTx (ShelleyBlock (TPraos c) ShelleyEra)] |