Skip to content

Commit

Permalink
Merge pull request #1509 from input-output-hk/jpraynaud/activate-card…
Browse files Browse the repository at this point in the history
…ano-8.8.0-pre-e2e-test

Support Cardano node `8.9.0`
  • Loading branch information
jpraynaud authored Mar 18, 2024
2 parents 07be147 + b3c6c0a commit b3c4c18
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 45 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,13 @@ jobs:
matrix:
mode: [ "std" ]
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }}
cardano_node_version: [ "8.7.3" ]
cardano_node_version: [ "8.7.3", "8.8.1-pre", "8.9.0" ]
hard_fork_latest_era_at_epoch: [ 0,10,100 ]
run_id: [ "#1","#2" ]
run_id: [ "#1" ]
extra_args: [ "" ]

include:
# Include a hard fork test for `8.1.2` which is not concerned
# Include a test for `8.1.2` which is not concerned by the hard fork
- mode: "std"
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }}
cardano_node_version: "8.1.2"
Expand Down Expand Up @@ -527,7 +527,7 @@ jobs:
version-name: unstable-${{ steps.slug.outputs.sha8 }}
download-url-base: ${{ github.server_url }}/${{ github.repository }}/releases/download/unstable
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "⛔", "testing-preview": "✔" }'
compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "⛔", "testing-preview": "✔", "testing-sanchonet": "✔" }'

- name: Update unstable release
uses: marvinpinto/action-automatic-releases@latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
version-name: ${{ github.ref_name }}
download-url-base: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "✔", "testing-preview": "✔" }'
compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "✔", "testing-preview": "✔", "testing-sanchonet": "✔" }'

- name: Create pre-release ${{ github.ref_name }}
uses: marvinpinto/action-automatic-releases@latest
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions mithril-aggregator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN /app/target/release/mithril-aggregator --version
FROM debian:11-slim

# Args
ARG CARDANO_NODE_VERSION=8.7.3
ARG CARDANO_NODE_VERSION=8.9.0
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz

# Upgrade
Expand All @@ -47,16 +47,16 @@ COPY --from=rustbuilder /app/target/release/mithril-aggregator /app/bin/mithril-
# Copy the config files
COPY --from=rustbuilder /app/mithril-aggregator/config /app/config

#Workdir
WORKDIR /app/
RUN chown -R appuser /app/

# Install cardano-cli
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL
RUN tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin
RUN (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin)
RUN /app/bin/cardano-cli --version
RUN rm -f cardano-bin.tar.gz

#Workdir
WORKDIR /app/
RUN chown -R appuser /app/

# Use an unprivileged user
USER appuser

Expand Down
4 changes: 2 additions & 2 deletions mithril-aggregator/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ RUN mkdir -p /app/bin
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*

# Install cardano-cli
ARG CARDANO_NODE_VERSION=8.7.3
ARG CARDANO_NODE_VERSION=8.9.0
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \
&& tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin \
&& (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin) \
&& /app/bin/cardano-cli --version \
&& rm -f cardano-bin.tar.gz

Expand Down
2 changes: 1 addition & 1 deletion mithril-infra/assets/infra.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.11
0.2.12
17 changes: 14 additions & 3 deletions mithril-infra/assets/tools/pool/create-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,20 @@ CARDANO_CLI_CMD node issue-op-cert \
--out-file ${POOL_ARTIFACTS_DIR}/opcert.cert

### Create a registration certificate
CARDANO_CLI_CMD stake-address registration-certificate \
--stake-verification-key-file ${POOL_ARTIFACTS_DIR}/stake.vkey \
--out-file ${POOL_ARTIFACTS_DIR}/stake.cert
if [ "${CARDANO_ERA}" == "conway"]; then
KEY_REGISTRATION_DEPOSIT_ANOUNT=$(CARDANO_CLI_CMD ${CARDANO_ERA} query gov-state --testnet-magic ${NETWORK_MAGIC} | jq -r .enactState.curPParams.keyDeposit)
# Conway specific creation of registration certificate
CARDANO_CLI_CMD stake-address registration-certificate \
--stake-verification-key-file ${POOL_ARTIFACTS_DIR}/stake.vkey \
--out-file ${POOL_ARTIFACTS_DIR}/stake.cert \
--key-reg-deposit-amt $KEY_REGISTRATION_DEPOSIT_ANOUNT
else
# Legacy creation of registration certificate
CARDANO_CLI_CMD stake-address registration-certificate \
--stake-verification-key-file ${POOL_ARTIFACTS_DIR}/stake.vkey \
--out-file ${POOL_ARTIFACTS_DIR}/stake.cert
fi


