Skip to content

Commit

Permalink
Merge pull request #1823 from vegaprotocol/release/v0.21.0
Browse files Browse the repository at this point in the history
Release v0.21.0
  • Loading branch information
ashleyvega committed Jun 18, 2020
2 parents 13e70cc + 3c1df00 commit fde19b7
Show file tree
Hide file tree
Showing 63 changed files with 3,395 additions and 1,288 deletions.
20 changes: 10 additions & 10 deletions .drone-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
# ====== Pipeline for pull requests ======

- name: build-PR
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.11.13
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.14.4
pull: always
volumes:
- name: gocache
Expand All @@ -43,15 +43,15 @@ steps:
- ssh-keyscan github.com 1>~/.ssh/known_hosts 2>/dev/null ; chmod 0644 ~/.ssh/known_hosts
- unset GITHUB_DEPLOY_SSH_PRIVATE_KEY
# Build normal executable
- ./script/build.sh -t linux/amd64
- ./script/build.sh -a build -t linux/amd64
# Build executable for sytstem-tests, with custom Governance parameters. 8760h is 24*365 hours.
- env
VEGA_GOVERNANCE_MIN_CLOSE=5s
VEGA_GOVERNANCE_MAX_CLOSE=8760h
VEGA_GOVERNANCE_MIN_ENACT=5s
VEGA_GOVERNANCE_MAX_ENACT=8760h
VEGA_GOVERNANCE_MIN_PARTICIPATION_STAKE=1
./script/build.sh -t linux/amd64 -s "-systemtests"
./script/build.sh -a build -t linux/amd64 -s "-systemtests"
depends_on:
- fetch
when:
Expand All @@ -72,7 +72,7 @@ steps:
- pull_request

- name: test-PR
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.11.13
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.14.4
volumes:
- name: gocache
path: /go/cache
Expand All @@ -86,7 +86,7 @@ steps:
from_secret: SLACK_HOOK_URL
commands:
- make retest
# More small checks. Run all, instead of exitng after first failure.
# More small checks. Run all, instead of exiting after first failure.
- failed=""
- for target in codeowners_check gqlgen_check print_check proto_check race vet ; do
echo "$$COL_CYAN$$target$$COL_RESET" ; make "$$target" || failed="$$failed $$target" ; done
Expand Down Expand Up @@ -159,7 +159,7 @@ steps:
# ====== Pipeline for main branches (master, develop) and tags ======

