Skip to content

Commit

Permalink
move DiscardHistory - from runtime to Schema (#14026)
Browse files Browse the repository at this point in the history
slowly reducing amount of private method used by SharedDomains
  • Loading branch information
AskAlexSharov authored Mar 1, 2025
1 parent 7c788fe commit 56dc96e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
10 changes: 0 additions & 10 deletions erigon-lib/state/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,6 @@ func (a *Aggregator) SetCompressWorkers(i int) {
}
}

func (a *Aggregator) DiscardHistory(name kv.Domain) *Aggregator {
a.d[name].historyDisabled = true
return a
}

func (a *Aggregator) EnableHistory(name kv.Domain) *Aggregator {
a.d[name].historyDisabled = false
return a
}

func (a *Aggregator) HasBackgroundFilesBuild2() bool {
return a.buildingFiles.Load() || a.mergingFiles.Load()
}
Expand Down
1 change: 1 addition & 0 deletions erigon-lib/state/aggregator2.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ var Schema = map[kv.Domain]domainCfg{
historyLargeValues: false,
filenameBase: kv.CommitmentDomain.String(),
historyIdx: kv.CommitmentHistoryIdx,
historyDisabled: true,

iiCfg: iiCfg{
keysTable: kv.TblCommitmentHistoryKeys, valuesTable: kv.TblCommitmentIdx,
Expand Down
2 changes: 0 additions & 2 deletions erigon-lib/state/domain_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ func NewSharedDomains(tx kv.Tx, logger log.Logger) (*SharedDomains, error) {
sd.SetTx(tx)
sd.iiWriters = make([]*invertedIndexBufferedWriter, len(sd.aggTx.iis))

sd.aggTx.a.DiscardHistory(kv.CommitmentDomain)

for id, ii := range sd.aggTx.iis {
sd.iiWriters[id] = ii.NewWriter()
}
Expand Down

0 comments on commit 56dc96e

Please sign in to comment.