Skip to content

Commit

Permalink
chore: rebase with main and resovle conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbormann committed Nov 7, 2024
2 parents 0ff64a9 + 8a31684 commit 03dda9c
Show file tree
Hide file tree
Showing 86 changed files with 4,274 additions and 3,704 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ jobs:
mode: ["std"]
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }}
next_era: [""]
cardano_node_version: ["9.1.1", "9.2.1", "10.1.1"]
cardano_node_version: ["9.1.1", "9.2.1", "10.1.2"]
hard_fork_latest_era_at_epoch: [0]
run_id: ["#1", "#2"]
extra_args: [""]
Expand Down
180 changes: 166 additions & 14 deletions .github/workflows/nightly-backward-compatibility.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Nightly backward compatibility

on:
# Important note about scheduled workflows:
# Notifications for scheduled workflows are sent to the user who last modified the cron syntax in the workflow file.
schedule:
- cron: "0 2 * * *"
- cron: "0 14 * * *"
- cron: "30 2 * * *"
workflow_dispatch:
inputs:
total-releases:
Expand All @@ -15,22 +16,58 @@ on:
description: "Cardano node version used in e2e"
required: true
type: string
default: "10.1.1"
default: "10.1.2"
signed-entity-types:
description: "Signed entity types parameters (discriminants names in an ordered comma separated list)"
required: true
type: string
default: "CardanoTransactions,CardanoStakeDistribution"

