diff --git a/CHANGELOG.md b/CHANGELOG.md index fc95b3e76d..87527b2669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,7 @@ - [11544](https://github.com/vegaprotocol/vega/issues/11544) - Fix empty candles stream. - [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. ## 0.77.5 diff --git a/core/integration/setup_test.go b/core/integration/setup_test.go index d70b794414..601e44a92e 100644 --- a/core/integration/setup_test.go +++ b/core/integration/setup_test.go @@ -201,7 +201,6 @@ func newExecutionTestSetup() *executionTestSetup { execsetup.volumeDiscountProgram = volumediscount.New(execsetup.broker, execsetup.marketActivityTracker) execsetup.epochEngine.NotifyOnEpoch(execsetup.volumeDiscountProgram.OnEpoch, execsetup.volumeDiscountProgram.OnEpochRestore) execsetup.volumeRebateProgram = volumerebate.New(execsetup.broker, execsetup.marketActivityTracker) - execsetup.epochEngine.NotifyOnEpoch(execsetup.volumeRebateProgram.OnEpoch, execsetup.volumeRebateProgram.OnEpochRestore) execsetup.banking = banking.New(execsetup.log, banking.NewDefaultConfig(), execsetup.collateralEngine, execsetup.witness, execsetup.timeService, execsetup.assetsEngine, execsetup.notary, execsetup.broker, execsetup.topology, execsetup.marketActivityTracker, stubs.NewBridgeViewStub(), stubs.NewBridgeViewStub(), eventHeartbeat, execsetup.profilesEngine) @@ -228,7 +227,7 @@ func newExecutionTestSetup() *executionTestSetup { execsetup.epochEngine.NotifyOnEpoch(execsetup.executionEngine.OnEpochEvent, execsetup.executionEngine.OnEpochRestore) execsetup.epochEngine.NotifyOnEpoch(execsetup.marketActivityTracker.OnEpochEvent, execsetup.marketActivityTracker.OnEpochRestore) execsetup.epochEngine.NotifyOnEpoch(execsetup.banking.OnEpoch, execsetup.banking.OnEpochRestore) - + execsetup.epochEngine.NotifyOnEpoch(execsetup.volumeRebateProgram.OnEpoch, execsetup.volumeRebateProgram.OnEpochRestore) execsetup.delegationEngine = delegation.New(execsetup.log, delegation.NewDefaultConfig(), execsetup.broker, execsetup.topology, execsetup.stakingAccount, execsetup.epochEngine, execsetup.timeService) execsetup.activityStreak = activitystreak.New(execsetup.log, execsetup.executionEngine, execsetup.broker) diff --git a/core/protocol/all_services.go b/core/protocol/all_services.go index f2d8c9b438..974507f17e 100644 --- a/core/protocol/all_services.go +++ b/core/protocol/all_services.go @@ -334,11 +334,6 @@ func newServices( ) svcs.volumeRebate = volumerebate.NewSnapshottedEngine(svcs.broker, svcs.marketActivityTracker) - svcs.epochService.NotifyOnEpoch( - svcs.volumeRebate.OnEpoch, - svcs.volumeRebate.OnEpochRestore, - ) - svcs.banking = banking.New(svcs.log, svcs.conf.Banking, svcs.collateral, svcs.witness, svcs.timeService, svcs.assets, svcs.notary, svcs.broker, svcs.topology, svcs.marketActivityTracker, svcs.primaryBridgeView, svcs.secondaryBridgeView, svcs.forwarderHeartbeat, svcs.partiesEngine) @@ -352,6 +347,7 @@ func newServices( svcs.epochService.NotifyOnEpoch(svcs.executionEngine.OnEpochEvent, svcs.executionEngine.OnEpochRestore) svcs.epochService.NotifyOnEpoch(svcs.marketActivityTracker.OnEpochEvent, svcs.marketActivityTracker.OnEpochRestore) svcs.epochService.NotifyOnEpoch(svcs.banking.OnEpoch, svcs.banking.OnEpochRestore) + svcs.epochService.NotifyOnEpoch(svcs.volumeRebate.OnEpoch, svcs.volumeRebate.OnEpochRestore) svcs.gastimator = processor.NewGastimator(svcs.executionEngine)