Skip to content

Commit

Permalink
Merge pull request #2297 from vegaprotocol/develop
Browse files Browse the repository at this point in the history
release v0.25.0
  • Loading branch information
jeremyletang authored Sep 24, 2020
2 parents 4d4cb8b + ff04eff commit e2138c4
Show file tree
Hide file tree
Showing 217 changed files with 29,935 additions and 8,839 deletions.
65 changes: 50 additions & 15 deletions .drone-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ 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
# Build normal executable
- ./script/build.sh -a build -t linux/amd64
# Get a list of files that changed in this PR, in order to limit CI to only test things that
# changed in this PR.
- git diff --name-only "$$DRONE_COMMIT_BEFORE...$$DRONE_COMMIT_AFTER" >git_diff.txt
- if test "$$DRONE_TARGET_BRANCH" = master -o "$$(grep -cE '(^go.(mod|sum)|\.go|\.feature)$$' git_diff.txt)" -gt 0 ; then
echo "Building executable" ;
./script/build.sh -a build -t linux/amd64 || exit 1;
else
echo "No Go files changed. Skipping building of binary." ;
rm -f cmd/vega/vega-* ;
fi
depends_on:
- fetch
when:
Expand All @@ -55,8 +63,11 @@ steps:
pull: always
environment: {}
commands:
# Make sure the mdspell command matches the one in Makefile.
- mdspell --en-gb --ignore-acronyms --ignore-numbers --no-suggestions --report '*.md' 'docs/**/*.md'
- if test "$$DRONE_TARGET_BRANCH" = master -o "$$(grep -c '\.md$$' git_diff.txt)" -gt 0 ; then
mdspell --en-gb --ignore-acronyms --ignore-numbers --no-suggestions --report '*.md' 'docs/**/*.md' || exit 1 ;
else
echo "No md files changed. Skipping mdspell." ;
fi
depends_on:
- build-PR
when:
Expand All @@ -77,16 +88,26 @@ steps:
SLACK_HOOK_URL:
from_secret: SLACK_HOOK_URL
commands:
- make retest
# 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
- if test "$$DRONE_TARGET_BRANCH" = master -o "$$(grep -cE '(^go.(mod|sum)|\.go)$$' git_diff.txt)" -gt 0 ; then
make retest || exit 1 ;
for target in gqlgen_check print_check proto_check race vet ;
do
echo "$$COL_CYAN$$target$$COL_RESET" ;
make "$$target" || failed="$$failed $$target" ;
done ;
else
echo "No Go files changed. Skipping go tests" ;
fi
- for target in codeowners_check ; do
echo "$$COL_CYAN$$target$$COL_RESET" ;
make "$$target" || failed="$$failed $$target" ;
done
- /usr/local/bin/check-rest-endpoints.py
--bindings gateway/rest/grpc-rest-bindings.yml
--swagger proto/api/trading.swagger.json || failed="$$failed rest_check"
- /usr/local/bin/multilint || failed="$$failed multilint"
- make staticcheck || true # Ignore failures until they're all fixed.
- difflint "$$DRONE_COMMIT_BEFORE" "$$DRONE_COMMIT_AFTER" || failed="$$failed multilint"
# - make staticcheck # No point running this until warnings are fixed.
- if test -n "$$failed" ; then echo "Failed checks:$$failed" ; exit 1 ; fi ; echo "$${COL_GREEN}OK$$COL_RESET"
depends_on:
- build-PR
Expand All @@ -104,7 +125,11 @@ steps:
from_secret: SLACK_HOOK_URL
commands:
# https://github.com/vegaprotocol/system-tests/blob/master/ci.sh
- /usr/local/bin/ci.sh
- if test -x cmd/vega/vega-linux-amd64 ; then
/usr/local/bin/ci.sh ;
else
echo "No vega binary. Skipping system-tests." ;
fi
depends_on:
- test-PR
when:
Expand Down Expand Up @@ -151,6 +176,8 @@ steps:
volumes:
- name: gopkg
path: /go/pkg
- name: mutex
path: /mutex
environment:
DEVNET_DEPLOY_SSH_PRIVATE_KEY:
from_secret: DEVNET_DEPLOY_SSH_PRIVATE_KEY
Expand Down Expand Up @@ -178,15 +205,20 @@ steps:
# - DEVNET_DEPLOY_SSH_KNOWN_HOSTS
# - DEVNET_DEPLOY_SSH_PRIVATE_KEY
# - SLACK_HOOK_URL
- cp -a cmd/vega/vega-linux-amd64 cmd/vega/vega
- /usr/local/bin/deploy-trading-core.sh devnet vega
# Set up wallets, keypairs and free money.
- /usr/local/bin/init-wallets-tokenbalances.py
- (
if ! flock -n 9 ; then
echo "Another devnet deployment is in progress." ;
exit 1 ;
fi ;
cp -a cmd/vega/vega-linux-amd64 cmd/vega/vega &&
/usr/local/bin/deploy-trading-core.sh devnet vega &&
/usr/local/bin/init-wallets-tokenbalances.py
--faucetserver "$$DEVNET_FAUCET_SERVER"
--wallets "$$(echo "$$VEGANET_USERS" | tr " " ",")"
--walletserver "$$DEVNET_WALLET_SERVER"
--passphrase "$$DEVNET_WALLET_PASSPHRASE"
--veganode "$$DEVNET_VEGA_GRPCNODE"
) 9>/mutex/devnet_deploy
depends_on:
- build-branch
when:
Expand Down Expand Up @@ -298,6 +330,9 @@ volumes:
- name: gopkg
host:
path: /var/lib/drone/volumes/vega/gopkg
- name: mutex
host:
path: /var/lib/drone/volumes/vega/mutex

