Factor out TestSetup
in era-crossing ThreadNet tests
#1689
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the era-crossing ThreadNet. I'm undertaking this process with the following two goals:
A catalogue of ThreadNet tests
To achieve the first goal, I've added a doc that describes the idea behind the ThreadNet tests an enumerates them, see https://github.com/IntersectMBO/ouroboros-consensus/blob/26a161621ed3a4c1af5100e8f56e6bf85626152c/docs/website/contents/references/threadnet_tests.md
Refactoring of the Shelley-based era crossing tests
To achieve the second goal, the PR makes the following changes:
ShelleyBasedHardForkConstraints
constraint alias. Before this PR, theproto1
andproto2
type variables were hard coded to beTProas
. After this PR, they are only constrained to be the same. This instantiating them toPraos
. This enables expressing the between thePraos
eras, i.e. from Babbage onward.protocolInfoShelleyBasedHardFork
function which constructs the hard fork protocol info for two Shelley-based eras. The refactoring abstracts the function in the same way that the first change abstractsShelleyBasedHardForkConstraints
, i.e. allows using protocols other thanTPraos
. The protocols in both eras still have to coincide though, as they are bound by theproto1 ~ proto2
constraint fromShelleyBasedHardForkConstraints
. I'm deliberately duplicating the argument that constructs the protocol info, even though the same function is passed at the call sites (namely,protocolInfoTPraosShelleyBased
). We may benefit from this if we ever remove theproto1 ~ proto2
constraint to test the transition from Alonzo to Babbage, which goes fromTPraos
intoPraos
.