Skip to content

workbench: support Conway #4987

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

Merged
merged 3 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@
};
};
nonRequiredPaths = [
#FIXME: hydraJobs.native.workbench-ci-test need some work to support Conway
"native\\.(.*\\.)?workbench-ci-test"
#FIXME: cardano-tracer-test for windows should probably be disabled in haskell.nix config:
"windows\\.(.*\\.)?checks\\.cardano-tracer\\.cardano-tracer-test"
#FIXME: plutus-scripts-bench (dep of tx-generator) does not compile for windows:
Expand Down
1 change: 1 addition & 0 deletions nix/nixos/tx-generator-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ in pkgs.commonLib.defServiceModule
"mary"
"alonzo"
"babbage"
"conway"
])
"mary"
"Cardano era to generate transactions for.";
Expand Down
13 changes: 12 additions & 1 deletion nix/workbench/backend/nixops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ let
AlonzoGenesisFile = "${genesis.files}/genesis.alonzo.json";
ShelleyGenesisFile = "${genesis.files}/genesis-shelley.json";
ByronGenesisFile = "${genesis.files}/byron/genesis.json";
ConwayGenesisFile = "${genesis.files}/genesis.conway.json";
in
rec {
profile = profileNix;
Expand Down Expand Up @@ -159,12 +160,14 @@ let
inherit AlonzoGenesisFile;
inherit ShelleyGenesisFile;
inherit ByronGenesisFile;
inherit ConwayGenesisFile;
};
nodeConfig = (removeAttrs envConfigBase.nodeConfig ["AlonzoGenesisHash"]) // {
Protocol = "Cardano";
inherit AlonzoGenesisFile;
inherit ShelleyGenesisFile;
inherit ByronGenesisFile;
inherit ConwayGenesisFile;
} // {
shelley =
{ TestShelleyHardForkAtEpoch = 0;
Expand All @@ -191,10 +194,18 @@ let
TestAlonzoHardForkAtEpoch = 0;
TestBabbageHardForkAtEpoch = 0;
};
conway =
{ TestShelleyHardForkAtEpoch = 0;
TestAllegraHardForkAtEpoch = 0;
TestMaryHardForkAtEpoch = 0;
TestAlonzoHardForkAtEpoch = 0;
TestBabbageHardForkAtEpoch = 0;
TestConwayHardForkAtEpoch = 0;
};
}.${profileNix.value.era};
txSubmitConfig = {
inherit (networkConfig) RequiresNetworkMagic;
inherit AlonzoGenesisFile ShelleyGenesisFile ByronGenesisFile;
inherit ConwayGenesisFile AlonzoGenesisFile ShelleyGenesisFile ByronGenesisFile;
} // pkgs.iohkNix.cardanoLib.defaultExplorerLogConfig;

## This is overlaid atop the defaults in the tx-generator service,
Expand Down
1 change: 1 addition & 0 deletions nix/workbench/chaindb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ snapshot-at-slot )
jq '{ AlonzoGenesisFile: .alonzo
, ByronGenesisFile: .byron
, ShelleyGenesisFile: .shelley
, ConwayGenesisFile: .conway
, ShelleyGenesisHash: "'$shelleyGenesisHash'"
, RequiresNetworkMagic: "RequiresNoMagic"
# , Protocol: "Cardano"
Expand Down
25 changes: 17 additions & 8 deletions nix/workbench/genesis/genesis.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
global_genesis_format_version=March-14-2022
global_genesis_format_version=March-14-2023

