Transaction Version Update Check #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Transaction Version Update Check | |
on: | |
workflow_dispatch: | |
inputs: | |
endpoint: | |
description: The endpoint to the calamari or manta mainnet. | |
required: false | |
chain: | |
description: The name of the chain under test. Usually, you would pass a local chain | |
default: manta-local | |
required: true | |
env: | |
AWS_REGION: us-east-1 | |
AWS_INSTANCE_TYPE: c5.4xlarge | |
AWS_INSTANCE_ROOT_VOLUME_SIZE: 32 | |
AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* | |
AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' | |
CHAIN: ${{github.event.inputs.chain}} | |
ENDPOINT: ${{github.event.inputs.endpoint}} | |
jobs: | |
start-checks: | |
timeout-minutes: 120 | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [16.x] | |
outputs: | |
runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} | |
aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} | |
aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} | |
steps: | |
- id: start-self-hosted-runner | |
uses: audacious-network/[email protected] | |
with: | |
mode: start | |
github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} | |
aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} | |
aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} | |
aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} | |
- uses: actions/checkout@v2 | |
- uses: borales/[email protected] | |
- name: install sccache | |
env: | |
SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download | |
SCCACHE_VERSION: v0.5.3 | |
run: | | |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl | |
mkdir -p $HOME/.local/bin | |
curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz | |
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache | |
chmod +x $HOME/.local/bin/sccache | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo- | |
- name: cache sccache | |
uses: actions/cache@v2 | |
continue-on-error: false | |
with: | |
path: /home/runner/.cache/sccache | |
key: sccache-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
sccache- | |
- name: start sccache server | |
run: sccache --start-server | |
- name: init | |
run: | | |
sudo apt update | |
sudo apt install -y pkg-config libssl-dev protobuf-compiler | |
protoc --version | |
sudo apt remove -y '^dotnet-.*' | |
sudo apt remove -y '^mongodb-.*' | |
sudo apt remove -y '^mysql-.*' | |
sudo apt remove -y '^postgresql-*' | |
sudo apt remove -y google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri | |
sudo apt autoremove -y | |
sudo apt clean | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /usr/share/dotnet | |
curl -s https://sh.rustup.rs -sSf | sh -s -- -y | |
source ${HOME}/.cargo/env | |
rustup toolchain install nightly-2023-03-03 | |
rustup default nightly-2023-03-03 | |
rustup target add wasm32-unknown-unknown | |
# - name: Build New Binary | |
# env: | |
# RUST_BACKTRACE: full | |
# RUSTC_WRAPPER: sccache | |
# SCCACHE_CACHE_SIZE: 2G | |
# SCCACHE_DIR: /home/runner/.cache/sccache | |
# run: | | |
# source ${HOME}/.cargo/env | |
# RUSTC_BOOTSTRAP=1 cargo build --release | |
# chmod +x target/release/manta | |
- name: Fetch and chmod old release binary | |
run: | | |
curl -L -o $HOME/manta https://github.com/Manta-Network/Manta/releases/download/v4.3.1-binary-build/manta | |
chmod +x $HOME/manta | |
ls -ahl $HOME/ | |
- name: stop sccache server | |
run: sccache --stop-server || true | |
- name: Install pm2 | |
run: npm install -g pm2 | |
- name: Start latest manta node | |
run: | | |
echo Running on $CHAIN | |
RELAYCHAIN=kusama | |
ENDPOINT=wss://calamari.systems | |
if [[ "$CHAIN" == *"manta"* ]]; then | |
ENDPOINT=wss://ws.manta.systems | |
RELAYCHAIN=polkadot | |
echo "It's going to diff runtime metadata for $CHAIN with endpoint $ENDPOINT." | |
fi; | |
pm2 start --name diff-metadata "$HOME/manta --chain=$CHAIN --port 30555 --base-path ./temp1 --ws-port 9955 -- --chain $RELAYCHAIN" | |
- name: Prepare output | |
run: | | |
VERSION=$(./target/release/manta --version) | |
echo "Metadata comparison:" >> output.txt | |
echo "Date: $(date)" >> output.txt | |
echo "Target version: $VERSION" >> output.txt | |
echo "Chain: $CHAIN" >> output.txt | |
echo "----------------------------------------------------------------------" >> output.txt | |
- uses: actions/checkout@v2 | |
with: | |
repository: polkadot-js/tools | |
path: tools | |
- name: Compare the metadata | |
run: | | |
pm2 logs diff-metadata --lines=200 | |
ENDPOINT=wss://calamari.systems | |
if [[ "$CHAIN" == *"manta"* ]]; then | |
ENDPOINT=wss://ws.manta.systems | |
fi; | |
echo $ENDPOINT | |
cd ${{ github.workspace }}/tools | |
yarn | |
CMD="yarn run:metadata $ENDPOINT ws://localhost:9955" | |
echo -e "Running:\n$CMD" | |
$CMD >> output.txt | |
sed -z -i 's/\n\n/\n/g' output.txt | |
cat output.txt | egrep -n -i '' | |
chmod +x ./scripts/github/extrinsic-ordering-filter.sh | |
SUMMARY=$(./scripts/github/extrinsic-ordering-filter.sh output.txt) | |
echo -e $SUMMARY | |
echo -e $SUMMARY >> output.txt | |
- name: Show result | |
run: | | |
cat output.txt | |
- name: Stop our local node | |
run: pkill manta | |
- if: always() | |
name: Save output as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.CHAIN }} | |
path: | | |
output.txt | |
stop-checks: | |
needs: start-checks | |
runs-on: ubuntu-20.04 | |
if: ${{ always() }} | |
steps: | |
- continue-on-error: true | |
uses: audacious-network/[email protected] | |
with: | |
mode: stop | |
github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ needs.start-checks.outputs.aws-region }} | |
runner-label: ${{ needs.start-checks.outputs.runner-label }} | |
aws-instance-id: ${{ needs.start-checks.outputs.aws-instance-id }} | |
- name: discard stopper success/failure | |
run: true |