-
Notifications
You must be signed in to change notification settings - Fork 720
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
cardano-testnet | configurable SPO and relays count, enable parallel execution of the test suite #6007
cardano-testnet | configurable SPO and relays count, enable parallel execution of the test suite #6007
Conversation
bc21882
to
f6be47e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments. Please break this PR up into smaller commits with informative commit messages.
<> OA.showDefault | ||
<> OA.value 1) | ||
where | ||
defaultSpoOptions = TestnetNodeOptions TestnetNodeRoleSpo Nothing [] | ||
|
||
_pSpo :: Parser TestnetNodeOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete this in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the removal is done in #6008
. encode $ Defaults.defaultByronProtocolParamsJsonValue | ||
|
||
-- Because in Conway the overlay schedule and decentralization parameter | ||
-- are deprecated, we must use the "create-staked" cli command to create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this comment in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in: #6008
let paymentAddrFile = tmpAbsPath </> "utxo-keys" </> "utxo" <> show idx </> "utxo.addr" | ||
|
||
execCli_ | ||
[ "address", "build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause failures in the 9.3 release branch if merged to master
. address
was removed from the top level however we are going to reintroduce it as it is era agnostic 🫠 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll keep an eye on it.
11db08a
to
130551d
Compare
FYI I'll merge #6008 after this one. The two are highly conflictual. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
-- > ├── delegate-keys | ||
-- > │ ├── delegate{1,2,3} | ||
-- > │ │ ├── kes.{skey,vkey} | ||
-- > │ │ ├── key.{skey,vkey} | ||
-- > │ │ ├── opcert.{cert,counter} | ||
-- > │ │ └── vrf.{skey,vkey} | ||
-- > │ │ ├── vrf.{skey,vkey} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
-- > │ │ ├── staking.{skey,vkey} | ||
-- > ├── utxo-keys | ||
-- > │ ├── utxo{1,2,3} | ||
-- > │ │ ├── utxo.{addr,skey,vkey} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you manually update these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I did.
@smelc any tips how to make this less error-prone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carbolymer> I ran tree
on the content of a sandbox created by running the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the same, but the de-duplication part is what's annoying and error-prone.
_ <- createSPOGenesisAndFiles nPools nDReps maxSupply asbe shelleyGenesis alonzoGenesis conwayGenesis (TmpAbsolutePath tmpAbsPath) | ||
|
||
-- TODO: This should come from the configuration! | ||
let makePathsAbsolute :: (Element a ~ FilePath, MonoFunctor a) => a -> a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. How did you come across MonoFunctor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember now. I think I saw a presentation mentioning it some time ago.
, poolKeys :: PoolNodeKeys | ||
data TestnetNode = TestnetNode | ||
{ testnetNodeRuntime :: !NodeRuntime | ||
, poolKeys :: Maybe SpoNodeKeys -- ^ Keys are only present for SPO nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move poolKeys
into NodeRuntime
if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about that. NodeRuntime
is more about the system process itself like sockets, system handles etc. TestnetNode
is rather for describing logical layer, like keys here.
With the amount of information we have now it can be one datatype I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
130551d
to
8ec596d
Compare
8ec596d
to
c4d12d1
Compare
-- > │ └── drep.{skey,vkey} | ||
-- > ├── genesis.{alonzo,conway}.spec.json | ||
-- > │ ├── drep{1,2,3} | ||
-- > │ │ └── drep.{skey,drep.vkey} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- > │ │ └── drep.{skey,drep.vkey} | |
-- > │ │ └── drep.{skey,vkey} |
The drep.{skey,vkey}
notation actually means drep.skey, drep.vkey
; when you unfold the brackets (as would bash do).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, sorry. A typo got in where I was doing those changes without thinking much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in: #6008
, isSpoNodeOptions | ||
, isRelayNodeOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I am not a big fan of exporting small helper functions like this. Users could just pattern match on the constructors, instead of using those functions.
Optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those functions are more readable than pattern matching on the constructor. This is more readable to me
when (isSpoNodeOptions nodeOptions) $ do
...
rather than more noisy case
:
case nodeOptions of
RelayNodeOptions{} -> pure ()
SpoNodeOptions{} -> do
...
Additionally, if you have a dedicated function, you can compose it.
, cardanoNodes = | ||
[ SpoNodeOptions Nothing [] | ||
, SpoNodeOptions Nothing [] | ||
, SpoNodeOptions Nothing [] | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, cardanoNodes = | |
[ SpoNodeOptions Nothing [] | |
, SpoNodeOptions Nothing [] | |
, SpoNodeOptions Nothing [] | |
] | |
, cardanoNodes = repeat 3 $ SpoNodeOptions Nothing [] |
@@ -79,6 +85,13 @@ data KeyPair k = KeyPair | |||
, signingKey :: forall dir. (File (SKey k) dir) | |||
} | |||
|
|||
type instance Element (KeyPair k) = FilePath | |||
instance MonoFunctor (KeyPair k) where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL MonoFunctor
😉 (it's nice!)
-- replicate votes requested number of times | ||
mkVotes :: [(Int, String)] -- ^ [(count, vote)] | ||
-> [(String, Int)] -- ^ [(vote, ordering number)] | ||
mkVotes votes = zip (concatMap (uncurry replicate) votes) [1..] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change 👍
, cardanoNodes = | ||
[ SpoNodeOptions Nothing [] | ||
, SpoNodeOptions Nothing [] | ||
, SpoNodeOptions Nothing [] | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, cardanoNodes = | |
[ SpoNodeOptions Nothing [] | |
, SpoNodeOptions Nothing [] | |
, SpoNodeOptions Nothing [] | |
] | |
, cardanoNodes = repeat 3 $ SpoNodeOptions Nothing [] |
Description
This PR changes default testnet configuration to start with 1 SPO and 2 Relay nodes. This PR also makes the testnet nodes count and role (SPO/relay) configurable.
It also reenables previously disabled tests, and runs them in parallel, reducing test suite execution time.
Things still not working yet:
Related:
Checklist
See Runnings tests for more details
CHANGELOG.md
for affected package.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7
Note on CI
If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.