- name: build-branch
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.11.13
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.14.4
pull: always
volumes:
- name: gocache
Expand All @@ -182,7 +182,7 @@ steps:
- echo "$${GITHUB_DEPLOY_SSH_PRIVATE_KEY}" >~/.ssh/id_rsa ; chmod 0600 ~/.ssh/id_rsa
- ssh-keyscan github.com 1>~/.ssh/known_hosts 2>/dev/null ; chmod 0644 ~/.ssh/known_hosts
- unset GITHUB_DEPLOY_SSH_PRIVATE_KEY
- ./script/build.sh -t linux/amd64
- ./script/build.sh -a build -t linux/amd64
depends_on:
- fetch
when:
Expand All @@ -192,7 +192,7 @@ steps:
- refs/tags/*

- name: deploy_devnet
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.11.13
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.14.4
volumes:
- name: gopkg
path: /go/pkg
Expand Down Expand Up @@ -293,7 +293,7 @@ steps:
- echo "$${GITHUB_DEPLOY_SSH_PRIVATE_KEY}" >~/.ssh/id_rsa ; chmod 0600 ~/.ssh/id_rsa
- ssh-keyscan github.com 1>~/.ssh/known_hosts 2>/dev/null ; chmod 0644 ~/.ssh/known_hosts
- unset GITHUB_DEPLOY_SSH_PRIVATE_KEY
- ./script/build.sh -T
- ./script/build.sh -a build -T
depends_on:
- build-branch
when:
Expand All @@ -317,7 +317,7 @@ steps:
- build-multiarch

- name: changelog_slack
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.11.13
image: docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.14.4
environment:
SLACK_HOOK_URL:
from_secret: SLACK_HOOK_URL
Expand Down
1 change: 1 addition & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Suzdalnitski
syslog
tamlyn10
Tendermint
tendermint
testnet
tradable
traderbot
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.21.0

*2020-06-18*

A follow-on from 0.20.1, this release includes a fix for the GraphQL API returning inconsistent values for the `side` field on orders, leading to Vega Console failing to submit orders. As a bonus there is another GraphQL improvement, and two fixes that return more correct values for filled network orders and expired orders.

### Improvements

- 💥 [#1820](https://github.com/vegaprotocol/vega/pull/1820) GraphQL: Non existent parties no longer return a GraphQL error
- 💥 [#1784](https://github.com/vegaprotocol/vega/pull/1784) GraphQL: Update schema and fix enum mappings from Proto
- 💥 [#1761](https://github.com/vegaprotocol/vega/pull/1761) Governance: Improve processing of Proposals
- [#1822](https://github.com/vegaprotocol/vega/pull/1822) Remove duplicate updates to `createdAt`
- [#1818](https://github.com/vegaprotocol/vega/pull/1818) Trades: Replace buffer with events
- [#1812](https://github.com/vegaprotocol/vega/pull/1812) Governance: Improve logging
- [#1810](https://github.com/vegaprotocol/vega/pull/1810) Execution: Set order status for fully filled network orders to be `FILLED`
- [#1803](https://github.com/vegaprotocol/vega/pull/1803) Matching: Set `updatedAt` when orders expire
- [#1780](https://github.com/vegaprotocol/vega/pull/1780) APIs: Reject `NETWORK` orders
- [#1792](https://github.com/vegaprotocol/vega/pull/1792) Update Golang to 1.14 and tendermint to 0.33.5

## 0.20.1

*2020-06-18*
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.11.13 \
FROM docker.pkg.github.com/vegaprotocol/devops-infra/cipipeline:1.14.4 \
AS builder
RUN \
git config --global url."[email protected]:vegaprotocol".insteadOf "https://github.com/vegaprotocol" && \
Expand All @@ -19,10 +19,9 @@ RUN make install


FROM scratch
ENTRYPOINT ["/vega"]
CMD ["node"]
ENTRYPOINT ["/vega-linux-amd64"]
EXPOSE 3002/tcp 3003/tcp 3004/tcp 26658/tcp
COPY --from=builder /go/bin/dummyriskmodel /
COPY --from=builder /go/bin/vega /
COPY --from=builder /go/bin/vegaccount /
COPY --from=builder /go/bin/vegastream /
COPY --from=builder /go/bin/dummyriskmodel-linux-amd64 /
COPY --from=builder /go/bin/vega-linux-amd64 /
COPY --from=builder /go/bin/vegaccount-linux-amd64 /
COPY --from=builder /go/bin/vegastream-linux-amd64 /
55 changes: 14 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ lint: ## Lint the files

.PHONY: retest
retest: ## Re-run all unit tests
@go test -count=1 ./...
@./script/build.sh -a retest

.PHONY: test
test: ## Run unit tests
@go test ./...
@./script/build.sh -a test

.PHONY: integrationtest
integrationtest: ## run integration tests, showing ledger movements and full scenario output
@go test -v ./integration/... -godog.format=pretty
@./script/build.sh -a integrationtest

.PHONY: race
race: ## Run data race detector
@env CGO_ENABLED=1 go test -race ./...
@./script/build.sh -a race

.PHONY: mocks
mocks: ## Make mocks
Expand All @@ -38,57 +38,32 @@ msan: ## Run memory sanitizer

.PHONY: vet
vet: ## Run go vet
@go vet -all ./...

.PHONY: vetshadow
vetshadow: # Run go vet with shadow detection
@go vet -shadow ./... 2>&1 | grep -vE '^(#|gateway/graphql/generated.go|proto/.*\.pb\.(gw\.)?go)' ; \
code="$$?" ; test "$$code" -ne 0

.PHONY: .testCoverage.txt
.testCoverage.txt:
@go list ./... |grep -v '/gateway' | xargs go test -covermode=count -coverprofile="$@"
@go tool cover -func="$@"
@./script/build.sh -a vet

.PHONY: coverage
coverage: .testCoverage.txt ## Generate global code coverage report

.PHONY: .testCoverage.html
.testCoverage.html: .testCoverage.txt
@go tool cover -html="$^" -o "$@"

.PHONY: coveragehtml
coveragehtml: .testCoverage.html ## Generate global code coverage report in HTML
coverage: ## Generate global code coverage report
@./script/build.sh -a coverage

.PHONY: deps
deps: ## Get the dependencies
@go mod download
@go mod vendor
@grep 'google/protobuf' go.mod | awk '{print "# " $$1 " " $$2 "\n"$$1"/src";}' >> vendor/modules.txt
@mkdir -p "$$GOPATH/pkg/mod/@indirect"
@modvendor -copy="**/*.proto"
@./script/build.sh -a deps

