Skip to content

Commit

Permalink
chore: remove hacks for Cardano '8.8.0+' in devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jpraynaud committed Sep 3, 2024
1 parent 7e268b7 commit 3825714
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
24 changes: 0 additions & 24 deletions mithril-test-lab/mithril-devnet/mkfiles/mkfiles-cardano.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,6 @@ $CARDANO_CLI byron genesis genesis \
cp $SCRIPT_DIRECTORY/configuration/babbage/alonzo-babbage-test-genesis.json "${ARTIFACTS_DIR_TEMP}/genesis.alonzo.spec.json"
cp $SCRIPT_DIRECTORY/configuration/babbage/conway-babbage-test-genesis.json "${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json"

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.8.0") = "false" ]; then
# Fix >=8.8.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $.poolVotingThresholds: key "motionNoConfidence" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"poolVotingThresholds": {"motionNoConfidence": 0.51, "committeeNormal": 0.51, "committeeNoConfidence": 0.51, "hardForkInitiation": 0.51, "ppSecurityGroup": 0.51}, "dRepVotingThresholds": {"motionNoConfidence": 0.51, "committeeNormal": 0.51, "committeeNoConfidence": 0.51, "updateToConstitution": 0.51, "hardForkInitiation": 0.51, "ppNetworkGroup": 0.51, "ppEconomicGroup": 0.51, "ppTechnicalGroup": 0.51, "ppGovGroup": 0.51, "treasuryWithdrawal": 0.51}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.9.1") = "false" ]; then
# Fix >=8.9.1, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $.committee: key "quorum" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"committee": {"quorum": 0.51, "members": {}}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.10.0") = "false" ]; then
# Fix >=8.10.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $: key "minFeeRefScriptCostPerByte" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"minFeeRefScriptCostPerByte": 0, "committee": {"members": {}, "threshold": 0.67}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.11.0") = "false" ]; then
# Fix >=8.11.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $: key "plutusV3CostModel" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"plutusV3CostModel": []}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

cp $SCRIPT_DIRECTORY/configuration/byron/configuration.yaml "${ARTIFACTS_DIR_TEMP}/"
$SED -i "${ARTIFACTS_DIR_TEMP}/configuration.yaml" \
-e 's/Protocol: RealPBFT/Protocol: Cardano/' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ version_lte() {
# Stake addresses registration certs
for ADDR in ${USER_ADDRS}; do
if [ \$(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.8.0") == "false" ] && [ "\${CURRENT_CARDANO_ERA}" == "conway" ]; then
if [ "\${CURRENT_CARDANO_ERA}" == "conway" ]; then
KEY_REGISTRATION_DEPOSIT_ANOUNT=0
# Conway specific creation of registration certificate
$CARDANO_CLI \${CURRENT_CARDANO_ERA} stake-address registration-certificate \
Expand Down

0 comments on commit 3825714

Please sign in to comment.