Skip to content

Commit

Permalink
erigon3: rename "history.v2" to "history.v3" to avoid naming miss-mat…
Browse files Browse the repository at this point in the history
…ch with "erigon3" (erigontech#5519)
  • Loading branch information
AskAlexSharov authored Sep 26, 2022
1 parent cadc9df commit cb60382
Show file tree
Hide file tree
Showing 56 changed files with 267 additions and 267 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ db-tools:
test:
$(GOTEST) --timeout 50s

test22:
$(GOTEST) --timeout 50s -tags erigon22
test3:
$(GOTEST) --timeout 50s -tags erigon3

## test-integration: run integration tests with a 30m timeout
test-integration:
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func NewSimulatedBackend(t *testing.T, alloc core.GenesisAlloc, gasLimit uint64)
}

func (b *SimulatedBackend) DB() kv.RwDB { return b.m.DB }
func (b *SimulatedBackend) Agg() *state2.Aggregator22 { return b.m.HistoryV2Components() }
func (b *SimulatedBackend) Agg() *state2.Aggregator22 { return b.m.HistoryV3Components() }

// Close terminates the underlying blockchain's update loop.
func (b *SimulatedBackend) Close() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/hack/tool/fromdb/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/ledgerwatch/erigon/params"
)

func HistoryV2(db kv.RoDB) (enabled bool) {
func HistoryV3(db kv.RoDB) (enabled bool) {
if err := db.View(context.Background(), func(tx kv.Tx) error {
var err error
enabled, err = rawdb.HistoryV2.Enabled(tx)
enabled, err = rawdb.HistoryV3.Enabled(tx)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/integration/commands/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
experiments []string
chain string // Which chain to use (mainnet, ropsten, rinkeby, goerli, etc.)

_forceSetHistoryV2 bool
_forceSetHistoryV3 bool
workers uint64
)

Expand Down
60 changes: 30 additions & 30 deletions cmd/integration/commands/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ var cmdSetSnap = &cobra.Command{
},
}

var cmdForceSetHistoryV2 = &cobra.Command{
Use: "force_set_history_v2",
Short: "Override existing --history.v2 flag value (if you know what you are doing)",
var cmdForceSetHistoryV3 = &cobra.Command{
Use: "force_set_history_v3",
Short: "Override existing --history.v3 flag value (if you know what you are doing)",
RunE: func(cmd *cobra.Command, args []string) error {
db := openDB(dbCfg(kv.ChainDB, chaindata), true)
defer db.Close()
return db.Update(context.Background(), func(tx kv.RwTx) error {
return rawdb.HistoryV2.ForceWrite(tx, _forceSetHistoryV2)
return rawdb.HistoryV3.ForceWrite(tx, _forceSetHistoryV3)
})
},
}
Expand Down Expand Up @@ -447,9 +447,9 @@ func init() {
withChain(cmdSetSnap)
rootCmd.AddCommand(cmdSetSnap)

withDataDir2(cmdForceSetHistoryV2)
cmdForceSetHistoryV2.Flags().BoolVar(&_forceSetHistoryV2, "history.v2", false, "")
rootCmd.AddCommand(cmdForceSetHistoryV2)
withDataDir2(cmdForceSetHistoryV3)
cmdForceSetHistoryV3.Flags().BoolVar(&_forceSetHistoryV3, "history.v3", false, "")
rootCmd.AddCommand(cmdForceSetHistoryV3)

withDataDir(cmdSetPrune)
withChain(cmdSetPrune)
Expand Down Expand Up @@ -550,7 +550,7 @@ func stageHeaders(db kv.RwDB, ctx context.Context) error {

func stageBodies(db kv.RwDB, ctx context.Context) error {
_, _, sync, _, _ := newSync(ctx, db, nil)
chainConfig, historyV2 := fromdb.ChainConfig(db), fromdb.HistoryV2(db)
chainConfig, historyV3 := fromdb.ChainConfig(db), fromdb.HistoryV3(db)

if err := db.Update(ctx, func(tx kv.RwTx) error {
s := stage(sync, tx, nil, stages.Bodies)
Expand All @@ -561,7 +561,7 @@ func stageBodies(db kv.RwDB, ctx context.Context) error {
}

u := sync.NewUnwindState(stages.Bodies, s.BlockNumber-unwind, s.BlockNumber)
if err := stagedsync.UnwindBodiesStage(u, tx, stagedsync.StageBodiesCfg(db, nil, nil, nil, nil, 0, *chainConfig, 0, allSnapshots(db), getBlockReader(db), historyV2), ctx); err != nil {
if err := stagedsync.UnwindBodiesStage(u, tx, stagedsync.StageBodiesCfg(db, nil, nil, nil, nil, 0, *chainConfig, 0, allSnapshots(db), getBlockReader(db), historyV3), ctx); err != nil {
return err
}

Expand Down Expand Up @@ -679,13 +679,13 @@ func stageSenders(db kv.RwDB, ctx context.Context) error {
}

func stageExec(db kv.RwDB, ctx context.Context) error {
chainConfig, historyV2, pm := fromdb.ChainConfig(db), fromdb.HistoryV2(db), fromdb.PruneMode(db)
chainConfig, historyV3, pm := fromdb.ChainConfig(db), fromdb.HistoryV3(db), fromdb.PruneMode(db)
dirs := datadir.New(datadirCli)
engine, vmConfig, sync, _, _ := newSync(ctx, db, nil)
must(sync.SetCurrentStage(stages.Execution))

if reset {
//if historyV2 {
//if historyV3 {
// dir.Recreate(path.Join(dirs.DataDir, "agg22"))
// dir.Recreate(path.Join(dirs.DataDir, "db22"))
// dir.Recreate(path.Join(dirs.DataDir, "erigon22"))
Expand Down Expand Up @@ -718,7 +718,7 @@ func stageExec(db kv.RwDB, ctx context.Context) error {
genesis := core.DefaultGenesisBlockByChainName(chain)
cfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, nil, chainConfig, engine, vmConfig, nil,
/*stateStream=*/ false,
/*badBlockHalt=*/ false, historyV2, dirs, getBlockReader(db), nil, genesis, int(workers), agg())
/*badBlockHalt=*/ false, historyV3, dirs, getBlockReader(db), nil, genesis, int(workers), agg())
if unwind > 0 {
u := sync.NewUnwindState(stages.Execution, s.BlockNumber-unwind, s.BlockNumber)
err := stagedsync.UnwindExecutionStage(u, s, nil, ctx, cfg, true)
Expand Down Expand Up @@ -748,7 +748,7 @@ func stageExec(db kv.RwDB, ctx context.Context) error {
}

func stageTrie(db kv.RwDB, ctx context.Context) error {
dirs, pm, historyV2 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV2(db)
dirs, pm, historyV3 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV3(db)
_, _, sync, _, _ := newSync(ctx, db, nil)
must(sync.SetCurrentStage(stages.IntermediateHashes))

Expand Down Expand Up @@ -776,7 +776,7 @@ func stageTrie(db kv.RwDB, ctx context.Context) error {

log.Info("StageExec", "progress", execStage.BlockNumber)
log.Info("StageTrie", "progress", s.BlockNumber)
cfg := stagedsync.StageTrieCfg(db, true, true, false, dirs.Tmp, getBlockReader(db), nil, historyV2, agg())
cfg := stagedsync.StageTrieCfg(db, true, true, false, dirs.Tmp, getBlockReader(db), nil, historyV3, agg())
if unwind > 0 {
u := sync.NewUnwindState(stages.IntermediateHashes, s.BlockNumber-unwind, s.BlockNumber)
if err := stagedsync.UnwindIntermediateHashesStage(u, s, tx, cfg, ctx); err != nil {
Expand All @@ -801,7 +801,7 @@ func stageTrie(db kv.RwDB, ctx context.Context) error {
}

func stageHashState(db kv.RwDB, ctx context.Context) error {
dirs, pm, historyV2 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV2(db)
dirs, pm, historyV3 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV3(db)
_, _, sync, _, _ := newSync(ctx, db, nil)
must(sync.SetCurrentStage(stages.HashState))

Expand Down Expand Up @@ -829,7 +829,7 @@ func stageHashState(db kv.RwDB, ctx context.Context) error {

log.Info("Stage", "name", s.ID, "progress", s.BlockNumber)

cfg := stagedsync.StageHashStateCfg(db, dirs, historyV2, agg())
cfg := stagedsync.StageHashStateCfg(db, dirs, historyV3, agg())
if unwind > 0 {
u := sync.NewUnwindState(stages.HashState, s.BlockNumber-unwind, s.BlockNumber)
err = stagedsync.UnwindHashStateStage(u, s, tx, cfg, ctx)
Expand All @@ -855,9 +855,9 @@ func stageHashState(db kv.RwDB, ctx context.Context) error {
}

func stageLogIndex(db kv.RwDB, ctx context.Context) error {
dirs, pm, historyV2 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV2(db)
if historyV2 {
return fmt.Errorf("this stage is disable in --history.v2=true")
dirs, pm, historyV3 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV3(db)
if historyV3 {
return fmt.Errorf("this stage is disable in --history.v3=true")
}
_, _, sync, _, _ := newSync(ctx, db, nil)
must(sync.SetCurrentStage(stages.LogIndex))
Expand Down Expand Up @@ -912,9 +912,9 @@ func stageLogIndex(db kv.RwDB, ctx context.Context) error {
}

func stageCallTraces(db kv.RwDB, ctx context.Context) error {
dirs, pm, historyV2 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV2(db)
if historyV2 {
return fmt.Errorf("this stage is disable in --history.v2=true")
dirs, pm, historyV3 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV3(db)
if historyV3 {
return fmt.Errorf("this stage is disable in --history.v3=true")
}
_, _, sync, _, _ := newSync(ctx, db, nil)
must(sync.SetCurrentStage(stages.CallTraces))
Expand Down Expand Up @@ -975,9 +975,9 @@ func stageCallTraces(db kv.RwDB, ctx context.Context) error {
}

func stageHistory(db kv.RwDB, ctx context.Context) error {
dirs, pm, historyV2 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV2(db)
if historyV2 {
return fmt.Errorf("this stage is disable in --history.v2=true")
dirs, pm, historyV3 := datadir.New(datadirCli), fromdb.PruneMode(db), fromdb.HistoryV3(db)
if historyV3 {
return fmt.Errorf("this stage is disable in --history.v3=true")
}
_, _, sync, _, _ := newSync(ctx, db, nil)
must(sync.SetCurrentStage(stages.AccountHistoryIndex))
Expand Down Expand Up @@ -1162,7 +1162,7 @@ func agg() *libstate.Aggregator22 {
aggDir := path.Join(datadirCli, "snapshots", "history")
dir.MustExist(aggDir)
var err error
_aggSingleton, err = libstate.NewAggregator22(aggDir, ethconfig.HistoryV2AggregationStep)
_aggSingleton, err = libstate.NewAggregator22(aggDir, ethconfig.HistoryV3AggregationStep)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -1191,7 +1191,7 @@ func getBlockReader(db kv.RoDB) (blockReader services.FullBlockReader) {

func newSync(ctx context.Context, db kv.RwDB, miningConfig *params.MiningConfig) (consensus.Engine, *vm.Config, *stagedsync.Sync, *stagedsync.Sync, stagedsync.MiningState) {
logger := log.New()
dirs, historyV2, pm := datadir.New(datadirCli), fromdb.HistoryV2(db), fromdb.PruneMode(db)
dirs, historyV3, pm := datadir.New(datadirCli), fromdb.HistoryV3(db), fromdb.PruneMode(db)

vmConfig := &vm.Config{}

Expand All @@ -1213,7 +1213,7 @@ func newSync(ctx context.Context, db kv.RwDB, miningConfig *params.MiningConfig)
must(batchSize.UnmarshalText([]byte(batchSizeStr)))

cfg := ethconfig.Defaults
cfg.HistoryV2 = historyV2
cfg.HistoryV3 = historyV3
cfg.Prune = pm
cfg.BatchSize = batchSize
cfg.DeprecatedTxPool.Disable = true
Expand Down Expand Up @@ -1258,8 +1258,8 @@ func newSync(ctx context.Context, db kv.RwDB, miningConfig *params.MiningConfig)
stagedsync.MiningStages(ctx,
stagedsync.StageMiningCreateBlockCfg(db, miner, *chainConfig, engine, nil, nil, nil, dirs.Tmp),
stagedsync.StageMiningExecCfg(db, miner, events, *chainConfig, engine, &vm.Config{}, dirs.Tmp, nil, 0),
stagedsync.StageHashStateCfg(db, dirs, historyV2, agg()),
stagedsync.StageTrieCfg(db, false, true, false, dirs.Tmp, br, nil, historyV2, agg()),
stagedsync.StageHashStateCfg(db, dirs, historyV3, agg()),
stagedsync.StageTrieCfg(db, false, true, false, dirs.Tmp, br, nil, historyV3, agg()),
stagedsync.StageMiningFinishCfg(db, *chainConfig, engine, miner, miningCancel),
),
stagedsync.MiningUnwindOrder,
Expand Down
14 changes: 7 additions & 7 deletions cmd/integration/commands/state_stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func init() {

func syncBySmallSteps(db kv.RwDB, miningConfig params.MiningConfig, ctx context.Context) error {
engine, vmConfig, stateStages, miningStages, miner := newSync(ctx, db, &miningConfig)
chainConfig, historyV2, pm := fromdb.ChainConfig(db), fromdb.HistoryV2(db), fromdb.PruneMode(db)
chainConfig, historyV3, pm := fromdb.ChainConfig(db), fromdb.HistoryV3(db), fromdb.PruneMode(db)
dirs := datadir.New(datadirCli)

tx, err := db.BeginRw(ctx)
Expand Down Expand Up @@ -184,7 +184,7 @@ func syncBySmallSteps(db kv.RwDB, miningConfig params.MiningConfig, ctx context.
stateStages.DisableStages(stages.Headers, stages.BlockHashes, stages.Bodies, stages.Senders)

genesis := core.DefaultGenesisBlockByChainName(chain)
execCfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, changeSetHook, chainConfig, engine, vmConfig, nil, false, false, historyV2, dirs, getBlockReader(db), nil, genesis, int(workers), agg())
execCfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, changeSetHook, chainConfig, engine, vmConfig, nil, false, false, historyV3, dirs, getBlockReader(db), nil, genesis, int(workers), agg())

execUntilFunc := func(execToBlock uint64) func(firstCycle bool, badBlockUnwind bool, stageState *stagedsync.StageState, unwinder stagedsync.Unwinder, tx kv.RwTx) error {
return func(firstCycle bool, badBlockUnwind bool, s *stagedsync.StageState, unwinder stagedsync.Unwinder, tx kv.RwTx) error {
Expand Down Expand Up @@ -410,7 +410,7 @@ func checkMinedBlock(b1, b2 *types.Block, chainConfig *params.ChainConfig) {
func loopIh(db kv.RwDB, ctx context.Context, unwind uint64) error {
_, _, sync, _, _ := newSync(ctx, db, nil)
dirs := datadir.New(datadirCli)
historyV2 := fromdb.HistoryV2(db)
historyV3 := fromdb.HistoryV3(db)

tx, err := db.BeginRw(ctx)
if err != nil {
Expand All @@ -425,12 +425,12 @@ func loopIh(db kv.RwDB, ctx context.Context, unwind uint64) error {
to := execStage.BlockNumber - unwind
_ = sync.SetCurrentStage(stages.HashState)
u := &stagedsync.UnwindState{ID: stages.HashState, UnwindPoint: to}
if err = stagedsync.UnwindHashStateStage(u, stage(sync, tx, nil, stages.HashState), tx, stagedsync.StageHashStateCfg(db, dirs, historyV2, agg()), ctx); err != nil {
if err = stagedsync.UnwindHashStateStage(u, stage(sync, tx, nil, stages.HashState), tx, stagedsync.StageHashStateCfg(db, dirs, historyV3, agg()), ctx); err != nil {
return err
}
_ = sync.SetCurrentStage(stages.IntermediateHashes)
u = &stagedsync.UnwindState{ID: stages.IntermediateHashes, UnwindPoint: to}
if err = stagedsync.UnwindIntermediateHashesStage(u, stage(sync, tx, nil, stages.IntermediateHashes), tx, stagedsync.StageTrieCfg(db, true, true, false, dirs.Tmp, getBlockReader(db), nil, historyV2, agg()), ctx); err != nil {
if err = stagedsync.UnwindIntermediateHashesStage(u, stage(sync, tx, nil, stages.IntermediateHashes), tx, stagedsync.StageTrieCfg(db, true, true, false, dirs.Tmp, getBlockReader(db), nil, historyV3, agg()), ctx); err != nil {
return err
}
must(tx.Commit())
Expand Down Expand Up @@ -492,7 +492,7 @@ func loopExec(db kv.RwDB, ctx context.Context, unwind uint64) error {
sync.EnableStages(stages.Execution)
var batchSize datasize.ByteSize
must(batchSize.UnmarshalText([]byte(batchSizeStr)))
historyV2, err := rawdb.HistoryV2.Enabled(tx)
historyV3, err := rawdb.HistoryV3.Enabled(tx)
if err != nil {
return err
}
Expand All @@ -502,7 +502,7 @@ func loopExec(db kv.RwDB, ctx context.Context, unwind uint64) error {
genesis := core.DefaultGenesisBlockByChainName(chain)
cfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, nil, chainConfig, engine, vmConfig, nil,
/*stateStream=*/ false,
/*badBlockHalt=*/ false, historyV2, dirs, getBlockReader(db), nil, genesis, int(workers), agg())
/*badBlockHalt=*/ false, historyV3, dirs, getBlockReader(db), nil, genesis, int(workers), agg())

// set block limit of execute stage
sync.MockExecFunc(stages.Execution, func(firstCycle bool, badBlockUnwind bool, stageState *stagedsync.StageState, unwinder stagedsync.Unwinder, tx kv.RwTx) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
if cfg.WithDatadir {
e22Dir := filepath.Join(cfg.DataDir, "erigon22")
dir.MustExist(e22Dir)
if agg, err = libstate.NewAggregator22(e22Dir, ethconfig.HistoryV2AggregationStep); err != nil {
if agg, err = libstate.NewAggregator22(e22Dir, ethconfig.HistoryV3AggregationStep); err != nil {
return nil, nil, nil, nil, nil, nil, nil, ff, nil, fmt.Errorf("create aggregator: %w", err)
}
if err = agg.ReopenFiles(); err != nil {
Expand Down
10 changes: 5 additions & 5 deletions cmd/rpcdaemon/commands/call_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestCallTraceOneByOne(t *testing.T) {
t.Fatalf("generate chain: %v", err)
}

agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
api := NewTraceAPI(
NewBaseApi(nil, kvcache.New(kvcache.DefaultCoherentConfig), snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout),
m.DB, &httpcfg.HttpCfg{})
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestCallTraceUnwind(t *testing.T) {
t.Fatalf("generate chainB: %v", err)
}

agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
api := NewTraceAPI(NewBaseApi(nil, kvcache.New(kvcache.DefaultCoherentConfig), snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout), m.DB, &httpcfg.HttpCfg{})
if err = m.InsertChain(chainA); err != nil {
t.Fatalf("inserting chainA: %v", err)
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestCallTraceUnwind(t *testing.T) {

func TestFilterNoAddresses(t *testing.T) {
m := stages.Mock(t)
if m.HistoryV2 {
if m.HistoryV3 {
t.Skip()
}
chain, err := core.GenerateChain(m.ChainConfig, m.Genesis, m.Engine, m.DB, 10, func(i int, gen *core.BlockGen) {
Expand All @@ -165,7 +165,7 @@ func TestFilterNoAddresses(t *testing.T) {
if err != nil {
t.Fatalf("generate chain: %v", err)
}
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
api := NewTraceAPI(NewBaseApi(nil, kvcache.New(kvcache.DefaultCoherentConfig), snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout), m.DB, &httpcfg.HttpCfg{})
// Insert blocks 1 by 1, to tirgget possible "off by one" errors
for i := 0; i < chain.Length(); i++ {
Expand All @@ -190,7 +190,7 @@ func TestFilterNoAddresses(t *testing.T) {

func TestFilterAddressIntersection(t *testing.T) {
m := stages.Mock(t)
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
api := NewTraceAPI(NewBaseApi(nil, kvcache.New(kvcache.DefaultCoherentConfig), snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout), m.DB, &httpcfg.HttpCfg{})

toAddress1, toAddress2, other := common.Address{1}, common.Address{2}, common.Address{3}
Expand Down
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/commands/corner_cases_support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
func TestNotFoundMustReturnNil(t *testing.T) {
require := require.New(t)
m, _, _ := rpcdaemontest.CreateTestSentry(t)
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(
NewBaseApi(nil, stateCache, snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout),
Expand Down
8 changes: 4 additions & 4 deletions cmd/rpcdaemon/commands/debug_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var debugTraceTransactionNoRefundTests = []struct {

func TestTraceBlockByNumber(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t)
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
baseApi := NewBaseApi(nil, stateCache, snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout)
ethApi := NewEthAPI(baseApi, m.DB, nil, nil, nil, 5000000)
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestTraceBlockByNumber(t *testing.T) {

func TestTraceBlockByHash(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t)
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
baseApi := NewBaseApi(nil, stateCache, snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout)
ethApi := NewEthAPI(baseApi, m.DB, nil, nil, nil, 5000000)
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestTraceBlockByHash(t *testing.T) {

func TestTraceTransaction(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t)
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewPrivateDebugAPI(
NewBaseApi(nil, stateCache, snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout),
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestTraceTransaction(t *testing.T) {

func TestTraceTransactionNoRefund(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t)
agg := m.HistoryV2Components()
agg := m.HistoryV3Components()
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewPrivateDebugAPI(
NewBaseApi(nil, stateCache, snapshotsync.NewBlockReader(), agg, false, rpccfg.DefaultEvmCallTimeout),
Expand Down
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/commands/erigon_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (api *ErigonImpl) GetBalanceChangesInBlock(ctx context.Context, blockNrOrHa

balancesMapping := make(map[common.Address]*hexutil.Big)

newReader, err := rpchelper.CreateStateReader(ctx, tx, blockNrOrHash, api.filters, api.stateCache, api.historyV2(tx), api._agg)
newReader, err := rpchelper.CreateStateReader(ctx, tx, blockNrOrHash, api.filters, api.stateCache, api.historyV3(tx), api._agg)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit cb60382

Please sign in to comment.