.PHONY: build
build: ## install the binaries in cmd/{progname}/
@d="" ; test -n "$$DEBUGVEGA" && d="-d" ; \
./script/build.sh $d -t linux/amd64
./script/build.sh $$d -a build -t default

.PHONY: gofmtsimplify
gofmtsimplify:
@find . -path vendor -prune -o \( -name '*.go' -and -not -name '*_test.go' -and -not -name '*_mock.go' \) -print0 | xargs -0r gofmt -s -w

.PHONY: install
install: SHELL:=/bin/bash
install: ## install the binaries in GOPATH/bin
@source ./script/build.sh && set_version && set_ldflags && \
echo "Version: $$version ($$version_hash)" && \
for app in "$${apps[@]}" ; do \
env CGO_ENABLED=1 go install -v -ldflags "$$ldflags" "./cmd/$$app" || exit 1 ; \
done
@./script/build.sh -a install -t default

.PHONY: gqlgen
gqlgen: ## run gqlgen
@cd ./gateway/graphql/ && go run github.com/99designs/gqlgen --config gqlgen.yml
@./script/build.sh -a gqlgen

.PHONY: gqlgen_check
gqlgen_check: ## GraphQL: Check committed files match just-generated files
Expand All @@ -107,7 +82,7 @@ ineffectassign: ## Check for ineffectual assignments
if test "$$(echo -n "$$ia" | wc -l | awk '{print $$1}')" -gt 0 ; then echo "$$ia" ; exit 1 ; fi

.PHONY: proto
proto: deps ## build proto definitions
proto: ## build proto definitions
@./proto/generate.sh

.PHONY: proto_check
Expand Down Expand Up @@ -150,7 +125,7 @@ print_check: ## Check for fmt.Print functions in Go code
if test "$$count" -gt 0 ; then exit 1 ; fi

.PHONY: docker
docker: SHELL:=/bin/bash
docker: SHELL:=/usr/bin/env bash
docker: ## Make docker container image from scratch
@source ./script/build.sh && \
if ! test -f "$(HOME)/.ssh/id_rsa" ; then \
Expand Down Expand Up @@ -207,9 +182,7 @@ spellcheck: ## Run markdown spellcheck container
# The integration directory is special, and contains a package called core_test.
.PHONY: staticcheck
staticcheck: ## Run statick analysis checks
@go list ./... | grep -v /integration | xargs staticcheck
@f="$$(mktemp)" && find integration -name '*.go' | xargs staticcheck | grep -v 'could not load export data' | tee "$$f" && \
count="$$(wc -l <"$$f")" && rm -f "$$f" && if test "$$count" -gt 0 ; then exit 1 ; fi
@./script/build.sh -a staticcheck

.PHONY: clean
clean: SHELL:=/bin/bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vega

Version 0.20.1.
Version 0.21.0.

A decentralised trading platform that allows pseudo-anonymous trading of derivatives on a blockchain.

