Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axelar Cork #209

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
54f4e05
clean build
mvid Apr 4, 2023
e726d40
bring over axelar module
mvid Apr 4, 2023
d190bfb
redo axelar corks with cork v2
mvid Apr 12, 2023
e93514c
rpc endpoints for hitting axelar
mvid Apr 14, 2023
bd81a11
cleanup for CLI
mvid Apr 17, 2023
83cde22
clean up CLI
mvid Apr 17, 2023
ec2739e
proposal trasnfered from gravity
mvid Apr 25, 2023
927c250
typo
mvid Apr 25, 2023
a885feb
update for heighliner
mvid May 3, 2023
f2877b3
genesis updates
mvid May 3, 2023
465c4c2
governance
mvid May 3, 2023
ee5fe9d
rename msg field
mvid May 3, 2023
a7bacc3
some review updates
mvid May 5, 2023
be1bffb
more review updates
mvid May 5, 2023
530fe58
even more review updates!
mvid May 5, 2023
9e18aad
proposal updates
mvid May 5, 2023
4cc1105
chain configs query
mvid May 5, 2023
29fe77e
comment updates
mvid May 6, 2023
0eeb0b2
fix issue with ID in key parsing
mvid May 17, 2023
b438612
add staking mocks
mvid May 17, 2023
c138859
all existing cork v2 tests pass
mvid May 17, 2023
1691acd
add mocks to sc
mvid May 17, 2023
4af566d
tests for middleware
mvid Jun 5, 2023
c19ea7c
empty payload
mvid Jun 5, 2023
05470ad
prost build
mvid Jun 20, 2023
200ff49
bring in changes from cork v2
mvid Jun 20, 2023
85cce47
actual prost build
mvid Jun 22, 2023
d49ed24
include modules
mvid Jun 22, 2023
2069278
namespace issue
mvid Jun 22, 2023
050d855
unique gov prop ids
mvid Jun 26, 2023
2514b01
unused interchain test
mvid Jun 26, 2023
1d61e92
go mod conflict
mvid Jun 26, 2023
51dff16
move scoped axelar keeper
mvid Jun 27, 2023
c22b34a
issue with params key table
mvid Jun 27, 2023
90db919
app.go fixes for axelar cork
mvid Jun 27, 2023
06340a7
something is funky with codec registrations
mvid Jun 27, 2023
5bab5af
more prop types
mvid Jun 29, 2023
6fb0c77
all proposals
mvid Jun 29, 2023
494d6d1
unit test pass
mvid Jun 29, 2023
54f88ae
clarify all registered types
mvid Jun 30, 2023
0695e31
newer protos broken for axelar cork
mvid Jun 30, 2023
b320c7d
downgrade bufbuild
mvid Jun 30, 2023
75febe0
old version cellar fees
mvid Jun 30, 2023
c0f091a
Bolten/test axelar buf (#220)
mvid Jun 30, 2023
e339a62
rebuild prost from new (old) buf build
mvid Jul 3, 2023
5e0b04e
compiles
mvid Jul 6, 2023
abb11d6
params unit tests
mvid Jul 6, 2023
d56e88c
lint pass
mvid Jul 6, 2023
cae2365
prost build
mvid Jul 6, 2023
0a5659c
validate disabled
mvid Jul 7, 2023
f5a3861
review pass
mvid Jul 13, 2023
f2c80e6
only chain id
mvid Jul 13, 2023
c047631
more updates
mvid Jul 16, 2023
ef1cc7f
import gravity module to pull delegate information
mvid Jul 19, 2023
33dc46b
adjust mocks
mvid Jul 19, 2023
ac62ab5
set protocgen back to previous
mvid Jul 19, 2023
86ae9dd
linting
mvid Jul 19, 2023
3757e0e
test configuration correct for scenario
mvid Jul 20, 2023
8f5d968
return proto update to previous style
mvid Jul 20, 2023
fe27312
resetting swagger script to previous
mvid Jul 20, 2023
c021d9f
another pass
mvid Jul 26, 2023
46ec04f
more changes
mvid Jul 26, 2023
3dc9011
cleanup local script changes for protos
mvid Jul 26, 2023
5a7b6d8
encode id to string on result retrieval
mvid Jul 26, 2023
40bb3c0
revert cellarfee protos
mvid Jul 26, 2023
30d1901
test update for hex
mvid Jul 26, 2023
5fb45e9
cork timeouts
mvid Jul 28, 2023
c19a92c
updates for unused cancel msg
mvid Jul 28, 2023
087ca62
several review comments
mvid Jul 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 15 additions & 151 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
BUILDDIR ?= $(CURDIR)/build
TEST_DOCKER_REPO=jackzampolin/sommtest
HTTPS_GIT := https://github.com/peggyjv/sommelier.git
BINDIR ?= $(GOPATH)/bin
SIMAPP = ./app

# for dockerized protobuf tools
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
BUF_IMAGE=bufbuild/buf@sha256:3cb1f8a4b48bd5ad8f09168f10f607ddc318af202f5c057d52a45216793d85e5 #v1.4.0
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(BUF_IMAGE)
HTTPS_GIT := https://github.com/peggyjv/sommelier.git

export GO111MODULE = on

Expand Down Expand Up @@ -76,10 +80,6 @@ endif
# The below include contains the tools target.
include contrib/devtools/Makefile

###############################################################################
EricBolten marked this conversation as resolved.
Show resolved Hide resolved
### Documentation ###
###############################################################################

all: install lint test

build: go.sum
Expand Down Expand Up @@ -137,9 +137,6 @@ sync-docs:
.PHONY: sync-docs


###############################################################################
### Tests & Simulation ###
###############################################################################

test: test-unit test-build

Expand All @@ -154,9 +151,6 @@ test-race:
test-cover:
@go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./...

test-build: build
@go test -mod=readonly -p 4 `go list ./cli_test/...` -tags=cli_test -v

benchmark:
@go test -mod=readonly -bench=. ./...

Expand Down Expand Up @@ -190,162 +184,32 @@ localnet-start: build-linux localnet-stop
localnet-stop:
docker-compose down

test-docker:
@docker build -f contrib/Dockerfile.test -t ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) .
@docker tag ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO}:$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
@docker tag ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO}:latest

