Skip to content

Commit

Permalink
Merge pull request #10693 from vegaprotocol/release/v0.74.2
Browse files Browse the repository at this point in the history
release v0.74.2
  • Loading branch information
jeremyletang authored Feb 16, 2024
2 parents c58e8fc + 71856f4 commit 426c611
Show file tree
Hide file tree
Showing 93 changed files with 6,616 additions and 5,256 deletions.
42 changes: 33 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,44 @@

### 🚨 Breaking changes

- [](https://github.com/vegaprotocol/vega/issues/xxx) -
- [](https://github.com/vegaprotocol/vega/issues/xxx)

### 🗑️ Deprecation

- [](https://github.com/vegaprotocol/vega/issues/xxx) -
- [](https://github.com/vegaprotocol/vega/issues/xxx)

### 🛠 Improvements

- [](https://github.com/vegaprotocol/vega/issues/xxx) -
- [](https://github.com/vegaprotocol/vega/issues/xxx)

### 🐛 Fixes

- [](https://github.com/vegaprotocol/vega/issues/xxx) -
- [](https://github.com/vegaprotocol/vega/issues/xxx)


## 0.74.2

### 🐛 Fixes

- [10631](https://github.com/vegaprotocol/vega/issues/10631) - Fix snapshot for `ethCallEvents`
- [10643](https://github.com/vegaprotocol/vega/issues/10643) - Games `API` not showing quantum values and added filter for team and party.
- [10649](https://github.com/vegaprotocol/vega/issues/10649) - Ensure markets do not get stuck in liquidity auction after protocol upgrade.
- [10641](https://github.com/vegaprotocol/vega/issues/10641) - Fix panic in amend during auction for isolated margin.
- [10656](https://github.com/vegaprotocol/vega/issues/10656) - Fix funding rates bounds can be null for perpetuals.
- [10664](https://github.com/vegaprotocol/vega/issues/10664) - Fix isolated margin handling of submit/amend to get rid of trying to restore the state of the order book.
- [10661](https://github.com/vegaprotocol/vega/issues/10661) - Fix isolated margin handling of submit/amend to get rid of trying to restore the state of the order book.
- [10660](https://github.com/vegaprotocol/vega/issues/10660) - Fix isolated margin handling of submit/amend to get rid of trying to restore the state of the order book.
- [10601](https://github.com/vegaprotocol/vega/issues/10601) - Fix epoch by block height API is slow.
- [10299](https://github.com/vegaprotocol/vega/issues/10299) - Fix rewards transfers filter.
- [10666](https://github.com/vegaprotocol/vega/issues/10666) - Fix game API is slow.
- [10673](https://github.com/vegaprotocol/vega/issues/10673) - Fix error handling for isolated margin when insufficient funds.
- [10677](https://github.com/vegaprotocol/vega/issues/10677) - Fix validation of market proposer bonus to allow specifying/not specifying asset for metric for market proposer.
- [10669](https://github.com/vegaprotocol/vega/issues/10669) - Fix fees handling for spots in governance auction
- [10683](https://github.com/vegaprotocol/vega/issues/10683) - Fix GraphQL does not correctly marshal transfers status in filter.
- [10685](https://github.com/vegaprotocol/vega/issues/10685) - Fix list transfers returns too much data..
- [10691](https://github.com/vegaprotocol/vega/issues/10691) - Fix team stats include rewards from individual games
- [10647](https://github.com/vegaprotocol/vega/issues/10647) Add filter by game ID to transfers API.
- [10649](https://github.com/vegaprotocol/vega/issues/10649) - Ensure markets do not get stuck in liquidity auction after protocol upgrade.


## 0.74.1
Expand All @@ -25,10 +50,7 @@

- [10611](https://github.com/vegaprotocol/vega/issues/10611) - Added internal config price to update `perps`.
- [10615](https://github.com/vegaprotocol/vega/issues/10615) - Fix oracle scaling function in internal composite price.
- [10621](https://github.com/vegaprotocol/vega/issues/10516) - Fix market activity tracker storing incorrect data for previous `epochMakerFeesPaid`.


## 0.74.0
- [10621](https://github.com/vegaprotocol/vega/issues/10621) - Fix market activity tracker storing incorrect data for previous `epochMakerFeesPaid`.

### 🚨 Breaking changes

Expand Down Expand Up @@ -219,6 +241,9 @@
- [10604](https://github.com/vegaprotocol/vega/issues/10604) - Register margin modes API subscriber.
- [10595](https://github.com/vegaprotocol/vega/issues/10595) - Fix failed amends for isolated margin orders causing negative spread in console.
- [10606](https://github.com/vegaprotocol/vega/issues/10606) - Party profiles `API` was not returning results.
- [10625](https://github.com/vegaprotocol/vega/issues/10625) - Fix panic in update spot market.
- [9244](https://github.com/vegaprotocol/vega/issues/9244) - fix unit tests to use spot markets.
- [10625](https://github.com/vegaprotocol/vega/issues/10625) - Fix panic in update spot market.

## 0.73.0

Expand Down Expand Up @@ -847,7 +872,6 @@
- [9793](https://github.com/vegaprotocol/vega/issues/9793) - Map network owner correctly in creating account from transfer.
- [10516](https://github.com/vegaprotocol/vega/issues/10516) - Fix mapping of estimate position.


## 0.70.0

### 🚨 Breaking changes
Expand Down
4 changes: 4 additions & 0 deletions commands/batch_market_instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func checkBatchMarketInstructions(cmd *commandspb.BatchMarketInstructions) Error
return errs.FinalAddForProperty("batch_market_instructions", ErrIsRequired)
}

if len(cmd.UpdateMarginMode) > 0 {
return errs.FinalAddForProperty("batch_market_instructions.update_margin_mode", ErrIsDisabled)
}

// there's very little to verify here, only if the batch is not empty
// all transaction verification is done when processing then.
if len(cmd.Cancellations)+
Expand Down
1 change: 1 addition & 0 deletions commands/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ var (
ErrIsLimitedTo255Characters = errors.New("is limited to 255 characters")
ErrCannotBeBlank = errors.New("cannot be blank")
ErrIsDuplicated = errors.New("is duplicated")
ErrIsDisabled = errors.New("is disabled")
ErrMustBeAtMost250 = errors.New("must be at most 250")
)

Expand Down
9 changes: 5 additions & 4 deletions commands/proposal_submission.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,8 @@ func checkNewSpotMarketChanges(change *protoTypes.ProposalTerms_NewSpotMarket) E
return errs.FinalAddForProperty("proposal_submission.terms.change.new_spot_market.changes", ErrIsRequired)
}

return checkNewSpotMarketConfiguration(change.NewSpotMarket.Changes).AddPrefix("proposal_submission.terms.change.")
errs.Merge(checkNewSpotMarketConfiguration(change.NewSpotMarket.Changes).AddPrefix("proposal_submission.terms.change."))
return errs
}

func checkNewSpotMarketConfiguration(changes *vegapb.NewSpotMarketConfiguration) Errors {
Expand Down Expand Up @@ -857,6 +858,7 @@ func checkNewSpotMarketConfiguration(changes *vegapb.NewSpotMarketConfiguration)
errs.Merge(checkNewInstrument(changes.Instrument, "new_spot_market.changes.instrument"))
errs.Merge(checkNewSpotRiskParameters(changes))
errs.Merge(checkSLAParams(changes.SlaParams, "new_spot_market.changes.sla_params"))

return errs
}

Expand Down Expand Up @@ -972,7 +974,6 @@ func checkUpdateSpotMarketChanges(change *protoTypes.ProposalTerms_UpdateSpotMar
if change.UpdateSpotMarket == nil {
return errs.FinalAddForProperty("proposal_submission.terms.change.update_spot_market", ErrIsRequired)
}

return checkUpdateSpotMarket(change.UpdateSpotMarket).AddPrefix("proposal_submission.terms.change.")
}

Expand Down Expand Up @@ -1990,7 +1991,7 @@ func checkNewSpotRiskParameters(config *protoTypes.NewSpotMarketConfiguration) E
errs := NewErrors()

if config.RiskParameters == nil {
return errs.FinalAddForProperty("proposal_submission.terms.change.new_spot_market.changes.risk_parameters", ErrIsRequired)
return errs.FinalAddForProperty("new_spot_market.changes.risk_parameters", ErrIsRequired)
}

switch parameters := config.RiskParameters.(type) {
Expand All @@ -1999,7 +2000,7 @@ func checkNewSpotRiskParameters(config *protoTypes.NewSpotMarketConfiguration) E
case *protoTypes.NewSpotMarketConfiguration_LogNormal:
errs.Merge(checkNewSpotLogNormalRiskParameters(parameters))
default:
errs.AddForProperty("proposal_submission.terms.change.new_spot_market.changes.risk_parameters", ErrIsNotValid)
errs.AddForProperty("new_spot_market.changes.risk_parameters", ErrIsNotValid)
}

return errs
Expand Down
64 changes: 59 additions & 5 deletions commands/proposal_submission_new_spot_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func TestCheckProposalSubmissionForNewSpotMarket(t *testing.T) {
t.Run("Submitting a spot market change with position decimal places below 6 succeeds", testNewSpotMarketChangeSubmissionWithPositionDecimalPlacesBelow7Succeeds)
t.Run("Submitting a new spot market without price monitoring succeeds", testNewSpotMarketChangeSubmissionWithoutPriceMonitoringSucceeds)
t.Run("Submitting a new spot market with price monitoring succeeds", testNewSpotMarketChangeSubmissionWithPriceMonitoringSucceeds)
t.Run("Submitting a price monitoring change without triggers succeeds", testPriceMonitoringChangeSubmissionWithoutTriggersSucceeds)
t.Run("Submitting a price monitoring change with triggers succeeds", testPriceMonitoringChangeSubmissionWithTriggersSucceeds)
t.Run("Submitting a price monitoring change without triggers succeeds", testSpotPriceMonitoringChangeSubmissionWithoutTriggersSucceeds)
t.Run("Submitting a price monitoring change with triggers succeeds", testSpotPriceMonitoringChangeSubmissionWithTriggersSucceeds)
t.Run("Submitting a price monitoring change without trigger horizon fails", testSpotPriceMonitoringChangeSubmissionWithoutTriggerHorizonFails)
t.Run("Submitting a price monitoring change with trigger horizon succeeds", testSpotPriceMonitoringChangeSubmissionWithTriggerHorizonSucceeds)
t.Run("Submitting a price monitoring change with wrong trigger probability fails", testSpotPriceMonitoringChangeSubmissionWithWrongTriggerProbabilityFails)
t.Run("Submitting a price monitoring change with right trigger probability succeeds", testPriceMonitoringChangeSubmissionWithRightTriggerProbabilitySucceeds)
t.Run("Submitting a price monitoring change without trigger auction extension fails", testPriceMonitoringChangeSubmissionWithoutTriggerAuctionExtensionFails)
t.Run("Submitting a price monitoring change with trigger auction extension succeeds", testPriceMonitoringChangeSubmissionWithTriggerAuctionExtensionSucceeds)
t.Run("Submitting a price monitoring change with right trigger probability succeeds", testSpotPriceMonitoringChangeSubmissionWithRightTriggerProbabilitySucceeds)
t.Run("Submitting a price monitoring change without trigger auction extension fails", testSpotPriceMonitoringChangeSubmissionWithoutTriggerAuctionExtensionFails)
t.Run("Submitting a price monitoring change with trigger auction extension succeeds", testSpotPriceMonitoringChangeSubmissionWithTriggerAuctionExtensionSucceeds)
t.Run("Submitting a spot market change without instrument name fails", testNewSpotMarketChangeSubmissionWithoutInstrumentNameFails)
t.Run("Submitting a spot market change with instrument name succeeds", testNewSpotMarketChangeSubmissionWithInstrumentNameSucceeds)
t.Run("Submitting a spot market change without instrument code fails", testNewSpotMarketChangeSubmissionWithoutInstrumentCodeFails)
Expand Down Expand Up @@ -603,6 +603,60 @@ func testSpotPriceMonitoringChangeSubmissionWithWrongTriggerProbabilityFails(t *
}
}

func testSpotPriceMonitoringChangeSubmissionWithRightTriggerProbabilitySucceeds(t *testing.T) {
err := checkProposalSubmission(&commandspb.ProposalSubmission{
Terms: &vegapb.ProposalTerms{
Change: &vegapb.ProposalTerms_NewSpotMarket{
NewSpotMarket: &vegapb.NewSpotMarket{
Changes: &vegapb.NewSpotMarketConfiguration{
PriceMonitoringParameters: &vegapb.PriceMonitoringParameters{
Triggers: []*vegapb.PriceMonitoringTrigger{
{
Probability: "0.01",
},
{
Probability: "0.9",
},
},
},
},
},
},
},
})

assert.NotContains(t, err.Get("proposal_submission.terms.change.new_market.changes.price_monitoring_parameters.triggers.0.probability"),
errors.New("should be between 0 (exclusive) and 1 (exclusive)"))
assert.NotContains(t, err.Get("proposal_submission.terms.change.new_market.changes.price_monitoring_parameters.triggers.1.probability"),
errors.New("should be between 0 (exclusive) and 1 (exclusive)"))
}

func testSpotPriceMonitoringChangeSubmissionWithTriggerAuctionExtensionSucceeds(t *testing.T) {
err := checkProposalSubmission(&commandspb.ProposalSubmission{
Terms: &vegapb.ProposalTerms{
Change: &vegapb.ProposalTerms_NewSpotMarket{
NewSpotMarket: &vegapb.NewSpotMarket{
Changes: &vegapb.NewSpotMarketConfiguration{
PriceMonitoringParameters: &vegapb.PriceMonitoringParameters{
Triggers: []*vegapb.PriceMonitoringTrigger{
{
AuctionExtension: test.RandomPositiveI64(),
},
{
AuctionExtension: test.RandomPositiveI64(),
},
},
},
},
},
},
},
})

assert.NotContains(t, err.Get("proposal_submission.terms.change.new_spot_market.changes.price_monitoring_parameters.triggers.0.auction_extension"), commands.ErrMustBePositive)
assert.NotContains(t, err.Get("proposal_submission.terms.change.new_spot_market.changes.price_monitoring_parameters.triggers.1.auction_extension"), commands.ErrMustBePositive)
}

func testSpotMarketPriceMonitoringChangeSubmissionWithRightTriggerProbabilitySucceeds(t *testing.T) {
err := checkProposalSubmission(&commandspb.ProposalSubmission{
Terms: &protoTypes.ProposalTerms{
Expand Down
4 changes: 3 additions & 1 deletion commands/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ func CheckInputData(rawInputData []byte) (*commandspb.InputData, Errors) {
case *commandspb.InputData_ApplyReferralCode:
errs.Merge(checkApplyReferralCode(cmd.ApplyReferralCode))
case *commandspb.InputData_UpdateMarginMode:
errs.Merge(checkUpdateMarginMode(cmd.UpdateMarginMode))
// FIXME: Disable Update margin mode for now
errs.AddForProperty("update_margin_mode", ErrIsDuplicated)
// errs.Merge(checkUpdateMarginMode(cmd.UpdateMarginMode))
case *commandspb.InputData_JoinTeam:
errs.Merge(checkJoinTeam(cmd.JoinTeam))
case *commandspb.InputData_UpdatePartyProfile:
Expand Down
4 changes: 2 additions & 2 deletions commands/transfer_funds.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ func validateDispatchStrategy(toAccountType vega.AccountType, dispatchStrategy *
if len(dispatchStrategy.AssetForMetric) > 0 && !IsVegaID(dispatchStrategy.AssetForMetric) {
errs.AddForProperty(prefix+".asset_for_metric", ErrShouldBeAValidVegaID)
}
if len(dispatchStrategy.AssetForMetric) > 0 && (toAccountType == vega.AccountType_ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS || toAccountType == vega.AccountType_ACCOUNT_TYPE_REWARD_VALIDATOR_RANKING) {
errs.AddForProperty(prefix+".asset_for_metric", errors.New("not be specified when to_account type is MARKET_PROPOSERS or VALIDATOR_RANKING"))
if len(dispatchStrategy.AssetForMetric) > 0 && toAccountType == vega.AccountType_ACCOUNT_TYPE_REWARD_VALIDATOR_RANKING {
errs.AddForProperty(prefix+".asset_for_metric", errors.New("not be specified when to_account type is VALIDATOR_RANKING"))
}
// check that that the metric makes sense for the account type
if toAccountType == vega.AccountType_ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES && dispatchStrategy.Metric != vega.DispatchMetric_DISPATCH_METRIC_LP_FEES_RECEIVED {
Expand Down
92 changes: 92 additions & 0 deletions commands/transfer_funds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,98 @@ func TestTransferFunds(t *testing.T) {
},
errString: "transfer.kind.dispatch_strategy.entity_scope (ENTITY_SCOPE_TEAMS is not allowed for ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS)",
},
{
transfer: commandspb.Transfer{
FromAccountType: vega.AccountType_ACCOUNT_TYPE_GENERAL,
ToAccountType: vega.AccountType_ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS,
Kind: &commandspb.Transfer_Recurring{
Recurring: &commandspb.RecurringTransfer{
StartEpoch: 10,
EndEpoch: ptr.From(uint64(11)),
Factor: "1",
DispatchStrategy: &vega.DispatchStrategy{
AssetForMetric: "080538b7cc2249de568cb4272a17f4d5e0b0a69a1a240acbf5119d816178daff",
Metric: vega.DispatchMetric_DISPATCH_METRIC_MARKET_VALUE,
EntityScope: vega.EntityScope_ENTITY_SCOPE_INDIVIDUALS,
IndividualScope: vega.IndividualScope_INDIVIDUAL_SCOPE_ALL,
},
},
},
To: "84e2b15102a8d6c1c6b4bdf40af8a0dc21b040eaaa1c94cd10d17604b75fdc35",
Asset: "080538b7cc2249de568cb4272a17f4d5e0b0a69a1a240acbf5119d816178daff",
Amount: "1",
Reference: "testing",
},
},
{
transfer: commandspb.Transfer{
FromAccountType: vega.AccountType_ACCOUNT_TYPE_GENERAL,
ToAccountType: vega.AccountType_ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS,
Kind: &commandspb.Transfer_Recurring{
Recurring: &commandspb.RecurringTransfer{
StartEpoch: 10,
EndEpoch: ptr.From(uint64(11)),
Factor: "1",
DispatchStrategy: &vega.DispatchStrategy{
AssetForMetric: "080538b7cc2249de568cb4272a17f4d5e0b0a69a1a240acbf5119d816178daff",
Metric: vega.DispatchMetric_DISPATCH_METRIC_MARKET_VALUE,
EntityScope: vega.EntityScope_ENTITY_SCOPE_INDIVIDUALS,
IndividualScope: vega.IndividualScope_INDIVIDUAL_SCOPE_ALL,
Markets: []string{"market1", "market2"},
},
},
},
To: "84e2b15102a8d6c1c6b4bdf40af8a0dc21b040eaaa1c94cd10d17604b75fdc35",
Asset: "080538b7cc2249de568cb4272a17f4d5e0b0a69a1a240acbf5119d816178daff",
Amount: "1",
Reference: "testing",
},
},
{
transfer: commandspb.Transfer{
FromAccountType: vega.AccountType_ACCOUNT_TYPE_GENERAL,
ToAccountType: vega.AccountType_ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS,
Kind: &commandspb.Transfer_Recurring{
Recurring: &commandspb.RecurringTransfer{
StartEpoch: 10,
EndEpoch: ptr.From(uint64(11)),
Factor: "1",
DispatchStrategy: &vega.DispatchStrategy{
Metric: vega.DispatchMetric_DISPATCH_METRIC_MARKET_VALUE,
EntityScope: vega.EntityScope_ENTITY_SCOPE_INDIVIDUALS,
IndividualScope: vega.IndividualScope_INDIVIDUAL_SCOPE_ALL,
Markets: []string{"market1", "market2"},
},
},
},
To: "84e2b15102a8d6c1c6b4bdf40af8a0dc21b040eaaa1c94cd10d17604b75fdc35",
Asset: "080538b7cc2249de568cb4272a17f4d5e0b0a69a1a240acbf5119d816178daff",
Amount: "1",
Reference: "testing",
},
},
{
transfer: commandspb.Transfer{
FromAccountType: vega.AccountType_ACCOUNT_TYPE_GENERAL,
ToAccountType: vega.AccountType_ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS,
Kind: &commandspb.Transfer_Recurring{
Recurring: &commandspb.RecurringTransfer{
StartEpoch: 10,
EndEpoch: ptr.From(uint64(11)),
Factor: "1",
DispatchStrategy: &vega.DispatchStrategy{
Metric: vega.DispatchMetric_DISPATCH_METRIC_MARKET_VALUE,
EntityScope: vega.EntityScope_ENTITY_SCOPE_INDIVIDUALS,
IndividualScope: vega.IndividualScope_INDIVIDUAL_SCOPE_ALL,
},
},
},
To: "84e2b15102a8d6c1c6b4bdf40af8a0dc21b040eaaa1c94cd10d17604b75fdc35",
Asset: "080538b7cc2249de568cb4272a17f4d5e0b0a69a1a240acbf5119d816178daff",
Amount: "1",
Reference: "testing",
},
},
{
transfer: commandspb.Transfer{
FromAccountType: vega.AccountType_ACCOUNT_TYPE_GENERAL,
Expand Down
Loading

0 comments on commit 426c611

Please sign in to comment.