usage_genesis() {
usage "genesis" "Genesis" <<EOF
Expand Down Expand Up @@ -161,8 +161,15 @@ case "$op" in
"$global_basedir"/profile/presets/mainnet/genesis/genesis.alonzo.json \
> "$dir"/genesis.alonzo.spec.json

cardano-cli genesis create --genesis-dir "$dir"/ \
$(jq '.cli_args.createSpec | join(" ")' "$profile_json" --raw-output)
jq '{ genDelegs: {} }' --null-input \
> "$dir"/genesis.conway.spec.json

local create_args=(
--genesis-dir "$dir"/ $(jq '.cli_args.createSpec | join(" ")' "$profile_json" --raw-output)
)
verbose "genesis" "$(colorise cardano-cli genesis create ${create_args[*]})"
cardano-cli genesis create "${create_args[@]}" ||
fail "failed: $(colorise cardano-cli genesis create ${create_args[*]})"

## Overlay the verbatim genesis part into the profile spec:
local params=(
Expand Down Expand Up @@ -207,11 +214,13 @@ case "$op" in
| from_entries
' "$node_specs" > "$dir"/pool-relays.json

params=(--genesis-dir "$dir"
--relay-specification-file "$dir/pool-relays.json"
$(jq '.cli_args.createFinalBulk | join(" ")' "$profile_json" --raw-output)
)
time cardano-cli genesis create-staked "${params[@]}"
create_staked_args=(
--genesis-dir "$dir"
--relay-specification-file "$dir/pool-relays.json"
$(jq '.cli_args.createFinalBulk | join(" ")' "$profile_json" --raw-output)
)
verbose "genesis" "$(colorise cardano-cli genesis create-staked ${create_staked_args[*]})"
cardano-cli genesis create-staked "${create_staked_args[@]}"
jq . "$dir"/genesis.json > "$dir"/genesis-shelley.json &&
rm -f "$dir"/genesis.json
mv "$dir"/genesis.spec.json "$dir"/genesis-shelley.spec.json
Expand Down
1 change: 1 addition & 0 deletions nix/workbench/profile/profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ global_profile_eras=(
mary
alonzo
babbage
conway
)

profile_default_op='profile-json'
Expand Down
7 changes: 6 additions & 1 deletion nix/workbench/service/generator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let
AlonzoGenesisFile = "../genesis/genesis.alonzo.json";
ShelleyGenesisFile = "../genesis/genesis-shelley.json";
ByronGenesisFile = "../genesis/byron/genesis.json";
ConwayGenesisFile = "../genesis/genesis.conway.json";
} // optionalAttrs backend.useCabalRun {
executable = "tx-generator";
});
Expand All @@ -51,7 +52,11 @@ let
(__fromJSON (__readFile ../../../bench/tx-generator-config-base.json))
// { inherit (exemplarNode.nodeConfig.value)
Protocol
ShelleyGenesisFile ByronGenesisFile;
ByronGenesisFile
ShelleyGenesisFile
AlonzoGenesisFile
ConwayGenesisFile
;
};
in
finaliseGeneratorService profile
Expand Down
11 changes: 11 additions & 0 deletions nix/workbench/service/nodes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ let
AlonzoGenesisFile = "../genesis/genesis.alonzo.json";
ShelleyGenesisFile = "../genesis/genesis-shelley.json";
ByronGenesisFile = "../genesis/byron/genesis.json";
ConwayGenesisFile = "../genesis/genesis.conway.json";
}
);

Expand Down Expand Up @@ -161,12 +162,14 @@ let
[ "AlonzoGenesisHash"
"ByronGenesisHash"
"ShelleyGenesisHash"
"ConwayGenesisHash"
]
//
{
TestEnableDevelopmentHardForkEras = true;
TestEnableDevelopmentNetworkProtocols = true;
TurnOnLogMetrics = true;
SnapshotFrequency = 1100;
};
tracing-transform = {
trace-dispatcher = cfg:
Expand Down Expand Up @@ -209,6 +212,14 @@ let
TestAlonzoHardForkAtEpoch = 0;
TestBabbageHardForkAtEpoch = 0;
};
conway =
{ TestShelleyHardForkAtEpoch = 0;
TestAllegraHardForkAtEpoch = 0;
TestMaryHardForkAtEpoch = 0;
TestAlonzoHardForkAtEpoch = 0;
TestBabbageHardForkAtEpoch = 0;
TestConwayHardForkAtEpoch = 0;
};
}.${profile.era};
};
in
Expand Down