Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
Browse files Browse the repository at this point in the history
…alization3
  • Loading branch information
rigelrozanski committed May 15, 2019
2 parents 36a37a8 + 805de8b commit 5c428b8
Show file tree
Hide file tree
Showing 58 changed files with 1,681 additions and 362 deletions.
44 changes: 7 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ version: 2
defaults: &linux_defaults
working_directory: /go/src/github.com/cosmos/cosmos-sdk
docker:
- image: circleci/golang:1.12.4
environment:
GOBIN: /tmp/workspace/bin
- image: circleci/golang:1.12.5


############
Expand All @@ -17,16 +15,15 @@ macos_config: &macos_defaults
xcode: "10.1.0"
working_directory: /Users/distiller/project/src/github.com/cosmos/cosmos-sdk
environment:
GO_VERSION: "1.12.4"
GO_VERSION: "1.12.5"

set_macos_env: &macos_env
run:
name: Set environment
command: |
echo 'export PATH=$PATH:$HOME/go/bin' >> $BASH_ENV
echo 'export GOPATH=$HOME/project' >> $BASH_ENV
echo 'export GOBIN=$GOPATH/bin' >> $BASH_ENV
echo 'export PATH=$PATH:$HOME/go/bin:$GOBIN' >> $BASH_ENV
echo 'export PATH=$PATH:$HOME/go/bin:$GOPATH/bin' >> $BASH_ENV
echo 'export GO111MODULE=on'
############
Expand All @@ -40,12 +37,6 @@ docs_update: &docs_deploy
environment:
AWS_REGION: us-east-1

deps: &dependencies
run:
name: dependencies
command: |
export PATH="$GOBIN:$PATH"
jobs:
setup_dependencies:
<<: *linux_defaults
Expand All @@ -59,13 +50,11 @@ jobs:
- run:
name: tools
command: |
export PATH="$GOBIN:$PATH"
make tools
- *dependencies
make tools TOOLS_DESTDIR=/tmp/workspace/bin
- run:
name: binaries
command: |
export PATH="$GOBIN:$PATH"
export PATH=/tmp/workspace/bin:$PATH
make go-mod-cache
make install
- save_cache:
Expand All @@ -85,14 +74,13 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Lint source
command: |
export PATH="$GOBIN:$PATH"
export PATH=/tmp/workspace/bin:$PATH
make ci-lint
integration_tests:
Expand All @@ -102,14 +90,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test cli
command: |
export PATH="$GOBIN:$PATH"
make test_cli
test_sim_gaia_nondeterminism:
Expand All @@ -119,14 +105,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test individual module simulations
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_nondeterminism
test_sim_gaia_fast:
Expand All @@ -136,14 +120,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test full Gaia simulation
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_fast
test_sim_gaia_import_export:
Expand All @@ -153,14 +135,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test Gaia import/export simulation
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_import_export
test_sim_gaia_simulation_after_import:
Expand All @@ -170,14 +150,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test Gaia import/export simulation
command: |
export PATH="$GOBIN:$PATH"
make test_sim_gaia_simulation_after_import
test_sim_gaia_multi_seed_long:
Expand All @@ -187,14 +165,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test multi-seed Gaia simulation long
command: |
export PATH="$GOBIN:$PATH"
export GO111MODULE=on
make runsim
runsim 500 50 TestFullGaiaSimulation
Expand All @@ -206,14 +182,12 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Test multi-seed Gaia simulation short
command: |
export PATH="$GOBIN:$PATH"
export GO111MODULE=on
make runsim
runsim 50 10 TestFullGaiaSimulation
Expand All @@ -225,15 +199,13 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- run: mkdir -p /tmp/logs
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Run tests
command: |
export PATH="$GOBIN:$PATH"
export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')"
export GO111MODULE=on
for pkg in $(go list ./... | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test | grep -v '/simulation' | circleci tests split --split-by=timings); do
Expand All @@ -254,7 +226,6 @@ jobs:
- attach_workspace:
at: /tmp/workspace
- checkout
- *dependencies
- run:
name: gather
command: |
Expand Down Expand Up @@ -283,11 +254,10 @@ jobs:
machine:
image: circleci/classic:latest
environment:
GOBIN: /home/circleci/.go_workspace/bin
GOPATH: /home/circleci/.go_workspace/
GOOS: linux
GOARCH: amd64
GO_VERSION: "1.12.4"
GO_VERSION: "1.12.5"
parallelism: 1
steps:
- checkout
Expand Down
2 changes: 2 additions & 0 deletions .pending/breaking/gaia/4027-gaiad-and-gaiac
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#4027 gaiad and gaiacli version commands do not return the checksum of the go.sum file shipped along with the source release tarball.
Go modules feature guarantees dependencies reproducibility and as long as binaries are built via the Makefile shipped with the sources, no dependendencies can break such guarantee.
1 change: 1 addition & 0 deletions .pending/breaking/sdk/4262-GoSumHash-is-no
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#4262 GoSumHash is no longer returned by the version command.
1 change: 1 addition & 0 deletions .pending/breaking/sdk/4342-https-github-co
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[#4342](https://github.com/cosmos/cosmos-sdk/pull/4342) Upgrade go-amino to v0.15.0
1 change: 1 addition & 0 deletions .pending/bugfixes/gaiacli/4190-Fix-redelegatio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#4190 Fix redelegations-from by using the correct params and query endpoint.
1 change: 1 addition & 0 deletions .pending/bugfixes/sdk/4273-Fix-usage-of-Ap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#4273 Fix usage of AppendTags in x/staking/handler.go
1 change: 0 additions & 1 deletion .pending/improvements/gaia/4261-Upgrade-toolcha

This file was deleted.

1 change: 1 addition & 0 deletions .pending/improvements/gaia/4343-Upgrade-toolcha
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#4343 Upgrade toolchain to Go 1.12.5.
1 change: 1 addition & 0 deletions .pending/improvements/sdk/2286-Improve-perform
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2286 Improve performance of CacheKVStore iterator.
2 changes: 2 additions & 0 deletions .pending/improvements/sdk/4190-Client-response
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#4190 Client responses that return (re)delegation(s) now return balances
instead of shares.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
FROM golang:alpine AS build-env

# Set up dependencies
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python

# Set working directory for the build
WORKDIR /go/src/github.com/cosmos/cosmos-sdk
Expand Down
32 changes: 19 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
GOBIN ?= $(GOPATH)/bin
GOSUM := $(shell which gosum)
BINDIR ?= $(GOPATH)/bin

export GO111MODULE = on

Expand Down Expand Up @@ -42,16 +41,17 @@ endif
build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=gaia \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)"