### Compute Pool Id
POOL_ID=$(CARDANO_CLI_CMD stake-pool id --cold-verification-key-file ${POOL_ARTIFACTS_DIR}/cold.vkey)
Expand Down
12 changes: 6 additions & 6 deletions mithril-signer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN /app/target/release/mithril-signer --version
FROM debian:11-slim

# Args
ARG CARDANO_NODE_VERSION=8.7.3
ARG CARDANO_NODE_VERSION=8.9.0
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz

# Upgrade
Expand All @@ -48,16 +48,16 @@ COPY --from=rustbuilder /app/target/release/mithril-signer /app/bin/mithril-sign
# Copy the config files
COPY --from=rustbuilder /app/mithril-signer/config /app/config

#Workdir
WORKDIR /app/
RUN chown -R appuser /app/

# Install cardano-cli
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL
RUN tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin
RUN (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin)
RUN /app/bin/cardano-cli --version
RUN rm -f cardano-bin.tar.gz

#Workdir
WORKDIR /app/
RUN chown -R appuser /app/

# Use an unprivileged user
USER appuser

Expand Down
4 changes: 2 additions & 2 deletions mithril-signer/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ RUN mkdir -p /app/bin
RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*

# Install cardano-cli
ARG CARDANO_NODE_VERSION=8.7.3
ARG CARDANO_NODE_VERSION=8.9.0
ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz
RUN wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \
&& tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin \
&& (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin) \
&& /app/bin/cardano-cli --version \
&& rm -f cardano-bin.tar.gz

Expand Down
33 changes: 19 additions & 14 deletions mithril-test-lab/mithril-devnet/mkfiles/mkfiles-cardano.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ mkdir -p ${ARTIFACTS_DIR_TEMP}
# Step 1: Bootstrap the devnet artifacts
# Adapted from https://github.com/IntersectMBO/cardano-node/blob/master/scripts/babbage/mkfiles.sh

# Is semver on the first argument strictly lower than equal to the second argument?
version_lt() {
VERSION_LHS=$1
VERSION_RHS=$2
if [ "${VERSION_LHS}" != "${VERSION_RHS}" ] && [ "${VERSION_LHS}" = "`echo -e "${VERSION_LHS}\n${VERSION_RHS}" | sort -V | head -n1`" ]; then
echo "true"
else
echo "false"
fi
}

UNAME=$(uname -s) SED=
case $UNAME in
Darwin ) SED="gsed";;
Expand Down Expand Up @@ -72,11 +83,17 @@ $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 [ "${CARDANO_NODE_VERSION}" = "8.1.2" ]; then
if [ "${CARDANO_NODE_VERSION_RELEASE}" = "8.1.2" ]; then
# Fix 8.1.2, to avoid the following error: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: example/genesis.conway.spec.json Error: Error in $: key "genDelegs" 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 '. += {"genDelegs":{}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
fi

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

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 Expand Up @@ -188,18 +205,6 @@ for ADDR in ${USER_ADDRS}; do
--stake-verification-key-file addresses/${ADDR}-stake.vkey \
--testnet-magic ${NETWORK_MAGIC} \
--out-file addresses/${ADDR}-stake.addr

# Stake addresses registration certs
./cardano-cli stake-address registration-certificate \
--stake-verification-key-file addresses/${ADDR}-stake.vkey \
--out-file addresses/${ADDR}-stake.reg.cert

done

