Skip to content

Commit

Permalink
Merge pull request #11621 from vegaprotocol/release/v0.78.0
Browse files Browse the repository at this point in the history
chore: release 0.78.0
  • Loading branch information
jeremyletang authored Aug 29, 2024
2 parents 03b0372 + e99aa44 commit 0910d96
Show file tree
Hide file tree
Showing 302 changed files with 38,502 additions and 15,514 deletions.
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

52 changes: 49 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changelog

## Unreleased 0.78.0
## Unreleased 0.79.0

### 🚨 Breaking changes

- [](https://github.com/vegaprotocol/vega/issues/xxx)
- [8777](https://github.com/vegaprotocol/vega/issues/8777) - Stop orders can now be used to create or increase a position.

### 🗑️ Deprecation

Expand All @@ -19,19 +19,65 @@
- [](https://github.com/vegaprotocol/vega/issues/xxx)


## 0.78.0

### 🛠 Improvements

- [11428](https://github.com/vegaprotocol/vega/issues/11428) - Add buy back and treasury fee and separate discount/reward factors.
- [11468](https://github.com/vegaprotocol/vega/issues/11468) - Added support for volume rebate program.
- [11523](https://github.com/vegaprotocol/vega/issues/11523) - Change method of caching to improve `AMM` snapshot performance.
- [11426](https://github.com/vegaprotocol/vega/issues/11426) - `EstimateAMMBounds` now reports issues with commitment.
- [11459](https://github.com/vegaprotocol/vega/issues/11459) - Deprecate time weight position reward metric and replace it with time weighted notional.
- [11528](https://github.com/vegaprotocol/vega/issues/11528) - Added support for eligible entities reward.
- [11372](https://github.com/vegaprotocol/vega/issues/11372) - Support combined filters for the `AMM` API.
- [11583](https://github.com/vegaprotocol/vega/issues/11583) - Keep `AMM` ephemeral position throughout entire auction uncrossing.
- [11535](https://github.com/vegaprotocol/vega/issues/11535) - Added support for lottery rank distribution strategy.
- [11536](https://github.com/vegaprotocol/vega/issues/11536) - Make the batch market instructions errors programmatically usable.
- [11546](https://github.com/vegaprotocol/vega/issues/11546) - Add validation to market proposals metadata.
- [11562](https://github.com/vegaprotocol/vega/issues/11562) - Update average notional metric with mark price at the end of the epoch and when calculating live score.
- [11570](https://github.com/vegaprotocol/vega/issues/11570) - Include the required set of parties for evaluation for eligible entities reward.
- [11576](https://github.com/vegaprotocol/vega/issues/11576) - Replace additional rebate validation with a cap.
- [11533](https://github.com/vegaprotocol/vega/issues/11533) - Suppose per party fee discounts in fee estimation.
- [11577](https://github.com/vegaprotocol/vega/issues/11577) - Add API for party discounts and rewards.
- [10716](https://github.com/vegaprotocol/vega/issues/10716) - Set Tendermint defaults during init.
- [11624](https://github.com/vegaprotocol/vega/issues/11624) - prevent creation of rewards with no payout, but with high computational cost.

### 🐛 Fixes

- [11521](https://github.com/vegaprotocol/vega/issues/11521) - Restore `AMM` position factor when loading from a snapshot.
- [11526](https://github.com/vegaprotocol/vega/issues/11526) - `EstimateAMMBounds` now respects the market's decimal places.
- [11486](https://github.com/vegaprotocol/vega/issues/11486) - `AMMs` can now be submitted on markets with more decimal places than asset decimal places.
- [11561](https://github.com/vegaprotocol/vega/issues/11561) - Failing amends on `AMMs` now restore original properly.
- [11583](https://github.com/vegaprotocol/vega/issues/11583) - Remove `AMMs` entirely from engine when market closes.
- [11568](https://github.com/vegaprotocol/vega/issues/11568) - order book shape on closing `AMM` no longer panics.
- [11540](https://github.com/vegaprotocol/vega/issues/11540) - Fix spam check for spots to use not double count quantum.
- [11542](https://github.com/vegaprotocol/vega/issues/11542) - Fix non determinism in lottery ranking.
- [11616](https://github.com/vegaprotocol/vega/issues/11616) - `AMM` tradable volume now calculated purely in positions to prevent loss of precision.
- [11544](https://github.com/vegaprotocol/vega/issues/11544) - Fix empty candles stream.
- [11619](https://github.com/vegaprotocol/vega/issues/11619) - Fix `EstimatePositions` API for capped futures.
- [11579](https://github.com/vegaprotocol/vega/issues/11579) - Spot calculate fee on amend, use order price if no amended price is provided.
- [11585](https://github.com/vegaprotocol/vega/issues/11585) - Initialise rebate stats service in API.
- [11592](https://github.com/vegaprotocol/vega/issues/11592) - Fix the order of calls at end of epoch between rebate engine and market tracker.
- [11607](https://github.com/vegaprotocol/vega/issues/11607) - Wire rank lottery distribution to team reward payout.
- [959](https://github.com/vegaprotocol/core-test-coverage/issues/959) - Include `ELS` for `AMM` sub keys to the parent key `ELS`.
- [11592](https://github.com/vegaprotocol/vega/issues/11592) - Fix the order of calls at end of epoch between rebate engine and market tracker.
- [10907](https://github.com/vegaprotocol/vega/issues/10907) - Fix position API distressed status not getting updated once the party has been closed out.


## 0.77.5

### 🐛 Fixes

- [11513](https://github.com/vegaprotocol/vega/issues/11513) - Rollback CometBFT to version `v0.38.8`.

- [11516](https://github.com/vegaprotocol/vega/issues/11516) - Fix order spam check for amends.

## 0.77.4

### 🐛 Fixes

- [11508](https://github.com/vegaprotocol/vega/issues/11508) - Handle market order for margin spam protection.
- [11507](https://github.com/vegaprotocol/vega/issues/11507) - Margin spam check to remove division by asset quantum.
- [11504](https://github.com/vegaprotocol/vega/issues/11504) - Fix bug causing panic when accounting for volume rounding with AMM orders.


## 0.77.3
Expand Down
2 changes: 2 additions & 0 deletions cmd/data-node/commands/start/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ func (l *NodeCommand) createGRPCServer(config api.Config) *api.GRPCServer {
l.timeWeightedNotionalPositionService,
l.gameScoreService,
l.ammPoolsService,
l.volumeRebateStatsService,
l.volumeRebateProgramService,
)
return grpcServer
}
14 changes: 14 additions & 0 deletions cmd/data-node/commands/start/sqlsubscribers.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ type SQLSubscribers struct {
timeWeightedNotionalPositionStore *sqlstore.TimeWeightedNotionalPosition
gameScoreStore *sqlstore.GameScores
ammPoolsStore *sqlstore.AMMPools
volumeRebateStatsStore *sqlstore.VolumeRebateStats
volumeRebateProgramsStore *sqlstore.VolumeRebatePrograms

// Services
candleService *candlesv2.Svc
Expand Down Expand Up @@ -142,6 +144,8 @@ type SQLSubscribers struct {
timeWeightedNotionalPositionService *service.TimeWeightedNotionalPosition
gameScoreService *service.GameScore
ammPoolsService *service.AMMPools
volumeRebateStatsService *service.VolumeRebateStats
volumeRebateProgramService *service.VolumeRebatePrograms

// Subscribers
accountSub *sqlsubscribers.Account
Expand Down Expand Up @@ -196,6 +200,8 @@ type SQLSubscribers struct {
timeWeightedNotionalPositionSub *sqlsubscribers.TimeWeightedNotionalPosition
gameScoreSub *sqlsubscribers.GameScore
ammPoolsSub *sqlsubscribers.AMMPools
volumeRebateStatsSub *sqlsubscribers.VolumeRebateStatsUpdated
volumeRebateProgramSub *sqlsubscribers.VolumeRebateProgram
}

func (s *SQLSubscribers) GetSQLSubscribers() []broker.SQLBrokerSubscriber {
Expand Down Expand Up @@ -254,6 +260,8 @@ func (s *SQLSubscribers) GetSQLSubscribers() []broker.SQLBrokerSubscriber {
s.timeWeightedNotionalPositionSub,
s.gameScoreSub,
s.ammPoolsSub,
s.volumeRebateProgramSub,
s.volumeRebateStatsSub,
}
}

Expand Down Expand Up @@ -317,6 +325,8 @@ func (s *SQLSubscribers) CreateAllStores(ctx context.Context, Log *logging.Logge
s.timeWeightedNotionalPositionStore = sqlstore.NewTimeWeightedNotionalPosition(transactionalConnectionSource)
s.gameScoreStore = sqlstore.NewGameScores(transactionalConnectionSource)
s.ammPoolsStore = sqlstore.NewAMMPools(transactionalConnectionSource)
s.volumeRebateStatsStore = sqlstore.NewVolumeRebateStats(transactionalConnectionSource)
s.volumeRebateProgramsStore = sqlstore.NewVolumeRebatePrograms(transactionalConnectionSource)
}

func (s *SQLSubscribers) SetupServices(ctx context.Context, log *logging.Logger, cfg service.Config, candlesConfig candlesv2.Config) error {
Expand Down Expand Up @@ -374,6 +384,8 @@ func (s *SQLSubscribers) SetupServices(ctx context.Context, log *logging.Logger,
s.timeWeightedNotionalPositionService = service.NewTimeWeightedNotionalPosition(s.timeWeightedNotionalPositionStore)
s.gameScoreService = service.NewGameScore(s.gameScoreStore, log)
s.ammPoolsService = service.NewAMMPools(s.ammPoolsStore)
s.volumeRebateStatsService = service.NewVolumeRebateStats(s.volumeRebateStatsStore)
s.volumeRebateProgramService = service.NewVolumeRebatePrograms(s.volumeRebateProgramsStore)

s.marketDepthService = service.NewMarketDepth(
cfg.MarketDepth,
Expand Down Expand Up @@ -455,5 +467,7 @@ func (s *SQLSubscribers) SetupSQLSubscribers() {
s.marginModesSub = sqlsubscribers.NewMarginModes(s.marginModesService)
s.timeWeightedNotionalPositionSub = sqlsubscribers.NewTimeWeightedNotionalPosition(s.timeWeightedNotionalPositionService)
s.gameScoreSub = sqlsubscribers.NewGameScore(s.gameScoreStore)
s.volumeRebateStatsSub = sqlsubscribers.NewVolumeRebateStatsUpdated(s.volumeRebateStatsService)
s.volumeRebateProgramSub = sqlsubscribers.NewVolumeRebateProgram(s.volumeRebateProgramService)
s.ammPoolsSub = sqlsubscribers.NewAMMPools(s.ammPoolsService, s.marketDepthService)
}
13 changes: 13 additions & 0 deletions cmd/vega/commands/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"os"
"path/filepath"
"time"

"code.vegaprotocol.io/vega/core/config"
Expand Down Expand Up @@ -127,7 +128,19 @@ func (opts *InitCmd) Execute(args []string) error {
if !initCmd.NoTendermint {
tmCfg := tmcfg.DefaultConfig()
tmCfg.SetRoot(os.ExpandEnv(initCmd.TendermintHome))
// add a few defaults
tmCfg.P2P.MaxPacketMsgPayloadSize = 16384
tmCfg.P2P.SendRate = 20000000
tmCfg.P2P.RecvRate = 20000000
tmCfg.Mempool.Size = 10000
tmCfg.Mempool.CacheSize = 20000
tmCfg.Consensus.TimeoutCommit = 0 * time.Second
tmCfg.Consensus.SkipTimeoutCommit = true
tmCfg.Consensus.CreateEmptyBlocksInterval = 1 * time.Second
tmCfg.Storage.DiscardABCIResponses = true
tmcfg.EnsureRoot(tmCfg.RootDir)
// then rewrite the config to apply the changes, EnsureRoot create the config, but with a default config
tmcfg.WriteConfigFile(filepath.Join(tmCfg.RootDir, tmcfg.DefaultConfigDir, tmcfg.DefaultConfigFileName), tmCfg)
if err := initTendermintConfiguration(output, logger, tmCfg); err != nil {
return fmt.Errorf("couldn't initialise tendermint %w", err)
}
Expand Down
8 changes: 0 additions & 8 deletions cmd/vega/commands/verify/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"code.vegaprotocol.io/vega/cmd/vega/commands/verify"
"code.vegaprotocol.io/vega/core/assets"
"code.vegaprotocol.io/vega/core/genesis"
"code.vegaprotocol.io/vega/core/netparams"
"code.vegaprotocol.io/vega/core/validators"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -151,13 +150,6 @@ func testVerifyNetworkParams(t *testing.T) {
gs = genesis.DefaultState()
gs.NetParamsOverwrite = []string{"NOTREAL"}
assert.Error(t, cmd.Execute([]string{writeGenesisFileWithState(t, gs)}))

// Check for deprecated parameter in genesis
gs = genesis.DefaultState()
for k := range netparams.Deprecated {
gs.NetParams[k] = "hello"
}
assert.Error(t, cmd.Execute([]string{writeGenesisFileWithState(t, gs)}))
}

func TestVerifyValidators(t *testing.T) {
Expand Down
14 changes: 13 additions & 1 deletion commands/create_referral_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

package commands

import commandspb "code.vegaprotocol.io/vega/protos/vega/commands/v1"
import (
"errors"

commandspb "code.vegaprotocol.io/vega/protos/vega/commands/v1"
)

func CheckCreateReferralSet(cmd *commandspb.CreateReferralSet) error {
return checkCreateReferralSet(cmd).ErrorOrNil()
Expand All @@ -28,6 +32,14 @@ func checkCreateReferralSet(cmd *commandspb.CreateReferralSet) Errors {
return errs.FinalAddForProperty("create_referral_set", ErrIsRequired)
}

// Basically this command should be rejected if we are not creating a team
// but also not creating a referral set...
// just check if this command is ineffective...
if cmd.DoNotCreateReferralSet && !cmd.IsTeam {
return errs.FinalAddForProperty("create_referral_set",
errors.New("is ineffective"))
}

if cmd.IsTeam {
if cmd.Team == nil {
return errs.FinalAddForProperty("create_referral_set.team", ErrIsRequired)
Expand Down
1 change: 1 addition & 0 deletions commands/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
ErrMustBeLessThan150 = errors.New("must be less than 150")
ErrMustBeAtMost1M = errors.New("must be at most 1000000")
ErrMustBeAtMost100 = errors.New("must be at most 100")
ErrMustBeAtMost2048 = errors.New("must be at most 2048")
ErrMustBeWithinRange7 = errors.New("must be between -7 and 7")
ErrIsNotValid = errors.New("is not a valid value")
ErrIsNotValidWithOCO = errors.New("is not a valid with one cancel other")
Expand Down
Loading

0 comments on commit 0910d96

Please sign in to comment.