ifneq ($(GOSUM),)
ldflags += -X github.com/cosmos/cosmos-sdk/version.GoSumHash=$(shell $(GOSUM) go.sum)
endif
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

ifeq ($(WITH_CLEVELDB),yes)
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down Expand Up @@ -119,6 +119,12 @@ draw_deps: tools
clean:
rm -rf snapcraft-local.yaml build/

distclean: clean
rm -rf \
gitian-build-darwin/ \
gitian-build-linux/ \
gitian-build-windows/ \
.gitian-builder-cache/

########################################
### Documentation
Expand Down Expand Up @@ -164,20 +170,20 @@ test_sim_gaia_fast:

test_sim_gaia_import_export: runsim
@echo "Running Gaia import/export simulation. This may take several minutes..."
$(GOBIN)/runsim 50 5 TestGaiaImportExport
$(BINDIR)/runsim 50 5 TestGaiaImportExport

test_sim_gaia_simulation_after_import: runsim
@echo "Running Gaia simulation-after-import. This may take several minutes..."
$(GOBIN)/runsim 50 5 TestGaiaSimulationAfterImport
$(BINDIR)/runsim 50 5 TestGaiaSimulationAfterImport

test_sim_gaia_custom_genesis_multi_seed: runsim
@echo "Running multi-seed custom genesis simulation..."
@echo "By default, ${HOME}/.gaiad/config/genesis.json will be used."
$(GOBIN)/runsim -g ${HOME}/.gaiad/config/genesis.json 400 5 TestFullGaiaSimulation
$(BINDIR)/runsim -g ${HOME}/.gaiad/config/genesis.json 400 5 TestFullGaiaSimulation

test_sim_gaia_multi_seed: runsim
@echo "Running multi-seed Gaia simulation. This may take awhile!"
$(GOBIN)/runsim 400 5 TestFullGaiaSimulation
$(BINDIR)/runsim 400 5 TestFullGaiaSimulation

test_sim_benchmark_invariants:
@echo "Running simulation invariant benchmarks..."
Expand All @@ -186,8 +192,8 @@ test_sim_benchmark_invariants:
-SimulationCommit=true -SimulationSeed=57 -v -timeout 24h

# Don't move it into tools - this will be gone once gaia has moved into the new repo
runsim: $(GOBIN)/runsim
$(GOBIN)/runsim: cmd/gaia/contrib/runsim/main.go
runsim: $(BINDIR)/runsim
$(BINDIR)/runsim: cmd/gaia/contrib/runsim/main.go
go install github.com/cosmos/cosmos-sdk/cmd/gaia/contrib/runsim

SIM_NUM_BLOCKS ?= 500
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It is being used to build `Gaia`, the first implementation of the Cosmos Hub.
**WARNING**: The SDK has mostly stabilized, but we are still making some
breaking changes.

**Note**: Requires [Go 1.12.4+](https://golang.org/dl/)
**Note**: Requires [Go 1.12+](https://golang.org/dl/)

## Cosmos Hub Mainnet

Expand Down
11 changes: 8 additions & 3 deletions client/lcd/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2381,16 +2381,21 @@ definitions:
type: string
validator_dst_address:
type: string
entries:
type: array
items:
$ref: "#/definitions/Redelegation"
RedelegationEntry:
type: object
properties:
creation_height:
type: integer
min_time:
completion_time:
type: integer
initial_balance:
type: string
balance:
type: string
shares_src:
type: string
shares_dst:
type: string
ValidatorDistInfo:
Expand Down
12 changes: 6 additions & 6 deletions cmd/gaia/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
GOBIN ?= $(GOPATH)/bin
GOSUM := $(shell which gosum)

export GO111MODULE = on

Expand Down Expand Up @@ -41,16 +40,17 @@ endif
build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=gaia \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)"

ifneq ($(GOSUM),)
ldflags += -X github.com/cosmos/cosmos-sdk/version.GoSumHash=$(shell $(GOSUM) ../../go.sum)
endif
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

ifeq ($(WITH_CLEVELDB),yes)
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down
Loading

0 comments on commit 5c428b8

Please sign in to comment.