Expand Down
5 changes: 2 additions & 3 deletions api/mocks/governance_data_service_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions api/trading_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ func (h *tradingDataService) Parties(ctx context.Context, req *empty.Empty) (*pr
func (h *tradingDataService) PartyByID(ctx context.Context, req *protoapi.PartyByIDRequest) (*protoapi.PartyByIDResponse, error) {
startTime := vegatime.Now()
defer metrics.APIRequestAndTimeGRPC("PartyByID", startTime)
pty, err := validateParty(ctx, req.PartyID, h.PartyService)
pty, err := validateParty(ctx, h.log, req.PartyID, h.PartyService)
if err != nil {
return nil, err // validateParty already returns an API error, no need to additionally wrap
}
Expand Down Expand Up @@ -1252,15 +1252,21 @@ func validateMarket(ctx context.Context, marketID string, marketService MarketSe
return mkt, nil
}

func validateParty(ctx context.Context, partyID string, partyService PartyService) (*types.Party, error) {
func validateParty(ctx context.Context, log *logging.Logger, partyID string, partyService PartyService) (*types.Party, error) {
var pty *types.Party
var err error
if len(partyID) == 0 {
return nil, apiError(codes.InvalidArgument, ErrEmptyMissingPartyID)
}
pty, err = partyService.GetByID(ctx, partyID)
if err != nil {
return nil, apiError(codes.Internal, ErrPartyServiceGetByID, err)
// we just log the error here, then return an nil error.
// right now the only error possible is about not finding a party
// we just not an actual error
log.Debug("error getting party by ID",
logging.Error(err),
logging.String("party-id", partyID))
err = nil
}
return pty, err
}
Expand Down
2 changes: 1 addition & 1 deletion api/trading_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func getTestGRPCServer(
blockchainClient := mocks.NewMockBlockchainClient(mockCtrl)
blockchainClient.EXPECT().Health().AnyTimes().Return(&tmctypes.ResultHealth{}, nil)
blockchainClient.EXPECT().GetStatus(gomock.Any()).AnyTimes().Return(&tmctypes.ResultStatus{
NodeInfo: tmp2p.DefaultNodeInfo{Version: "0.32.9"},
NodeInfo: tmp2p.DefaultNodeInfo{Version: "0.33.5"},
SyncInfo: tmctypes.SyncInfo{},
ValidatorInfo: tmctypes.ValidatorInfo{},
}, nil)
Expand Down
2 changes: 1 addition & 1 deletion blockchain/noop/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (n *NOOPChain) GetChainID(context.Context) (string, error) {
func (n *NOOPChain) GetStatus(context.Context) (*tmctypes.ResultStatus, error) {
return &tmctypes.ResultStatus{
NodeInfo: p2p.DefaultNodeInfo{
Version: "0.32.9",
Version: "0.33.5",
},
SyncInfo: tmctypes.SyncInfo{
CatchingUp: false,
Expand Down
2 changes: 1 addition & 1 deletion blockchain/tm/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (a *AbciApplication) BeginBlock(beginBlock types.RequestBeginBlock) types.R
if a.LogTimeDebug {
a.log.Debug("Block time for height",
logging.Int64("height", beginBlock.Header.Height),
logging.Int64("num-txs", beginBlock.Header.NumTxs),
// TODO: logging.Int64("num-txs", beginBlock.Header.NumTxs),
logging.Int64("epoch-nano", beginBlock.Header.Time.UnixNano()),
logging.String("time", beginBlock.Header.Time.String()))
}
Expand Down
12 changes: 8 additions & 4 deletions blockchain/tm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"code.vegaprotocol.io/vega/vegatime"

"github.com/tendermint/tendermint/rpc/client"
tmclihttp "github.com/tendermint/tendermint/rpc/client/http"
tmctypes "github.com/tendermint/tendermint/rpc/core/types"
tmtypes "github.com/tendermint/tendermint/types"
)
Expand All @@ -18,7 +18,7 @@ var (
)

type Client struct {
tmclt *client.HTTP
tmclt *tmclihttp.HTTP
}

func NewClient(cfg Config) (*Client, error) {
Expand All @@ -28,8 +28,12 @@ func NewClient(cfg Config) (*Client, error) {
if len(cfg.ClientEndpoint) <= 0 {
return nil, ErrEmptyClientEndpoint
}
clt, err := tmclihttp.New(cfg.ClientAddr, cfg.ClientEndpoint)
if err != nil {
return nil, err
}
return &Client{
tmclt: client.NewHTTP(cfg.ClientAddr, cfg.ClientEndpoint),
tmclt: clt,
}, nil
}

Expand Down Expand Up @@ -85,7 +89,7 @@ func (c *Client) Health() (*tmctypes.ResultHealth, error) {
}

func (c *Client) Validators() ([]*tmtypes.Validator, error) {
res, err := c.tmclt.Validators(nil)
res, err := c.tmclt.Validators(nil, 0, 100)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit fde19b7

Please sign in to comment.