Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow skipping a prefix of the eras in Cardano mode #2811

Merged
merged 5 commits into from
Dec 15, 2020

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Dec 11, 2020

Add support for immediately executing one or more hard forks during initialisation, when configured using TriggerHardForkAtEpoch 0. This will allow starting a node in Cardano mode directly in the Shelley, Allegra, or Mary era without having to spend an epoch in each preceding era.

For example, to start a Cardano node in the Mary era, add the following to your cardano-node configuration:

TestShelleyHardForkAtEpoch: 0
TestAllegraHardForkAtEpoch: 0
TestMaryHardForkAtEpoch:    0

Registering initial staking and funds is also allowed in Cardano mode, but will only take effect if configured to skip at least the Byron era.

@mrBliss mrBliss added the consensus issues related to ouroboros-consensus label Dec 11, 2020
Introduce and use the new `injectInitialExtLedgerState` function that will
execute all hard forks scheduled at epoch 0 using `TriggerHardForkAtEpoch`. The
initial ledger state will then be in the right era.

This allows a node to skip one or more initial eras. For example, this can be
used to let a Cardano node start from the Shelley, Allegra, or Mary era.
Previously, the HFC would initialise the ChainDB using the first era's
initialisation method. This meant that we always try to add a Byron genesis EBB.

When one or more hard forks are statically configured to take place at the
start, we would add a Byron EBB while already in the Shelley, Allegra, or Mary
era. The Byron EBB would be considered an invalid block and our ThreadNet tests
would fail and report the unexpected block rejection.

Instead of using the first era's method to initialise the ChainDB, we now use
the current era's method. When starting in Shelley, Allegra, or Mary, we won't
try to add the invalid Byron EBB.

To make this possible, we replace the `addBlockIfEmpty` method of `InitChainDB`
with `addBlock` and `getCurrentLedger`. The latter is used to determine the
current era. We lose the `Contravariant` instance, but add a custom `map`
function in its place.
@mrBliss mrBliss force-pushed the mrBliss/skippable-first-eras branch 2 times, most recently from 653521e to 40ff99c Compare December 14, 2020 18:08
When the initial ledger state of Cardano mode is not in the Byron era, register
the initial staking and initial funds (if provided in the genesis config) in the
ledger state.

This will only happen when configured to skip the Byron era and hard fork
immediately to Shelley or a later era using `TriggerHardForkAtEpoch 0`.
@mrBliss
Copy link
Contributor Author

mrBliss commented Dec 15, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 15, 2020

@iohk-bors iohk-bors bot merged commit 7d0f3f2 into master Dec 15, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/skippable-first-eras branch December 15, 2020 10:50
mrBliss added a commit that referenced this pull request Dec 22, 2020
`ProtocolCardano` can now be used by the benchmarking team instead, after the
last commit and #2811.
mrBliss added a commit that referenced this pull request Dec 22, 2020
`ProtocolCardano` can now be used by the benchmarking team instead, after the
last commit and #2811.
mrBliss added a commit that referenced this pull request Dec 22, 2020
`ProtocolCardano` can now be used by the benchmarking team instead, after the
last commit and #2811.
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Jan 12, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832
mrBliss added a commit to IntersectMBO/cardano-node that referenced this pull request Jan 12, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832
coot pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 13, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 17, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 17, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 17, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 17, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
erikd pushed a commit to IntersectMBO/cardano-node that referenced this pull request Jan 18, 2021
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
iohk-bors bot added a commit to IntersectMBO/cardano-node that referenced this pull request Jan 19, 2021
2274: Update dependencies r=kderme a=mrBliss

Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

Co-authored-by: Thomas Winant <thomas@well-typed.com>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
newhoggy pushed a commit to IntersectMBO/cardano-api that referenced this pull request May 23, 2023
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
newhoggy pushed a commit to IntersectMBO/cardano-cli that referenced this pull request May 24, 2023
Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

network tracers: moved ToObject TxSubmission instance

network tracers: added ToObjcet TxSubmission2 instance

Update cabal.project index-state value
newhoggy pushed a commit to IntersectMBO/cardano-cli that referenced this pull request May 24, 2023
2274: Update dependencies r=kderme a=mrBliss

Note that this does not incorporate the latest changes in cardano-ledger-specs.

Notable changes:
* IntersectMBO/ouroboros-network#2807
* IntersectMBO/ouroboros-network#2811
* IntersectMBO/ouroboros-network#2832

Co-authored-by: Thomas Winant <thomas@well-typed.com>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants