From ac20eac21607b756c84b29b53e961c8f360c2a44 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 16 Dec 2024 02:39:26 -0300 Subject: [PATCH] Remove unused history config: withLocalityIndex (#13109) --- erigon-lib/state/aggregator.go | 12 ++++++------ erigon-lib/state/domain_test.go | 4 ++-- erigon-lib/state/history.go | 1 - erigon-lib/state/history_test.go | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/erigon-lib/state/aggregator.go b/erigon-lib/state/aggregator.go index 17c0b02224a..38d1566cc77 100644 --- a/erigon-lib/state/aggregator.go +++ b/erigon-lib/state/aggregator.go @@ -164,7 +164,7 @@ func NewAggregator(ctx context.Context, dirs datadir.Dirs, aggregationStep uint6 valuesTable: kv.TblAccountHistoryVals, compression: seg.CompressNone, - withLocalityIndex: false, historyLargeValues: false, + historyLargeValues: false, iiCfg: iiCfg{salt: salt, dirs: dirs, db: db, withExistence: false, compressorCfg: seg.DefaultCfg, aggregationStep: aggregationStep, keysTable: kv.TblAccountHistoryKeys, valuesTable: kv.TblAccountIdx}, @@ -184,7 +184,7 @@ func NewAggregator(ctx context.Context, dirs datadir.Dirs, aggregationStep uint6 valuesTable: kv.TblStorageHistoryVals, compression: seg.CompressNone, - withLocalityIndex: false, historyLargeValues: false, + historyLargeValues: false, iiCfg: iiCfg{salt: salt, dirs: dirs, db: db, withExistence: false, compressorCfg: seg.DefaultCfg, aggregationStep: aggregationStep, keysTable: kv.TblStorageHistoryKeys, valuesTable: kv.TblStorageIdx}, @@ -205,7 +205,7 @@ func NewAggregator(ctx context.Context, dirs datadir.Dirs, aggregationStep uint6 valuesTable: kv.TblCodeHistoryVals, compression: seg.CompressKeys | seg.CompressVals, - withLocalityIndex: false, historyLargeValues: true, + historyLargeValues: true, iiCfg: iiCfg{salt: salt, dirs: dirs, db: db, withExistence: false, compressorCfg: seg.DefaultCfg, aggregationStep: aggregationStep, keysTable: kv.TblCodeHistoryKeys, valuesTable: kv.TblCodeIdx}, @@ -226,8 +226,8 @@ func NewAggregator(ctx context.Context, dirs datadir.Dirs, aggregationStep uint6 valuesTable: kv.TblCommitmentHistoryVals, compression: seg.CompressNone, - snapshotsDisabled: true, - withLocalityIndex: false, historyLargeValues: false, + snapshotsDisabled: true, + historyLargeValues: false, iiCfg: iiCfg{salt: salt, dirs: dirs, db: db, withExistence: false, compressorCfg: seg.DefaultCfg, aggregationStep: aggregationStep, keysTable: kv.TblCommitmentHistoryKeys, valuesTable: kv.TblCommitmentIdx}, @@ -245,7 +245,7 @@ func NewAggregator(ctx context.Context, dirs datadir.Dirs, aggregationStep uint6 valuesTable: kv.TblReceiptHistoryVals, compression: seg.CompressNone, - withLocalityIndex: false, historyLargeValues: false, + historyLargeValues: false, iiCfg: iiCfg{salt: salt, dirs: dirs, db: db, withExistence: false, compressorCfg: seg.DefaultCfg, aggregationStep: aggregationStep, keysTable: kv.TblReceiptHistoryKeys, valuesTable: kv.TblReceiptIdx}, diff --git a/erigon-lib/state/domain_test.go b/erigon-lib/state/domain_test.go index e122d39f41a..9aa5e31a9c4 100644 --- a/erigon-lib/state/domain_test.go +++ b/erigon-lib/state/domain_test.go @@ -97,8 +97,8 @@ func testDbAndDomainOfStep(t *testing.T, aggStep uint64, logger log.Logger) (kv. cfg := domainCfg{ name: kv.AccountsDomain, valuesTable: valsTable, hist: histCfg{ - valuesTable: historyValsTable, - withLocalityIndex: false, compression: seg.CompressNone, historyLargeValues: true, + valuesTable: historyValsTable, + compression: seg.CompressNone, historyLargeValues: true, iiCfg: iiCfg{salt: &salt, dirs: dirs, db: db, withExistence: false, aggregationStep: aggStep, keysTable: historyKeysTable, valuesTable: indexTable}, diff --git a/erigon-lib/state/history.go b/erigon-lib/state/history.go index 13728088c3f..c0c4be4d4bb 100644 --- a/erigon-lib/state/history.go +++ b/erigon-lib/state/history.go @@ -93,7 +93,6 @@ type histCfg struct { // vals: key1+key2+txNum -> value (not DupSort) historyLargeValues bool snapshotsDisabled bool // don't produce .v and .ef files, keep in db table. old data will be pruned anyway. - withLocalityIndex bool historyDisabled bool // skip all write operations to this History (even in DB) indexList idxList diff --git a/erigon-lib/state/history_test.go b/erigon-lib/state/history_test.go index 7118d03355d..a015ec6d56c 100644 --- a/erigon-lib/state/history_test.go +++ b/erigon-lib/state/history_test.go @@ -82,7 +82,7 @@ func testDbAndHistory(tb testing.TB, largeValues bool, logger log.Logger) (kv.Rw iiCfg: iiCfg{salt: &salt, dirs: dirs, db: db, withExistence: false, aggregationStep: 16, filenameBase: "hist", keysTable: keysTable, valuesTable: indexTable, }, - withLocalityIndex: false, compression: seg.CompressNone, historyLargeValues: largeValues, + compression: seg.CompressNone, historyLargeValues: largeValues, } h, err := NewHistory(cfg, logger) require.NoError(tb, err)