test-docker-push: test-docker
@docker push ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD)
@docker push ${TEST_DOCKER_REPO}:$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
@docker push ${TEST_DOCKER_REPO}:latest

.PHONY: all build-linux install format lint \
go-mod-cache draw-deps clean build \
setup-transactions setup-contract-tests-data start-somm run-lcd-contract-tests contract-tests \
test test-all test-build test-cover test-unit test-race \
benchmark \
build-docker-sommnode localnet-start localnet-stop \
docker-single-node

###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.11.6
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

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

proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen sh ./scripts/protocgen.sh
@$(protoImage) sh ./scripts/protocgen.sh

proto-format:
@echo "Formatting Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace \
--workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name *.proto -exec .clang-format -i {} \;
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh

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

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

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
COSMOS_SDK_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master/proto/cosmos/base
GOOGLE_PROTO_URL = https://raw.githubusercontent.com/googleapis/googleapis/master/google/api
PROTOBUF_GOOGLE_URL = https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf

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

GOGO_PROTO_TYPES = third_party/proto/gogoproto
COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
GOOGLE_PROTO_TYPES = third_party/proto/google/api
PROTOBUF_GOOGLE_TYPES = third_party/proto/google/protobuf

SDK_ABCI_TYPES = third_party/proto/cosmos/base/abci/v1beta1
SDK_QUERY_TYPES = third_party/proto/cosmos/base/query/v1beta1
SDK_COIN_TYPES = third_party/proto/cosmos/base/v1beta1

proto-update-deps:
EricBolten marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p $(GOGO_PROTO_TYPES)
curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto

mkdir -p $(COSMOS_PROTO_TYPES)
curl -sSL $(COSMOS_PROTO_URL)/cosmos.proto > $(COSMOS_PROTO_TYPES)/cosmos.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_TYPES)
curl -sSL $(TM_URL)/types/types.proto > $(TM_TYPES)/types.proto
curl -sSL $(TM_URL)/types/evidence.proto > $(TM_TYPES)/evidence.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_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 $(TM_LIBS)
curl -sSL $(TM_URL)/libs/bits/types.proto > $(TM_LIBS)/types.proto

mkdir -p $(SDK_ABCI_TYPES)
curl -sSL $(COSMOS_SDK_PROTO_URL)/abci/v1beta1/abci.proto > $(SDK_ABCI_TYPES)/abci.proto

mkdir -p $(SDK_QUERY_TYPES)
curl -sSL $(COSMOS_SDK_PROTO_URL)/query/v1beta1/pagination.proto > $(SDK_QUERY_TYPES)/pagination.proto

mkdir -p $(SDK_COIN_TYPES)
curl -sSL $(COSMOS_SDK_PROTO_URL)/v1beta1/coin.proto > $(SDK_COIN_TYPES)/coin.proto

mkdir -p $(GOOGLE_PROTO_TYPES)
curl -sSL $(GOOGLE_PROTO_URL)/annotations.proto > $(GOOGLE_PROTO_TYPES)/annotations.proto
curl -sSL $(GOOGLE_PROTO_URL)/http.proto > $(GOOGLE_PROTO_TYPES)/http.proto
curl -sSL $(GOOGLE_PROTO_URL)/httpbody.proto > $(GOOGLE_PROTO_TYPES)/httpbody.proto

mkdir -p $(PROTOBUF_GOOGLE_TYPES)
curl -sSL $(PROTOBUF_GOOGLE_URL)/any.proto > $(PROTOBUF_GOOGLE_TYPES)/any.proto

PREFIX ?= /usr/local
BIN ?= $(PREFIX)/bin
UNAME_S ?= $(shell uname -s)
UNAME_M ?= $(shell uname -m)

BUF_VERSION ?= 0.11.0

PROTOC_VERSION ?= 3.11.2
ifeq ($(UNAME_S),Linux)
PROTOC_ZIP ?= protoc-${PROTOC_VERSION}-linux-x86_64.zip
endif
ifeq ($(UNAME_S),Darwin)
PROTOC_ZIP ?= protoc-${PROTOC_VERSION}-osx-x86_64.zip
endif

proto-tools: proto-tools-stamp buf

proto-tools-stamp:
echo "Installing protoc compiler..."
(cd /tmp; \
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"; \
unzip -o ${PROTOC_ZIP} -d $(PREFIX) bin/protoc; \
unzip -o ${PROTOC_ZIP} -d $(PREFIX) 'include/*'; \
rm -f ${PROTOC_ZIP})

echo "Installing protoc-gen-gocosmos..."
go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos

# Create dummy file to satisfy dependency and avoid
# rebuilding when this Makefile target is hit twice
# in a row
touch $@

buf: buf-stamp

buf-stamp:
echo "Installing buf..."
curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_S}-${UNAME_M}" \
-o "${BIN}/buf" && \
chmod +x "${BIN}/buf"

touch $@

tools-clean:
rm -f proto-tools-stamp buf-stampmodule

.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
EricBolten marked this conversation as resolved.
Show resolved Hide resolved
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

#####################
# Integration tests #
Expand Down
27 changes: 15 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ module github.com/peggyjv/sommelier/v6
go 1.19

require (
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.45.13
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.4.7
github.com/cosmos/ibc-go/v3 v3.4.0
github.com/ethereum/go-ethereum v1.10.11
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
Expand All @@ -20,11 +22,11 @@ require (
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.2
github.com/tendermint/tendermint v0.34.26
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6
google.golang.org/grpc v1.52.0
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f
google.golang.org/grpc v1.53.0
gopkg.in/yaml.v2 v2.4.0
)

Expand Down Expand Up @@ -81,6 +83,7 @@ require (
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
Expand Down Expand Up @@ -148,14 +151,14 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/term v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/tools v0.4.0 // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/protobuf v1.29.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading