Skip to content

Commit

Permalink
Merge branch 'main' into shawn/throttle-with-retries-consumer-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Jun 23, 2023
2 parents 81d88e3 + 6e3164c commit 2e554b3
Show file tree
Hide file tree
Showing 247 changed files with 5,181 additions and 9,959 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git/
Dockerfile
*.md
.gitignore
.gitattributes
scripts/
.vscode/
.github/
proto/
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ please add links to any relevant follow up issues.*
I have...

* [ ] Included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
* [ ] Added `!` to the type prefix if API or client breaking change
* [ ] Added `!` to the type prefix if state-machine breaking change (i.e., requires coordinated upgrade)
* [ ] Confirmed this PR does not introduce changes requiring state migrations, OR migration code has been added to consumer and/or provider modules
* [ ] Targeted the correct branch (see [PR Targeting](https://github.com/cosmos/interchain-security/blob/main/CONTRIBUTING.md#pr-targeting))
* [ ] Provided a link to the relevant issue or specification
Expand Down
12 changes: 11 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ updates:
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
- dependencies
- dependencies

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
target-branch: "release/v3.0.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
- dependencies
2 changes: 1 addition & 1 deletion .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19" # The Go version to download (if necessary) and use.
go-version: "1.20" # The Go version to download (if necessary) and use.
- name: Proto Check
run: make proto-check
- name: Unit, integration and difference tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19" # The Go version to download (if necessary) and use.
go-version: "1.20" # The Go version to download (if necessary) and use.
- name: Test with coverage
run: go test -coverpkg=./x/... -coverprofile=coverage.out ./...
- name: SonarCloud Scan
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: "1.20"
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: "1.20"
- uses: actions/checkout@v3

- name: Checkout LFS objects
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19" # The Go version to download (if necessary) and use.
go-version: "1.20" # The Go version to download (if necessary) and use.

- name: E2E tests
run: make test-e2e
2 changes: 1 addition & 1 deletion .github/workflows/nightly-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: "1.20"

- uses: actions/checkout@v3

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Protobuf
# Protobuf runs buf (https://buf.build/) lint and check-breakage
# This workflow is only run when a .proto file has been changed
on:
pull_request:
paths:
- "proto/**"

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"

break-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
8 changes: 8 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ pull_request_rules:
backport:
branches:
- release/v2.0.x
- 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
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@

Add an entry to the unreleased section whenever merging a PR to main that is not targeted at a specific release. These entries will eventually be included in a release.

## v.2.0.0
## v3.0.0

Date: June 21st, 2023

Interchain Security v3 uses SDK 0.47 and IBC 7.

* (deps) [#1019](https://github.com/cosmos/interchain-security/pull/1019) Bump multiple dependencies.
* Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.3).
* Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.1.0](https://github.com/cosmos/ibc-go/releases/tag/v7.1.0).
* Bump [CometBFT](https://github.com/cometbft/cometbft) to [v0.37.1](https://github.com/cometbft/cometbft/releases/tag/v0.37.1).
* `[x/ccv/provider]` (fix) [#945](https://github.com/cosmos/interchain-security/issues/945) Refactor `AfterUnbondingInitiated` to not panic when `PutUnbondingOnHold` returns error.
* `[x/ccv/provider]` (fix) [#977](https://github.com/cosmos/interchain-security/pull/977) Avoids panicking the provider when an unbonding delegation was removed through a `CancelUnbondingDelegation` message.
* `[x/ccv/democracy]` (feat) [#1019](https://github.com/cosmos/interchain-security/pull/1019) Whitelisting non-legacy params in the "democracy module" require the entire module to be whitelisted.

## v2.0.0

Date: June 1st, 2023

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1

FROM golang:1.19-alpine AS is-builder

FROM golang:1.20-alpine AS is-builder

ENV PACKAGES curl make git libc-dev bash gcc linux-headers
RUN apk add --no-cache $PACKAGES
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.gaia
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# build latest tagged gaia
FROM golang:1.19-alpine AS gaia-builder
FROM golang:1.20-alpine AS gaia-builder
# WORKDIR is set to /go by default
ARG USE_GAIA_TAG
ENV GAIA_TAG=${USE_GAIA_TAG}
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN go mod tidy
RUN go list -m github.com/cosmos/cosmos-sdk
RUN make build

FROM golang:1.19-alpine AS is-builder
FROM golang:1.20-alpine AS is-builder

ENV PACKAGES curl make git libc-dev bash gcc linux-headers
RUN apk add --no-cache $PACKAGES
Expand Down
134 changes: 39 additions & 95 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ install: go.sum
test:
go test ./... && go run ./tests/e2e/...

# run all unit tests
test-unit:
go test ./...

# run unit and integration tests
test-short:
go test ./x/... ./app/... ./tests/integration/...
Expand Down Expand Up @@ -102,123 +106,63 @@ $(BUILDDIR)/:
### Protobuf ###
###############################################################################

containerProtoVer=0.9.0
DOCKER := $(shell which docker)
HTTPS_GIT := https://github.com/cosmos/interchain-security.git

containerProtoVer=0.13.0
containerProtoImage=ghcr.io/cosmos/proto-builder:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)
containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer)

protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage)


proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protocgen.sh; fi
@$(protoImage) sh ./scripts/protocgen.sh;

proto-check:
@if git diff --quiet; then \
echo "No files were modified before running 'make proto-gen'."; \
else \
echo "Error: Uncommitted changes exist before running 'make proto-gen'. Please commit or stash your changes."; \
exit 1; \
fi
@$(MAKE) proto-gen
@if git diff --quiet; then \
echo "No files were modified after running 'make proto-gen'. Pass!"; \
@if git diff --quiet --exit-code main...HEAD -- proto; then \
echo "Pass! No committed changes found in /proto directory between the currently checked out branch and main."; \
else \
echo "Error: Files were modified after running 'make proto-gen'. Please commit changes to .pb files"; \
exit 1; \
fi

echo "Committed changes found in /proto directory between the currently checked out branch and main."; \
modified_protos=$$(git diff --name-only main...HEAD proto); \
modified_pb_files= ; \
for proto_file in $${modified_protos}; do \
proto_name=$$(basename "$${proto_file}" .proto); \
pb_files=$$(find x/ccv -name "$${proto_name}.pb.go"); \
for pb_file in $${pb_files}; do \
if git diff --quiet --exit-code main...HEAD -- "$${pb_file}"; then \
echo "Missing committed changes in $${pb_file}"; \
exit 1; \
else \
modified_pb_files+="$${pb_file} "; \
fi \
done \
done; \
echo "Pass! Correctly modified pb files: "; \
echo $${modified_pb_files}; \
fi

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protoc-swagger-gen.sh; fi
@$(protoImage) sh ./scripts/protocgen.sh

proto-lint:
@$(DOCKER_BUF) lint --error-format=json
@$(protoImage) buf lint --error-format=json

proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.5/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.7.1
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
SDK_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.13-ics/proto/cosmos

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
TM_ABCI_TYPES = third_party/proto/tendermint/abci
TM_TYPES = third_party/proto/tendermint/types
TM_VERSION = third_party/proto/tendermint/version
TM_LIBS = third_party/proto/tendermint/libs/bits
TM_P2P = third_party/proto/tendermint/p2p

SDK_QUERY = third_party/proto/cosmos/base/query/v1beta1
SDK_BASE = third_party/proto/cosmos/base/v1beta1
SDK_UPGRADE = third_party/proto/cosmos/upgrade/v1beta1
SDK_STAKING = third_party/proto/cosmos/staking/v1beta1
SDK_EVIDENCE = third_party/proto/cosmos/evidence/v1beta1

GOGO_PROTO_TYPES = third_party/proto/gogoproto
CONFIO_TYPES = third_party/proto/confio
COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main

proto-update-deps:
@mkdir -p $(COSMOS_PROTO_TYPES)
@curl -sSL $(COSMOS_PROTO_URL)/cosmos.proto > $(COSMOS_PROTO_TYPES)/cosmos.proto

@mkdir -p $(SDK_QUERY)
@curl -sSL $(SDK_PROTO_URL)/base/query/v1beta1/pagination.proto > $(SDK_QUERY)/pagination.proto

@mkdir -p $(SDK_BASE)
@curl -sSL $(SDK_PROTO_URL)/base/v1beta1/coin.proto > $(SDK_BASE)/coin.proto

@mkdir -p $(SDK_UPGRADE)
@curl -sSL $(SDK_PROTO_URL)/upgrade/v1beta1/upgrade.proto > $(SDK_UPGRADE)/upgrade.proto

@mkdir -p $(SDK_STAKING)
@curl -sSL $(SDK_PROTO_URL)/staking/v1beta1/staking.proto > $(SDK_STAKING)/staking.proto

@mkdir -p $(SDK_EVIDENCE)
@curl -sSL $(SDK_PROTO_URL)/evidence/v1beta1/evidence.proto > $(SDK_EVIDENCE)/evidence.proto

## Importing of tendermint protobuf definitions currently requires the
## use of `sed` in order to build properly with cosmos-sdk's proto file layout
## (which is the standard Buf.build FILE_LAYOUT)
## Issue link: https://github.com/tendermint/tendermint/issues/5021
@mkdir -p $(TM_TYPES)
@curl -sSL $(TM_URL)/types/types.proto > $(TM_TYPES)/types.proto
@curl -sSL $(TM_URL)/types/params.proto > $(TM_TYPES)/params.proto
@curl -sSL $(TM_URL)/types/validator.proto > $(TM_TYPES)/validator.proto

@mkdir -p $(TM_ABCI_TYPES)
@curl -sSL $(TM_URL)/abci/types.proto > $(TM_ABCI_TYPES)/types.proto

@mkdir -p $(TM_VERSION)
@curl -sSL $(TM_URL)/version/types.proto > $(TM_VERSION)/types.proto

@mkdir -p $(TM_LIBS)
@curl -sSL $(TM_URL)/libs/bits/types.proto > $(TM_LIBS)/types.proto

@mkdir -p $(TM_CRYPTO_TYPES)
@curl -sSL $(TM_URL)/crypto/proof.proto > $(TM_CRYPTO_TYPES)/proof.proto
@curl -sSL $(TM_URL)/crypto/keys.proto > $(TM_CRYPTO_TYPES)/keys.proto

@mkdir -p $(CONFIO_TYPES)
@curl -sSL $(CONFIO_URL)/proofs.proto > $(CONFIO_TYPES)/proofs.proto

## insert go package option into proofs.proto file
## Issue link: https://github.com/confio/ics23/issues/32
@perl -i -l -p -e 'print "option go_package = \"github.com/confio/ics23/go\";" if $$. == 4' $(CONFIO_TYPES)/proofs.proto
@echo "Updating Protobuf dependencies"
$(protoImage) buf mod update

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps mocks
.PHONY: proto-all proto-gen proto-format proto-lint proto-check proto-check-breaking proto-update-deps mocks

###############################################################################
### Documentation ###
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ For more details on the Replicated Security protocol, take a look at the [docs](
```bash
## For OSX or Linux

# go 1.18 (https://formulae.brew.sh/formula/go)
brew install go@1.19
# go 1.20 (https://formulae.brew.sh/formula/go)
brew install go@1.20
# jq (optional, for testnet) (https://formulae.brew.sh/formula/jq)
brew install jq
# docker (optional, for integration tests, testnet) (https://docs.docker.com/get-docker/)
Expand Down
Loading

0 comments on commit 2e554b3

Please sign in to comment.