jobs:
prepare-env-variables:
runs-on: ubuntu-22.04
outputs:
total_releases: ${{ steps.set-env.outputs.total_releases }}
cardano_node_version: ${{ steps.set-env.outputs.cardano_node_version }}
signed-entity-types: ${{ steps.set-env.outputs.signed-entity-types }}
steps:
- name: Prepare env variables
id: set-env
shell: bash
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "total_releases=3" >> $GITHUB_OUTPUT
echo 'cardano_node_version=["10.1.2"]' >> $GITHUB_OUTPUT
echo 'signed-entity-types=CardanoTransactions,CardanoStakeDistribution' >> $GITHUB_OUTPUT
else
echo "total_releases=${{ inputs.total-releases }}" >> $GITHUB_OUTPUT
echo "cardano_node_version=[\"${{ inputs.cardano-node-version }}\"]" >> $GITHUB_OUTPUT
echo 'signed-entity-types=${{ inputs.signed-entity-types }}' >> $GITHUB_OUTPUT
fi
prepare-binaries:
runs-on: ubuntu-22.04
needs: [prepare-env-variables]
outputs:
tags: ${{ steps.tags-test-lab.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download releases artifacts binaries
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
./.github/workflows/scripts/download-distribution-binaries.sh ${{ inputs.total-releases }
./.github/workflows/scripts/download-distribution-binaries.sh ${{ needs.prepare-env-variables.outputs.total_releases }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Build e2e
shell: bash
run: |
cargo build --release --bin mithril-end-to-end
cp ./target/release/mithril-end-to-end ./mithril-binaries/unstable
Expand All @@ -43,21 +80,21 @@ jobs:

- name: Prepare test lab tags
id: tags-test-lab
shell: bash
run: |
TAGS=$(cat ./mithril-binaries/tags.json)
TAGS=$(jq -c '.' ./mithril-binaries/tags.json)
echo "Test Lab Tags: $TAGS"
echo "tags=$TAGS" >> $GITHUB_OUTPUT
e2e:
runs-on: ubuntu-22.04
needs: [prepare-binaries]
needs: [prepare-env-variables, prepare-binaries]
strategy:
fail-fast: false
matrix:
tag: ${{ fromJSON(needs.prepare-binaries.outputs.tags) }}
node:
[mithril-aggregator, mithril-client, mithril-signer, mithril-relay]
cardano_node_version: ${{ inputs.cardano-node-version }}
node: [mithril-aggregator, mithril-client, mithril-signer]
cardano_node_version: ${{ fromJSON(needs.prepare-env-variables.outputs.cardano_node_version) }}
run_id: ["#1"]

steps:
Expand All @@ -71,6 +108,7 @@ jobs:
path: ./mithril-binaries

- name: Prepare binaries
shell: bash
run: |
mkdir -p mithril-binaries/e2e
cp ./mithril-binaries/unstable/* ./mithril-binaries/e2e
Expand All @@ -84,9 +122,123 @@ jobs:
mkdir artifacts
- name: Run E2E tests
shell: bash
run: |
./mithril-binaries/e2e/mithril-end-to-end -vvv \
--bin-directory ./mithril-binaries/e2e \
--work-directory=./artifacts \
--devnet-scripts-directory=./mithril-test-lab/mithril-devnet \
--cardano-node-version ${{ matrix.cardano_node_version }} \
--cardano-slot-length 0.25 \
--cardano-epoch-length 45.0 \
--signed-entity-types ${{ needs.prepare-env-variables.outputs.signed-entity-types }} \
&& echo "SUCCESS=true" >> $GITHUB_ENV \
|| (echo "SUCCESS=false" >> $GITHUB_ENV && exit 1)
- name: Define the JSON file name for the test result
shell: bash
if: success() || failure()
run: echo "RESULT_FILE_NAME=e2e-test-result-run_${{ github.run_number }}-attempt_${{ github.run_attempt }}-tag_${{ matrix.tag }}-node-${{ matrix.node }}-cardano-${{ matrix.cardano_node_version }}-run_id_${{ matrix.run_id }}" >> $GITHUB_ENV

- name: Write test result JSON
if: success() || failure()
shell: bash
run: |
AGGREGATOR_TAG="unstable"
SIGNER_TAG="unstable"
CLIENT_TAG="unstable"
case "$NODE" in
mithril-aggregator)
AGGREGATOR_TAG="${{ matrix.tag }}"
;;
mithril-signer)
SIGNER_TAG="${{ matrix.tag }}"
;;
mithril-client)
CLIENT_TAG="${{ matrix.tag }}"
;;
esac
jq -n --arg TAG "${{ matrix.tag }}" \
--arg NODE "${{ matrix.node }}" \
--arg CARDANO_NODE "${{ matrix.cardano_node_version }}" \
--arg AGGREGATOR "$AGGREGATOR_TAG" \
--arg SIGNER "$SIGNER_TAG" \
--arg CLIENT "$CLIENT_TAG" \
--argjson SUCCESS "${{ env.SUCCESS }}" \
'{tag: $TAG, node: $NODE, mithril_signer: $SIGNER, mithril_aggregator: $AGGREGATOR, mithril_client: $CLIENT, cardano_node_version: $CARDANO_NODE, success: $SUCCESS}' \
> ./${{ env.RESULT_FILE_NAME }}.json
- name: Upload test result JSON
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ env.RESULT_FILE_NAME }}
path: ./${{ env.RESULT_FILE_NAME }}.json

- name: Upload E2E Tests Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: mithril-e2e-tests-artifacts-run_${{ github.run_number }}-attempt_${{ github.run_attempt }}-tag_${{ matrix.tag }}-node-${{ matrix.node }}-cardano-${{ matrix.cardano_node_version }}-run_id_${{ matrix.run_id }}
path: |
./artifacts/*
# including node.sock makes the upload fails so exclude them:
!./artifacts/**/node.sock
# exclude cardano tools, saving ~50mb of data:
!./artifacts/devnet/cardano-cli
!./artifacts/devnet/cardano-node
if-no-files-found: error

summarize-test-results:
runs-on: ubuntu-22.04
needs: [prepare-env-variables, e2e]
if: success() || failure()

steps:
- name: Download all test result artifacts
uses: actions/download-artifact@v4
with:
path: ./test-results
pattern: e2e-test-result*
merge-multiple: true

- name: Concatenate JSON result files into summary.json
shell: bash
run: |
jq -s '.' ./test-results/e2e-test-result-*.json > ./test-results/summary.json
- name: Add distributions backward compatibility summary
shell: bash
run: |
./mithril-binaries/e2e/mithril-end-to-end -vvv \\
--bin-directory ./mithril-binaries/e2e \\
--work-directory=./artifacts \\
--devnet-scripts-directory=./mithril-test-lab/mithril-devnet \\
--cardano-node-version ${{ matrix.cardano_node_version }}
CHECK_MARK=":heavy_check_mark:"
CROSS_MARK=":no_entry:"
echo "## Distributions backward compatibility" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "This is the compatibility report of previous distributions nodes with the current unstable nodes." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Signed entity types**: ${{ needs.prepare-env-variables.outputs.signed-entity-types }}" >> $GITHUB_STEP_SUMMARY
echo "**Cardano nodes**: ${{ needs.prepare-env-variables.outputs.cardano_node_version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Compatibility | mithril-signer | mithril-aggregator | mithril-client |" >> $GITHUB_STEP_SUMMARY
echo "| --- | :---: | :---: | :---: |" >> $GITHUB_STEP_SUMMARY
# Transform summary.json into Markdown table rows
jq -r --arg CHECK_MARK "$CHECK_MARK" --arg CROSS_MARK "$CROSS_MARK" \
'group_by(.tag) |
sort_by(.[0].tag | tonumber) | reverse |
.[] |
{
tag: .[0].tag,
signer: (map(select(.node == "mithril-signer") | if .success then $CHECK_MARK else $CROSS_MARK end) | join("")),
aggregator: (map(select(.node == "mithril-aggregator") | if .success then $CHECK_MARK else $CROSS_MARK end) | join("")),
client: (map(select(.node == "mithril-client") | if .success then $CHECK_MARK else $CROSS_MARK end) | join(""))
} |
"| `\(.tag)` | \(.signer) | \(.aggregator) | \(.client) |"' "./test-results/summary.json" >> $GITHUB_STEP_SUMMARY
cat "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion .github/workflows/test-docker-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
description: The url of the archive of the Cardano binaries
required: true
type: string
default: https://github.com/IntersectMBO/cardano-node/releases/download/10.1.1/cardano-node-10.1.1-linux.tar.gz
default: https://github.com/IntersectMBO/cardano-node/releases/download/10.1.2/cardano-node-10.1.2-linux.tar.gz
dry_run:
description: Dry run will not push the Docker images to the registry
required: true
Expand Down
20 changes: 14 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ As a minor extension, we have adopted a slightly different versioning convention

## Mithril Distribution [XXXX] - UNRELEASED

- **BREAKING** changes in Mithril client Lib, CLI, and WASM:
- Crates versions:

- Remove deprecated `beacon` field from mithril certificates.
- Clients from distribution [`2430`](#mithril-distribution-24300---2024-07-30) and above are compatible with this change.
| Crate | Version |
| ----- | ------- |
| N/A | `-` |

- Support for Prometheus metrics endpoint in aggregator
## Mithril Distribution [2445.0] - UNRELEASED

- Fix an issue that caused unnecessary re-scan of the Cardano chain when importing transactions.
- **BREAKING** changes in Mithril client library, CLI, and WASM:

- Remove deprecated `beacon` field from Mithril certificates.
- Clients from distribution [`2430`](#mithril-distribution-24300---2024-07-30) and above are compatible with this change.

- Support for Prometheus metrics endpoint in aggregator.

- Support for stable Cardano stake distribution client library, CLI and WASM.

- Support for `Cardano node` `10.1.2` in the signer and the aggregator.

- Deprecate `protocol` and `next_protocol` in favor of `signer_registration_protocol` in the `/epoch-settings` route.

- Support for `Cardano node` `10.1.1` in the signer and the aggregator.
- Fix an issue that caused unnecessary re-scan of the Cardano chain when importing transactions.

- Crates versions:

Expand Down
Loading

0 comments on commit 03dda9c

Please sign in to comment.