Skip to content

Commit 0910d96

Browse files
authored
Merge pull request #11621 from vegaprotocol/release/v0.78.0
chore: release 0.78.0
2 parents 03b0372 + e99aa44 commit 0910d96

302 files changed

Lines changed: 38502 additions & 15514 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/launch.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Changelog
22

3-
## Unreleased 0.78.0
3+
## Unreleased 0.79.0
44

55
### 🚨 Breaking changes
66

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

99
### 🗑️ Deprecation
1010

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

2121

22+
## 0.78.0
23+
24+
### 🛠 Improvements
25+
26+
- [11428](https://github.com/vegaprotocol/vega/issues/11428) - Add buy back and treasury fee and separate discount/reward factors.
27+
- [11468](https://github.com/vegaprotocol/vega/issues/11468) - Added support for volume rebate program.
28+
- [11523](https://github.com/vegaprotocol/vega/issues/11523) - Change method of caching to improve `AMM` snapshot performance.
29+
- [11426](https://github.com/vegaprotocol/vega/issues/11426) - `EstimateAMMBounds` now reports issues with commitment.
30+
- [11459](https://github.com/vegaprotocol/vega/issues/11459) - Deprecate time weight position reward metric and replace it with time weighted notional.
31+
- [11528](https://github.com/vegaprotocol/vega/issues/11528) - Added support for eligible entities reward.
32+
- [11372](https://github.com/vegaprotocol/vega/issues/11372) - Support combined filters for the `AMM` API.
33+
- [11583](https://github.com/vegaprotocol/vega/issues/11583) - Keep `AMM` ephemeral position throughout entire auction uncrossing.
34+
- [11535](https://github.com/vegaprotocol/vega/issues/11535) - Added support for lottery rank distribution strategy.
35+
- [11536](https://github.com/vegaprotocol/vega/issues/11536) - Make the batch market instructions errors programmatically usable.
36+
- [11546](https://github.com/vegaprotocol/vega/issues/11546) - Add validation to market proposals metadata.
37+
- [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.
38+
- [11570](https://github.com/vegaprotocol/vega/issues/11570) - Include the required set of parties for evaluation for eligible entities reward.
39+
- [11576](https://github.com/vegaprotocol/vega/issues/11576) - Replace additional rebate validation with a cap.
40+
- [11533](https://github.com/vegaprotocol/vega/issues/11533) - Suppose per party fee discounts in fee estimation.
41+
- [11577](https://github.com/vegaprotocol/vega/issues/11577) - Add API for party discounts and rewards.
42+
- [10716](https://github.com/vegaprotocol/vega/issues/10716) - Set Tendermint defaults during init.
43+
- [11624](https://github.com/vegaprotocol/vega/issues/11624) - prevent creation of rewards with no payout, but with high computational cost.
44+
45+
### 🐛 Fixes
46+
47+
- [11521](https://github.com/vegaprotocol/vega/issues/11521) - Restore `AMM` position factor when loading from a snapshot.
48+
- [11526](https://github.com/vegaprotocol/vega/issues/11526) - `EstimateAMMBounds` now respects the market's decimal places.
49+
- [11486](https://github.com/vegaprotocol/vega/issues/11486) - `AMMs` can now be submitted on markets with more decimal places than asset decimal places.
50+
- [11561](https://github.com/vegaprotocol/vega/issues/11561) - Failing amends on `AMMs` now restore original properly.
51+
- [11583](https://github.com/vegaprotocol/vega/issues/11583) - Remove `AMMs` entirely from engine when market closes.
52+
- [11568](https://github.com/vegaprotocol/vega/issues/11568) - order book shape on closing `AMM` no longer panics.
53+
- [11540](https://github.com/vegaprotocol/vega/issues/11540) - Fix spam check for spots to use not double count quantum.
54+
- [11542](https://github.com/vegaprotocol/vega/issues/11542) - Fix non determinism in lottery ranking.
55+
- [11616](https://github.com/vegaprotocol/vega/issues/11616) - `AMM` tradable volume now calculated purely in positions to prevent loss of precision.
56+
- [11544](https://github.com/vegaprotocol/vega/issues/11544) - Fix empty candles stream.
57+
- [11619](https://github.com/vegaprotocol/vega/issues/11619) - Fix `EstimatePositions` API for capped futures.
58+
- [11579](https://github.com/vegaprotocol/vega/issues/11579) - Spot calculate fee on amend, use order price if no amended price is provided.
59+
- [11585](https://github.com/vegaprotocol/vega/issues/11585) - Initialise rebate stats service in API.
60+
- [11592](https://github.com/vegaprotocol/vega/issues/11592) - Fix the order of calls at end of epoch between rebate engine and market tracker.
61+
- [11607](https://github.com/vegaprotocol/vega/issues/11607) - Wire rank lottery distribution to team reward payout.
62+
- [959](https://github.com/vegaprotocol/core-test-coverage/issues/959) - Include `ELS` for `AMM` sub keys to the parent key `ELS`.
63+
- [11592](https://github.com/vegaprotocol/vega/issues/11592) - Fix the order of calls at end of epoch between rebate engine and market tracker.
64+
- [10907](https://github.com/vegaprotocol/vega/issues/10907) - Fix position API distressed status not getting updated once the party has been closed out.
65+
66+
2267
## 0.77.5
2368

2469
### 🐛 Fixes
2570

2671
- [11513](https://github.com/vegaprotocol/vega/issues/11513) - Rollback CometBFT to version `v0.38.8`.
27-
72+
- [11516](https://github.com/vegaprotocol/vega/issues/11516) - Fix order spam check for amends.
2873

2974
## 0.77.4
3075

3176
### 🐛 Fixes
3277

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

3682

3783
## 0.77.3

cmd/data-node/commands/start/node.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ func (l *NodeCommand) createGRPCServer(config api.Config) *api.GRPCServer {
242242
l.timeWeightedNotionalPositionService,
243243
l.gameScoreService,
244244
l.ammPoolsService,
245+
l.volumeRebateStatsService,
246+
l.volumeRebateProgramService,
245247
)
246248
return grpcServer
247249
}

cmd/data-node/commands/start/sqlsubscribers.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ type SQLSubscribers struct {
8484
timeWeightedNotionalPositionStore *sqlstore.TimeWeightedNotionalPosition
8585
gameScoreStore *sqlstore.GameScores
8686
ammPoolsStore *sqlstore.AMMPools
87+
volumeRebateStatsStore *sqlstore.VolumeRebateStats
88+
volumeRebateProgramsStore *sqlstore.VolumeRebatePrograms
8789

8890
// Services
8991
candleService *candlesv2.Svc
@@ -142,6 +144,8 @@ type SQLSubscribers struct {
142144
timeWeightedNotionalPositionService *service.TimeWeightedNotionalPosition
143145
gameScoreService *service.GameScore
144146
ammPoolsService *service.AMMPools
147+
volumeRebateStatsService *service.VolumeRebateStats
148+
volumeRebateProgramService *service.VolumeRebatePrograms
145149

146150
// Subscribers
147151
accountSub *sqlsubscribers.Account
@@ -196,6 +200,8 @@ type SQLSubscribers struct {
196200
timeWeightedNotionalPositionSub *sqlsubscribers.TimeWeightedNotionalPosition
197201
gameScoreSub *sqlsubscribers.GameScore
198202
ammPoolsSub *sqlsubscribers.AMMPools
203+
volumeRebateStatsSub *sqlsubscribers.VolumeRebateStatsUpdated
204+
volumeRebateProgramSub *sqlsubscribers.VolumeRebateProgram
199205
}
200206

201207
func (s *SQLSubscribers) GetSQLSubscribers() []broker.SQLBrokerSubscriber {
@@ -254,6 +260,8 @@ func (s *SQLSubscribers) GetSQLSubscribers() []broker.SQLBrokerSubscriber {
254260
s.timeWeightedNotionalPositionSub,
255261
s.gameScoreSub,
256262
s.ammPoolsSub,
263+
s.volumeRebateProgramSub,
264+
s.volumeRebateStatsSub,
257265
}
258266
}
259267

@@ -317,6 +325,8 @@ func (s *SQLSubscribers) CreateAllStores(ctx context.Context, Log *logging.Logge
317325
s.timeWeightedNotionalPositionStore = sqlstore.NewTimeWeightedNotionalPosition(transactionalConnectionSource)
318326
s.gameScoreStore = sqlstore.NewGameScores(transactionalConnectionSource)
319327
s.ammPoolsStore = sqlstore.NewAMMPools(transactionalConnectionSource)
328+
s.volumeRebateStatsStore = sqlstore.NewVolumeRebateStats(transactionalConnectionSource)
329+
s.volumeRebateProgramsStore = sqlstore.NewVolumeRebatePrograms(transactionalConnectionSource)
320330
}
321331

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

378390
s.marketDepthService = service.NewMarketDepth(
379391
cfg.MarketDepth,
@@ -455,5 +467,7 @@ func (s *SQLSubscribers) SetupSQLSubscribers() {
455467
s.marginModesSub = sqlsubscribers.NewMarginModes(s.marginModesService)
456468
s.timeWeightedNotionalPositionSub = sqlsubscribers.NewTimeWeightedNotionalPosition(s.timeWeightedNotionalPositionService)
457469
s.gameScoreSub = sqlsubscribers.NewGameScore(s.gameScoreStore)
470+
s.volumeRebateStatsSub = sqlsubscribers.NewVolumeRebateStatsUpdated(s.volumeRebateStatsService)
471+
s.volumeRebateProgramSub = sqlsubscribers.NewVolumeRebateProgram(s.volumeRebateProgramService)
458472
s.ammPoolsSub = sqlsubscribers.NewAMMPools(s.ammPoolsService, s.marketDepthService)
459473
}

cmd/vega/commands/init.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"errors"
2121
"fmt"
2222
"os"
23+
"path/filepath"
2324
"time"
2425

2526
"code.vegaprotocol.io/vega/core/config"
@@ -127,7 +128,19 @@ func (opts *InitCmd) Execute(args []string) error {
127128
if !initCmd.NoTendermint {
128129
tmCfg := tmcfg.DefaultConfig()
129130
tmCfg.SetRoot(os.ExpandEnv(initCmd.TendermintHome))
131+
// add a few defaults
132+
tmCfg.P2P.MaxPacketMsgPayloadSize = 16384
133+
tmCfg.P2P.SendRate = 20000000
134+
tmCfg.P2P.RecvRate = 20000000
135+
tmCfg.Mempool.Size = 10000
136+
tmCfg.Mempool.CacheSize = 20000
137+
tmCfg.Consensus.TimeoutCommit = 0 * time.Second
138+
tmCfg.Consensus.SkipTimeoutCommit = true
139+
tmCfg.Consensus.CreateEmptyBlocksInterval = 1 * time.Second
140+
tmCfg.Storage.DiscardABCIResponses = true
130141
tmcfg.EnsureRoot(tmCfg.RootDir)
142+
// then rewrite the config to apply the changes, EnsureRoot create the config, but with a default config
143+
tmcfg.WriteConfigFile(filepath.Join(tmCfg.RootDir, tmcfg.DefaultConfigDir, tmcfg.DefaultConfigFileName), tmCfg)
131144
if err := initTendermintConfiguration(output, logger, tmCfg); err != nil {
132145
return fmt.Errorf("couldn't initialise tendermint %w", err)
133146
}

cmd/vega/commands/verify/genesis_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"code.vegaprotocol.io/vega/cmd/vega/commands/verify"
2525
"code.vegaprotocol.io/vega/core/assets"
2626
"code.vegaprotocol.io/vega/core/genesis"
27-
"code.vegaprotocol.io/vega/core/netparams"
2827
"code.vegaprotocol.io/vega/core/validators"
2928

3029
"github.com/stretchr/testify/assert"
@@ -151,13 +150,6 @@ func testVerifyNetworkParams(t *testing.T) {
151150
gs = genesis.DefaultState()
152151
gs.NetParamsOverwrite = []string{"NOTREAL"}
153152
assert.Error(t, cmd.Execute([]string{writeGenesisFileWithState(t, gs)}))
154-
155-
// Check for deprecated parameter in genesis
156-
gs = genesis.DefaultState()
157-
for k := range netparams.Deprecated {
158-
gs.NetParams[k] = "hello"
159-
}
160-
assert.Error(t, cmd.Execute([]string{writeGenesisFileWithState(t, gs)}))
161153
}
162154

163155
func TestVerifyValidators(t *testing.T) {

commands/create_referral_set.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
package commands
1717

18-
import commandspb "code.vegaprotocol.io/vega/protos/vega/commands/v1"
18+
import (
19+
"errors"
20+
21+
commandspb "code.vegaprotocol.io/vega/protos/vega/commands/v1"
22+
)
1923

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

35+
// Basically this command should be rejected if we are not creating a team
36+
// but also not creating a referral set...
37+
// just check if this command is ineffective...
38+
if cmd.DoNotCreateReferralSet && !cmd.IsTeam {
39+
return errs.FinalAddForProperty("create_referral_set",
40+
errors.New("is ineffective"))
41+
}
42+
3143
if cmd.IsTeam {
3244
if cmd.Team == nil {
3345
return errs.FinalAddForProperty("create_referral_set.team", ErrIsRequired)

commands/errors.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var (
3333
ErrMustBeLessThan150 = errors.New("must be less than 150")
3434
ErrMustBeAtMost1M = errors.New("must be at most 1000000")
3535
ErrMustBeAtMost100 = errors.New("must be at most 100")
36+
ErrMustBeAtMost2048 = errors.New("must be at most 2048")
3637
ErrMustBeWithinRange7 = errors.New("must be between -7 and 7")
3738
ErrIsNotValid = errors.New("is not a valid value")
3839
ErrIsNotValidWithOCO = errors.New("is not a valid with one cancel other")

0 commit comments

Comments
 (0)