# User N will delegate to pool N
for N in ${POOL_NODES_N}; do
# Stake address delegation certs
./cardano-cli stake-address delegation-certificate \
--stake-verification-key-file addresses/user${N}-stake.vkey \
--cold-verification-key-file node-pool${N}/shelley/cold.vkey \
--out-file addresses/user${N}-stake.deleg.cert
done
7 changes: 5 additions & 2 deletions mithril-test-lab/mithril-devnet/mkfiles/mkfiles-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ esac
if [ -z "${CARDANO_NODE_VERSION}" ]; then
CARDANO_NODE_VERSION="8.7.3"
fi
if [ -z "${CARDANO_NODE_VERSION_RELEASE}" ]; then
CARDANO_NODE_VERSION_RELEASE=$(echo ${CARDANO_NODE_VERSION} | cut -d'-' -f1)
fi
if [ -z "${CARDANO_BINARY_URL}" ]; then
CARDANO_BINARY_URL="https://github.com/input-output-hk/cardano-node/releases/download/${CARDANO_NODE_VERSION}/cardano-node-${CARDANO_NODE_VERSION}-${OPERATING_SYSTEM}.tar.gz"
CARDANO_BINARY_URL="https://github.com/input-output-hk/cardano-node/releases/download/${CARDANO_NODE_VERSION}/cardano-node-${CARDANO_NODE_VERSION_RELEASE}-${OPERATING_SYSTEM}.tar.gz"
fi
if [ -z "${NETWORK_MAGIC}" ]; then
NETWORK_MAGIC=42
Expand Down Expand Up @@ -66,7 +69,7 @@ fi
if [[ "$SKIP_CARDANO_BIN_DOWNLOAD" != "true" ]]; then
echo ">> Downloading cardano-cli & cardano-node..."
curl -sL ${CARDANO_BINARY_URL} --output cardano-bin.tar.gz
tar xzf cardano-bin.tar.gz ./cardano-cli ./cardano-node
tar xzf cardano-bin.tar.gz ./bin/cardano-cli ./bin/cardano-node && mv ./bin/cardano-{cli,node} . && rm -rf ./bin || tar xzf cardano-bin.tar.gz ./cardano-cli ./cardano-node
rm -f cardano-bin.tar.gz
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,68 @@ CURRENT_EPOCH=\$(CARDANO_NODE_SOCKET_PATH=node-pool${N}/ipc/node.sock ./cardano-
--cardano-mode \\
--testnet-magic ${NETWORK_MAGIC} | jq .epoch)
echo ">>>> Current Epoch: \${CURRENT_EPOCH}"
# Is semver on the first argument strictly lower than the second argument?
version_lt() {
VERSION_LHS=\$1
VERSION_RHS=\$2
if [ "\${VERSION_LHS}" != "\${VERSION_RHS}" ] && [ "\${VERSION_LHS}" = "`echo -e "\${VERSION_LHS}\n\${VERSION_RHS}" | sort -V | head -n1`" ]; then
echo "true"
else
echo "false"
fi
}
# Is semver on the first argument lower or equal to the second argument?
version_lte() {
VERSION_LHS=\$1
VERSION_RHS=\$2
if [ "\${VERSION_LHS}" == "\${VERSION_RHS}" ]; then
echo "true"
else
version_lt $VERSION_LHS $VERSION_RHS
fi
}
# 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
KEY_REGISTRATION_DEPOSIT_ANOUNT=0
# Conway specific creation of registration certificate
./cardano-cli \${CURRENT_CARDANO_ERA} stake-address registration-certificate \
--stake-verification-key-file addresses/\${ADDR}-stake.vkey \
--out-file addresses/\${ADDR}-stake.reg.cert \
--key-reg-deposit-amt \$KEY_REGISTRATION_DEPOSIT_ANOUNT
else
# Legacy creation of registration certificate
./cardano-cli stake-address registration-certificate \
--stake-verification-key-file addresses/\${ADDR}-stake.vkey \
--out-file addresses/\${ADDR}-stake.reg.cert
fi
done
EOF

# User N will delegate to pool N
for N in ${POOL_NODES_N}; do
cat >> delegate.sh <<EOF
if [ \$(version_lte "${CARDANO_NODE_VERSION_RELEASE}" "8.1.2") == "false" ]; then
# Stake address delegation certs
./cardano-cli \${CURRENT_CARDANO_ERA} stake-address stake-delegation-certificate \
--stake-verification-key-file addresses/user${N}-stake.vkey \
--cold-verification-key-file node-pool${N}/shelley/cold.vkey \
--out-file addresses/user${N}-stake.deleg.cert
else
# Legacy stake address delegation certs
./cardano-cli \${CURRENT_CARDANO_ERA} stake-address delegation-certificate \
--stake-verification-key-file addresses/user${N}-stake.vkey \
--cold-verification-key-file node-pool${N}/shelley/cold.vkey \
--out-file addresses/user${N}-stake.deleg.cert
fi
EOF
done

# Prepare transactions for delegating to stake pools
for N in ${POOL_NODES_N}; do
cat >> delegate.sh <<EOF
Expand Down
2 changes: 1 addition & 1 deletion mithril-test-lab/mithril-end-to-end/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-end-to-end"
version = "0.4.5"
version = "0.4.6"
authors = { workspace = true }
edition = { workspace = true }
documentation = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion mithril-test-lab/mithril-end-to-end/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Args {
cardano_epoch_length: f64,

/// Cardano node version
#[clap(long, default_value = "8.7.3")]
#[clap(long, default_value = "8.9.0")]
cardano_node_version: String,

/// Epoch at which hard fork to the latest Cardano era will be made (starts with the latest era by default)
Expand Down

0 comments on commit b3c4c18

Please sign in to comment.