Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bernd/1133-e2e-compat…
Browse files Browse the repository at this point in the history
…iblity-tests
  • Loading branch information
bermuell committed Jan 22, 2024
2 parents f6055c6 + eed7627 commit 9a07246
Show file tree
Hide file tree
Showing 50 changed files with 919 additions and 573 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1570-slashack-bech32.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix the validation of VSCPackets to not fail due to marshaling to string using Bech32.
([\#1570](https://github.com/cosmos/interchain-security/pull/1570))
2 changes: 2 additions & 0 deletions .changelog/unreleased/state-breaking/1570-slashack-bech32.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix the validation of VSCPackets to not fail due to marshaling to string using Bech32.
([\#1570](https://github.com/cosmos/interchain-security/pull/1570))
22 changes: 6 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ updates:
labels:
- dependencies

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
target-branch: "release/v2.0.x-lsm"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
- dependencies

- package-ecosystem: gomod
directory: "/"
schedule:
Expand All @@ -47,12 +37,12 @@ updates:
open-pull-requests-limit: 0
labels:
- dependencies

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
target-branch: "release/v3.0.x"
target-branch: "release/v3.1.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
Expand All @@ -62,17 +52,17 @@ updates:
directory: "/"
schedule:
interval: daily
target-branch: "release/v3.1.x"
target-branch: "release/v3.2.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
- dependencies

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
target-branch: "release/v3.2.x"
target-branch: "release/v3.3.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
Expand All @@ -82,7 +72,7 @@ updates:
directory: "/"
schedule:
interval: daily
target-branch: "release/v3.3.x"
target-branch: "release/v4.0.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
Expand Down
103 changes: 0 additions & 103 deletions .github/workflows/manual-e2e.yml

This file was deleted.

55 changes: 52 additions & 3 deletions .github/workflows/nightly-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Run integration tests nightly on main

# !! Relevant changes to this file should be propagated manual-integration.yml

name: nightly-e2e-main
on:
workflow_dispatch:
schedule:
# run every day at 03:00 UTC
# ┌───────────── minute (0 - 59)
Expand Down Expand Up @@ -114,6 +112,54 @@ jobs:
go-version: "1.21" # The Go version to download (if necessary) and use.
- name: E2E multi-consumer tests
run: go run ./tests/e2e/... --tc multiconsumer
consumer-misbehaviour-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- uses: actions/checkout@v4
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21" # The Go version to download (if necessary) and use.
- name: E2E consumer-misbehaviour tests
run: go run ./tests/e2e/... --tc consumer-misbehaviour
consumer-double-sign-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- uses: actions/checkout@v4
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21" # The Go version to download (if necessary) and use.
- name: E2E consumer-double-sign tests
run: go run ./tests/e2e/... --tc consumer-double-sign
consumer-double-downtime-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- uses: actions/checkout@v4
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21" # The Go version to download (if necessary) and use.
- name: E2E consumer-double-downtime tests
run: go run ./tests/e2e/... --tc consumer-double-downtime

nightly-test-fail:
needs:
Expand All @@ -123,6 +169,9 @@ jobs:
- democracy-test
- slash-throttle-test
- multiconsumer-test
- consumer-misbehaviour-test
- consumer-double-sign-test
- consumer-double-downtime-test
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
**/go.sum
**/Makefile
Makefile
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: |
~/.cache/go-build
Expand Down
24 changes: 8 additions & 16 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ pull_request_rules:
backport:
branches:
- release/v2.0.x
- name: Backport patches to the release/v2.0.x-lsm branch
conditions:
- base=main
- label=A:backport/v2.0.x-lsm
actions:
backport:
branches:
- release/v2.0.x-lsm
- name: Backport patches to the release/v2.4.x-lsm branch
conditions:
- base=main
Expand All @@ -34,14 +26,6 @@ pull_request_rules:
backport:
branches:
- release/v2.4.x-lsm
- name: Backport patches to the release/v3.0.x branch
conditions:
- base=main
- label=A:backport/v3.0.x
actions:
backport:
branches:
- release/v3.0.x
- name: Backport patches to the release/v3.1.x branch
conditions:
- base=main
Expand All @@ -66,3 +50,11 @@ pull_request_rules:
backport:
branches:
- release/v3.3.x
- name: Backport patches to the release/v4.0.x branch
conditions:
- base=main
- label=A:backport/v4.0.x
actions:
backport:
branches:
- release/v4.0.x
28 changes: 24 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
#!/usr/bin/make -f

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')

# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell git describe --exact-match 2>/dev/null)
# if VERSION is empty, then populate it with branch's name and raw commit hash
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif

sharedFlags = -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)

providerFlags := $(sharedFlags) -X github.com/cosmos/cosmos-sdk/version.AppName=interchain-security-pd -X github.com/cosmos/cosmos-sdk/version.Name=interchain-security-pd
consumerFlags := $(sharedFlags) -X github.com/cosmos/cosmos-sdk/version.AppName=interchain-security-cd -X github.com/cosmos/cosmos-sdk/version.Name=interchain-security-cd
democracyFlags := $(sharedFlags) -X github.com/cosmos/cosmos-sdk/version.AppName=interchain-security-cdd -X github.com/cosmos/cosmos-sdk/version.Name=interchain-security-cdd
standaloneFlags := $(sharedFlags) -X github.com/cosmos/cosmos-sdk/version.AppName=interchain-security-sd -X github.com/cosmos/cosmos-sdk/version.Name=interchain-security-sd

install: go.sum
export GOFLAGS='-buildmode=pie'
export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2"
export CGO_LDFLAGS="-Wl,-z,relro,-z,now -fstack-protector"
go install $(BUILD_FLAGS) ./cmd/interchain-security-pd
go install $(BUILD_FLAGS) ./cmd/interchain-security-cd
go install $(BUILD_FLAGS) ./cmd/interchain-security-cdd
go install $(BUILD_FLAGS) ./cmd/interchain-security-sd
go install -ldflags "$(providerFlags)" ./cmd/interchain-security-pd
go install -ldflags "$(consumerFlags)" ./cmd/interchain-security-cd
go install -ldflags "$(democracyFlags)" ./cmd/interchain-security-cdd
go install -ldflags "$(standaloneFlags)" ./cmd/interchain-security-sd

# run all tests: unit, integration, diff, and E2E
test: test-unit test-integration test-mbt test-e2e
Expand Down
48 changes: 48 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

This guide provides instructions for upgrading to specific versions of Replicated Security.

## [v4.0.x](https://github.com/cosmos/interchain-security/tree/release/v4.0.x)

`v4.0.x` sets the minimum required version of Go to `1.21`, see https://github.com/cosmos/interchain-security/blob/release/v4.0.x/go.mod#L3.

### Provider

Upgrading a provider from `v3.3.0` to `v4.0.0` will require state migrations, see https://github.com/cosmos/interchain-security/blob/release/v4.0.x/x/ccv/provider/migrations/migrator.go#L31.

### Consumer

***Note that consumer chains can upgrade directly from `v3.1.0` to `v4.0.0`.***

Upgrading a consumer from `v3.2.0` to `v4.0.0` will not require state migration, however, upgrading directly from `v3.1.0` to `v4.0.0` will require state migrations, see https://github.com/cosmos/interchain-security/blob/release/v4.0.x/x/ccv/consumer/keeper/migrations.go#L22.

In addition, the following migration needs to be added to the upgrade handler of the consumer chain:
```golang
func migrateICSOutstandingDowntime(ctx sdk.Context, keepers *upgrades.UpgradeKeepers) error {
ctx.Logger().Info("Migrating ICS outstanding downtime...")

downtimes := keepers.ConsumerKeeper.GetAllOutstandingDowntimes(ctx)
for _, od := range downtimes {
consAddr, err := sdk.ConsAddressFromBech32(od.ValidatorConsensusAddress)
if err != nil {
return err
}
keepers.ConsumerKeeper.DeleteOutstandingDowntime(ctx, consAddr)
}

ctx.Logger().Info("Finished ICS outstanding downtime")

return nil
}
```

## [v3.3.x](https://github.com/cosmos/interchain-security/tree/release/v3.2.x)

### Provider

Upgrading the provider from `v2.x.y` to `v3.3.0` will not require state migration.

## [v3.2.x](https://github.com/cosmos/interchain-security/tree/release/v3.2.x)

`v3.2.0` bumps IBC to `v7.3`. As a result, `legacy_ibc_testing` is not longer required and was removed, see https://github.com/cosmos/interchain-security/pull/1185. This means that when upgrading to `v3.2.0`, any customized tests relying on `legacy_ibc_testing` need to be updated.

### Consumer

Upgrading the consumer from either `v3.0.0` or `v3.1.0` to `v3.2.0` will require state migrations, see https://github.com/cosmos/interchain-security/blob/release/v3.2.x/x/ccv/consumer/keeper/migration.go#L25.

## [v3.0.x](https://github.com/cosmos/interchain-security/releases/tag/v3.0.0-rc0)

### Upgrading to Cosmos SDK 0.47
Expand Down
Loading

0 comments on commit 9a07246

Please sign in to comment.