From bfb521a09d59cd44f07432a17386360f8d233769 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 26 Feb 2024 21:55:10 +0200 Subject: [PATCH 1/5] yay 1.22 --- .github/workflows/buildtest.yaml | 145 +++---------------- .github/workflows/codeql.yml | 2 +- .github/workflows/docker.yaml | 2 +- .github/workflows/golangci.yml | 2 +- .github/workflows/icq-relayer-build-test.yml | 4 +- .github/workflows/interchaintest.yaml | 8 +- .github/workflows/simulation.yml | 2 +- go.mod | 2 +- 8 files changed, 32 insertions(+), 135 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 000140ef8..6802f6bb2 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -1,131 +1,28 @@ # This is a basic workflow that is manually triggered -name: build and test - -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. -on: - pull_request: - branches: - - main - - develop - - unstable - - unstable-v1.5 - paths-ignore: - - 'quicksilverjs/**' - - 'webui/**' - workflow_dispatch: - push: - branches: - - main - - develop - - unstable - - unstable-v1.5 - paths-ignore: - - 'quicksilverjs/**' - - 'webui/**' - - -# This workflow makes x86_64 for windows, and linux. - +on: [push, pull_request] +name: Build and Test jobs: - build: - strategy: - matrix: - arch: [amd64] - targetos: [linux, windows, darwin] - include: - - targetos: darwin - arch: arm64 - runs-on: ubuntu-latest - name: build quicksilver - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.21" - env: - GOOS: ${{ matrix.targetos }} - GOARCH: ${{ matrix.arch }} - - - - name: Compile quicksilver - run: | - make install - - - name: Archive quicksilver binaries - if: github.ref == 'refs/heads/develop' - uses: actions/upload-artifact@v4 - with: - name: quicksilverd-${{ matrix.targetos }}-${{ matrix.arch }} - path: | - ~/go/bin/quicksilverd* - test: - runs-on: ubuntu-latest - name: test quicksilver strategy: matrix: - arch: [amd64] - targetos: [linux, windows] - include: - - targetos: darwin - arch: arm64 + go-version: [1.22.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.21" - env: - GOOS: ${{ matrix.targetos }} - GOARCH: ${{ matrix.arch }} - - - - name: test quicksilver - run: | - make test-unit-cover - - - name: filter out DONTCOVER - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -name '*.pb.gw.go')" - excludelist+=" $(find ./ -type f -path './test/*.go')" - excludelist+=" $(find ./ -type f -path './third-party-chains/*.go')" - for filename in ${excludelist}; do - filename=$(echo $filename | sed 's/^./github.com\/quicksilver-zone\/quicksilver/g') - echo "Excluding ${filename} from coverage report..." - sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt - done - - - name: "Go vulnerability checks" - continue-on-error: true - run: make vulncheck - - - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} # needed for private repo - files: ./coverage.txt - flags: unittests - fail_ci_if_error: true - verbose: true - - simulate: - if: contains(github.event.pull_request.labels.*.name, 'run-sim') - runs-on: ubuntu-latest - name: simulate quicksilver - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - uses: actions/setup-go@v5 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - run: go test ./... + build: + strategy: + matrix: + go-version: [1.22.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: "1.21" - - name: Run simulation tests - run: make test-sim-ci + go-version: ${{ matrix.go-version }} + - run: go build ./... \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 29635ff57..48fbad3fc 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.21.7 + go-version: "1.22" # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 238142867..62cfc4fb4 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" - name: Setup Golang caches uses: actions/cache@v4 diff --git a/.github/workflows/golangci.yml b/.github/workflows/golangci.yml index ded3c71dc..c73343f5b 100644 --- a/.github/workflows/golangci.yml +++ b/.github/workflows/golangci.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.21.x' + go-version: '1.22' cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v4 diff --git a/.github/workflows/icq-relayer-build-test.yml b/.github/workflows/icq-relayer-build-test.yml index 80e3cb192..73684b434 100644 --- a/.github/workflows/icq-relayer-build-test.yml +++ b/.github/workflows/icq-relayer-build-test.yml @@ -5,7 +5,7 @@ jobs: test: strategy: matrix: - go-version: [1.21.x] + go-version: [1.22.x] os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: @@ -19,7 +19,7 @@ jobs: build: strategy: matrix: - go-version: [1.21.x] + go-version: [1.22.x] os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/interchaintest.yaml b/.github/workflows/interchaintest.yaml index 38c3545f8..5737dad7e 100644 --- a/.github/workflows/interchaintest.yaml +++ b/.github/workflows/interchaintest.yaml @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" - name: Setup Golang caches uses: actions/cache@v4 @@ -58,7 +58,7 @@ jobs: - name: Set up go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" id: go - name: checkout chain @@ -75,7 +75,7 @@ jobs: - name: Set up go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" id: go - name: checkout chain @@ -92,7 +92,7 @@ jobs: - name: Set up go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" id: go - name: checkout chain diff --git a/.github/workflows/simulation.yml b/.github/workflows/simulation.yml index dfb9e7dfb..45d80e874 100644 --- a/.github/workflows/simulation.yml +++ b/.github/workflows/simulation.yml @@ -19,7 +19,7 @@ jobs: ${{ runner.os }}-go- - uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" - name: Run simulation tests run: make test-sim-non-determinism diff --git a/go.mod b/go.mod index 2bd47909b..81932b419 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/quicksilver-zone/quicksilver -go 1.21 +go 1.22 require ( cosmossdk.io/errors v1.0.1 From 5691d45808677e5fc32181abea5a5c845262f1bf Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 26 Feb 2024 21:58:36 +0200 Subject: [PATCH 2/5] bump go --- icq-relayer/go.mod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/icq-relayer/go.mod b/icq-relayer/go.mod index 9ee712c87..370245079 100644 --- a/icq-relayer/go.mod +++ b/icq-relayer/go.mod @@ -1,6 +1,8 @@ module github.com/quicksilver-zone/quicksilver/icq-relayer -go 1.21 +go 1.22 + +toolchain go1.22.0 require ( github.com/cosmos/cosmos-sdk v0.46.15 From 62e8520dc47f7ad93387f67583a1d17a162272a4 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 26 Feb 2024 22:00:31 +0200 Subject: [PATCH 3/5] but who would have guessed the fix? i wouldn't have --- architecture/adr-002-sub-zones.md | 179 ----------------------------- 1 file changed, 179 deletions(-) delete mode 100644 architecture/adr-002-sub-zones.md diff --git a/architecture/adr-002-sub-zones.md b/architecture/adr-002-sub-zones.md deleted file mode 100644 index 37503ac36..000000000 --- a/architecture/adr-002-sub-zones.md +++ /dev/null @@ -1,179 +0,0 @@ -ADR 002: Sub-Zones -Changelog -2023-06-02: Initial Draft (@aljo242) -Status -DRAFT - -Abstract - -Sub zones on Quicksilver refers to registering a chain on Quicksilver with a tailor-made validator subset and distribution for an enterprise use case. -The primary benefit of sub zones is for users to be able to issue their own qAsset with their own risk parameters and validator distribution. -These assets also know as ‘sub assets’ are not fungible with qAssets in its current form, though with the LSM in place it becomes possible for these assets to become practically fungible. - -Context - -The current implementation of a `Zone` is: - -```proto -message Zone { - string connection_id = 1; - string chain_id = 2; - ICAAccount deposit_address = 3; - ICAAccount withdrawal_address = 4; - ICAAccount performance_address = 5; - ICAAccount delegation_address = 6; - string account_prefix = 7; - string local_denom = 8; - string base_denom = 9; - string redemption_rate = 10 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string last_redemption_rate = 11 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - repeated Validator validators = 12; - repeated ValidatorIntent aggregate_intent = 13 [(gogoproto.castrepeated) = "ValidatorIntents"]; - bool multi_send = 14; // deprecated - bool liquidity_module = 15; - uint32 withdrawal_waitgroup = 16; - bytes ibc_next_validators_hash = 17; - uint64 validator_selection_allocation = 18; - uint64 holdings_allocation = 19; - int64 last_epoch_height = 20; // deprecated - string tvl = 21 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - int64 unbonding_period = 22; - int64 messages_per_tx = 23; - int64 decimals = 24; - bool unbonding_enabled = 25; - bool deposits_enabled = 26; - bool return_to_sender = 27; - bool is_118 = 28; -} -``` - -Alternatives - -Sub-zones could also be implemented as an array of "subzoneID-authority" tuples that are stored themselves on the parent zone. -This would mean that the existing member functions of a `Zone` could not be directly accessed by a sub zone, making things a bit more complicated in the implementation. -This alternative would be more clearer that a sub-zone is actually not a new "zone" meaning chain. - -Decision - -We will add the following fields to the `Zone` struct: - -```proto -message Zone { - string connection_id = 1; - string chain_id = 2; - ICAAccount deposit_address = 3; - ICAAccount withdrawal_address = 4; - ICAAccount performance_address = 5; - ICAAccount delegation_address = 6; - string account_prefix = 7; - string local_denom = 8; - string base_denom = 9; - string redemption_rate = 10 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string last_redemption_rate = 11 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - repeated Validator validators = 12; - repeated ValidatorIntent aggregate_intent = 13 [(gogoproto.castrepeated) = "ValidatorIntents"]; - bool multi_send = 14; // deprecated - bool liquidity_module = 15; - uint32 withdrawal_waitgroup = 16; - bytes ibc_next_validators_hash = 17; - uint64 validator_selection_allocation = 18; - uint64 holdings_allocation = 19; - int64 last_epoch_height = 20; // deprecated - string tvl = 21 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - int64 unbonding_period = 22; - int64 messages_per_tx = 23; - int64 decimals = 24; - bool unbonding_enabled = 25; - bool deposits_enabled = 26; - bool return_to_sender = 27; - bool is_118 = 28; - SubzoneInfo subzoneInfo = 29; -} - -message SubzoneInfo { - string authority = 1; - string base_chainID = 2; -} -``` -The `SubzoneInfo` `authority` field is the whilelisted Quicksilver account which controls this subzone. The `BaseChainID` -field is a reference to the "base" or "parent" chain that this zone is a sub-zone of. For example, if a base zone for -the Cosmos Hub with chainID "gaia-5" exists, an `authority` could propose to create a new `sub-zone` with "gaia-5" as its -base zone. - -If `SubzoneInfo` and is non-empty, then the zone is a subzone. We can add the following helper function: - -```go -func (z *Zone) IsSubzone() bool { - return z.SubZoneInfo != nil -} -``` - -Subzones now effectively have two "chainIDs": the unique ID created by the `authority` when the zone is created, and the -`BaseChainID` which refers to the base zone. We can create helper functions to simplify translation: - -```go -func (z *Zone) ChainID() string { - if z.IsSubzone() { - return z.SubzoneInfo.BaseChainID - } - - return z.ChainId} - -func (z *Zone) ID() string { - return z.ChainId -} -``` - -The `zone.ChainID()` function will always return the chainID of the running Cosmos SDK chain that this `zone` is representing. -The `zone.ID()` function will always return the unique identifier for this `zone`. These helper functions should be used in place of -all direct accesses to the `zone.ChainId` variable. - -Consequences -This section describes the resulting context, after applying the decision. All consequences should be listed here, not just the "positive" ones. A particular decision may have positive, negative, and neutral consequences, but all of them affect the team and project in the future. - -Backwards Compatibility -All ADRs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The ADR must explain how the author proposes to deal with these incompatibilities. ADR submissions without a sufficient backwards compatibility treatise may be rejected outright. - -Positive -{positive consequences} - -Negative -{negative consequences} - -Neutral -{neutral consequences} - -Further Discussions -While an ADR is in the DRAFT or PROPOSED stage, this section should contain a summary of issues to be solved in future iterations (usually referencing comments from a pull-request discussion). - -Later, this section can optionally list ideas or improvements the author or reviewers found during the analysis of this ADR. - -Test Cases [optional] -Test cases for an implementation are mandatory for ADRs that are affecting consensus changes. Other ADRs can choose to include links to test cases if applicable. - -References -{reference link} \ No newline at end of file From 851241eef3bcf1b6e6a524e750b353078a3f0e5b Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 26 Feb 2024 22:14:06 +0200 Subject: [PATCH 4/5] Update buildtest.yaml --- .github/workflows/buildtest.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 6802f6bb2..19eb2e2c5 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -6,7 +6,7 @@ jobs: strategy: matrix: go-version: [1.22.x] - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -25,4 +25,4 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - - run: go build ./... \ No newline at end of file + - run: go build ./... From d6e6604fce27e2ab04dfd1b309fa27ba056f9da6 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 26 Feb 2024 22:20:06 +0200 Subject: [PATCH 5/5] windows isnt real --- .github/workflows/buildtest.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 6802f6bb2..b13b118a7 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -6,7 +6,7 @@ jobs: strategy: matrix: go-version: [1.22.x] - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -18,7 +18,7 @@ jobs: strategy: matrix: go-version: [1.22.x] - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3