Skip to content

Commit

Permalink
Merge pull request #9676 from vegaprotocol/collat-spam-fix
Browse files Browse the repository at this point in the history
fix: collateral engine snapshot fixed
  • Loading branch information
ze97286 authored Oct 6, 2023
2 parents 52ddafa + 660518f commit c815564
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
- [8727](https://github.com/vegaprotocol/vega/issues/8727) - Clear parent market on checkpoint restore if the parent market was already succeeded.
- [8835](https://github.com/vegaprotocol/vega/issues/8835) - Spot snapshot fixes
- [9651](https://github.com/vegaprotocol/vega/issues/9651) - Park pegged orders if they lose their peg
- [9666]()(https://github.com/vegaprotocol/vega/issues/9666) - Fix balance cache refresh snapshot issue

## 0.72.0

Expand Down
4 changes: 4 additions & 0 deletions core/collateral/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ func (e *Engine) snapshotBalances() {
m := make(map[string]*num.Uint, len(e.partiesAccs))
quantums := map[string]*num.Uint{}
for k, v := range e.partiesAccs {
if k == "*" {
continue
}
total := num.UintZero()
for _, a := range v {
asset := a.Asset
Expand All @@ -206,6 +209,7 @@ func (e *Engine) updateNextBalanceSnapshot(t time.Time) {
func (e *Engine) OnBalanceSnapshotFrequencyUpdated(ctx context.Context, d time.Duration) error {
if e.activeRestore {
e.balanceSnapshotFrequency = d
e.activeRestore = false
return nil
}
if !e.nextBalancesSnapshot.IsZero() {
Expand Down
5 changes: 0 additions & 5 deletions core/collateral/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ func (e *Engine) restoreAccounts(ctx context.Context, accs *types.CollateralAcco
return err
}

func (e *Engine) PostRestore(ctx context.Context) error {
e.activeRestore = false
return nil
}

func (e *Engine) getOrCreateNetTreasuryAndGlobalInsForAssets(ctx context.Context, assets map[string]struct{}) {
// bit of migration - ensure that the network treasury and global insurance account are created for all assets
assetStr := make([]string, 0, len(assets))
Expand Down

0 comments on commit c815564

Please sign in to comment.