image_pull_secrets:
- dockerconfig
2 changes: 2 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ unexported
vega
whitepaper
xor
MarkToMarket
specs
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# Changelog

## 0.25.0

*2020-09-24*

This release adds the event bus API, allowing for much greater introspection in to the operation of a node. We've also re-enabled the order amends API, as well as a long list of fixes.

### New
- [#2281](https://github.com/vegaprotocol/vega/pull/2281) Enable opening auctions
- [#2205](https://github.com/vegaprotocol/vega/pull/2205) Add GraphQL event stream API
- [#2219](https://github.com/vegaprotocol/vega/pull/2219) Add deposits API
- [#2222](https://github.com/vegaprotocol/vega/pull/2222) Initial asset list is now loaded from genesis configuration, not external configuration
- [#2238](https://github.com/vegaprotocol/vega/pull/2238) Re-enable order amend API
- [#2249](https://github.com/vegaprotocol/vega/pull/2249) Re-enable TX rate limit by party ID
- [#2240](https://github.com/vegaprotocol/vega/pull/2240) Add time to position responses

### Improvements
- [#2211](https://github.com/vegaprotocol/vega/pull/2211) 🔥 GraphQL: Field case change `proposalId` -> `proposalID`
- [#2218](https://github.com/vegaprotocol/vega/pull/2218) 🔥 GraphQL: Withdrawals now return a `Party`, not a party ID
- [#2202](https://github.com/vegaprotocol/vega/pull/2202) Fix time validation for proposals when all times are the same
- [#2206](https://github.com/vegaprotocol/vega/pull/2206) Reduce log noise from statistics endpoint
- [#2207](https://github.com/vegaprotocol/vega/pull/2207) Automatically reload node configuration
- [#2209](https://github.com/vegaprotocol/vega/pull/2209) GraphQL: fix proposal rejection enum
- [#2210](https://github.com/vegaprotocol/vega/pull/2210) Refactor order service to not require blockchain client
- [#2213](https://github.com/vegaprotocol/vega/pull/2213) Improve error clarity for invalid proposals
- [#2216](https://github.com/vegaprotocol/vega/pulls/2216) Ensure all GRPC endpoints use real time, not Vega time
- [#2231](https://github.com/vegaprotocol/vega/pull/2231) Refactor processor to no longer require collateral
- [#2232](https://github.com/vegaprotocol/vega/pull/2232) Clean up logs that dumped raw bytes
- [#2233](https://github.com/vegaprotocol/vega/pull/2233) Remove generate method from execution engine
- [#2234](https://github.com/vegaprotocol/vega/pull/2234) Remove `authEnabled` setting
- [#2236](https://github.com/vegaprotocol/vega/pull/2236) Simply order amendment logging
- [#2237](https://github.com/vegaprotocol/vega/pull/2237) Clarify fees attribution in transfers
- [#2239](https://github.com/vegaprotocol/vega/pull/2239) Ensure margin is released immediately, not on next mark to market
- [#2241](https://github.com/vegaprotocol/vega/pull/2241) Load log level in processor app
- [#2245](https://github.com/vegaprotocol/vega/pull/2245) Fix a concurrent map access in positions API
- [#2247](https://github.com/vegaprotocol/vega/pull/2247) Improve logging on a TX with an invalid signature
- [#2252](https://github.com/vegaprotocol/vega/pull/2252) Fix incorrect order count in Market Depth API
- [#2254](https://github.com/vegaprotocol/vega/pull/2254) Fix concurrent map access in Market Depth API
- [#2269](https://github.com/vegaprotocol/vega/pull/2269) GraphQL: Fix party filtering for event bus API
- [#2266](https://github.com/vegaprotocol/vega/pull/2266) Refactor transaction codec
- [#2275](https://github.com/vegaprotocol/vega/pull/2275) Prevent opening auctions from closing early
- [#2262](https://github.com/vegaprotocol/vega/pull/2262) Clear potential position properly when an order is cancelled for self trading
- [#2286](https://github.com/vegaprotocol/vega/pull/2286) Add sequence ID to event bus events
- [#2288](https://github.com/vegaprotocol/vega/pull/2288) Fix auction events not appearing in GraphQL event bus
- [#2294](https://github.com/vegaprotocol/vega/pull/2294) Fixing incorrect order iteration in auctions
- [#2285](https://github.com/vegaprotocol/vega/pull/2285) Check auction times
- [#2283](https://github.com/vegaprotocol/vega/pull/2283) Better handling of 0 `expiresAt`

## 0.24.0

*2020-09-04*
Expand Down
5 changes: 5 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ vega node --nodewallet-password="path/to/file"
tendermint unsafe_reset_all
tendermint node
```
* At this stage, you should be able to watch the block production (an other Tendermint events) using:
```bash
vega watch "tm.event = 'NewBlock'"
```

* Optional: To run a multi-node network, use `tendermint testnet` to generate
configuration files for nodes.

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.24.0.
Version 0.25.0.

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

Expand Down
2 changes: 1 addition & 1 deletion accounts/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s *Svc) ReloadConf(cfg Config) {
s.Config = cfg
}

func (s *Svc) PrepareWithdraw(ctx context.Context, w *types.Withdraw) error {
func (s *Svc) PrepareWithdraw(ctx context.Context, w *types.WithdrawSubmission) error {
if len(w.PartyID) <= 0 {
return ErrMissingPartyID
}
Expand Down
2 changes: 0 additions & 2 deletions api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type Config struct {
Port int
IP string
StreamRetries int
AuthEnabled bool
}

// NewDefaultConfig creates an instance of the package specific configuration, given a
Expand All @@ -31,6 +30,5 @@ func NewDefaultConfig() Config {
IP: "0.0.0.0",
Port: 3002,
StreamRetries: 3,
AuthEnabled: false,
}
}
6 changes: 6 additions & 0 deletions api/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ var (
ErrMissingProposalID = errors.New("missing proposal id")
// ErrMissingProposalReference returned if proposal with this reference is not found
ErrMissingProposalReference = errors.New("failed to find proposal with the reference")
// ErrMissingWithdrawalID is returned when the ID is missing from the request
ErrMissingWithdrawalID = errors.New("missing withdrawal ID")
// ErrMissingDepositID is returned when the ID is missing from the request
ErrMissingDepositID = errors.New("missing deposit ID")
)

// errorMap contains a mapping between errors and Vega numeric error codes.
Expand Down Expand Up @@ -152,6 +156,8 @@ var errorMap = map[error]int32{
// Accounts
ErrAccountServiceGetMarketAccounts: 80001,
ErrAccountServiceGetPartyAccounts: 80002,
ErrMissingWithdrawalID: 80003,
ErrMissingDepositID: 80004,
// Blockchain client
ErrBlockchainBacklogLength: 90001,
ErrBlockchainNetworkInfo: 90002,
Expand Down
2 changes: 1 addition & 1 deletion api/mocks/account_service_mock.go

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

2 changes: 1 addition & 1 deletion api/mocks/accounts_service_mock.go

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

63 changes: 63 additions & 0 deletions api/mocks/withdrawal_service_mock.go

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

15 changes: 15 additions & 0 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import (
"code.vegaprotocol.io/vega/notary"
"code.vegaprotocol.io/vega/orders"
"code.vegaprotocol.io/vega/parties"
"code.vegaprotocol.io/vega/plugins"
protoapi "code.vegaprotocol.io/vega/proto/api"
"code.vegaprotocol.io/vega/risk"
"code.vegaprotocol.io/vega/stats"
"code.vegaprotocol.io/vega/subscribers"
"code.vegaprotocol.io/vega/trades"
"code.vegaprotocol.io/vega/transfers"
"code.vegaprotocol.io/vega/vegatime"
Expand Down Expand Up @@ -51,6 +53,9 @@ type GRPCServer struct {
evtfwd EvtForwarder
assetService *assets.Svc
feeService *fee.Svc
eventService *subscribers.Service
withdrawalService *plugins.Withdrawal
depositService *plugins.Deposit

tradingService *tradingService
tradingDataService *tradingDataService
Expand Down Expand Up @@ -82,6 +87,9 @@ func NewGRPCServer(
evtfwd EvtForwarder,
assetService *assets.Svc,
feeService *fee.Svc,
eventService *subscribers.Service,
withdrawalService *plugins.Withdrawal,
depositService *plugins.Deposit,
statusChecker *monitoring.Status,
) *GRPCServer {
// setup logger
Expand All @@ -108,6 +116,9 @@ func NewGRPCServer(
evtfwd: evtfwd,
assetService: assetService,
feeService: feeService,
eventService: eventService,
withdrawalService: withdrawalService,
depositService: depositService,
statusChecker: statusChecker,
ctx: ctx,
cfunc: cfunc,
Expand Down Expand Up @@ -196,6 +207,7 @@ func (g *GRPCServer) Start() {

tradingSvc := &tradingService{
log: g.log,
blockchain: g.client,
tradeOrderService: g.orderService,
accountService: g.accountsService,
marketService: g.marketService,
Expand Down Expand Up @@ -224,7 +236,10 @@ func (g *GRPCServer) Start() {
governanceService: g.governanceService,
AssetService: g.assetService,
FeeService: g.feeService,
eventService: g.eventService,
statusChecker: g.statusChecker,
WithdrawalService: g.withdrawalService,
DepositService: g.depositService,
ctx: g.ctx,
}
g.tradingDataService = tradingDataSvc
Expand Down
Loading

0 comments on commit e2138c4

Please sign in to comment.