Skip to content

Commit 8e3ac8a

Browse files
AlexeyAkhunovAlexey SharpAlex Sharp
authored
Erigon2 upgrade 2 prototype (erigontech#4341)
* Erigon2 upgrade 2 prototype * Latest erigon-lib * Fixes * Fix print * Fix maxSpan * Reduce maxSpan * Remove duplicate joins * TxNum * Fix resuming * first draft of history22 * Introduce historical reads * Update to erigon-lib * Update erigon-lib * Update erigon-lib * Fixes and tracing for checkChangeSets * More trace * Print account details * fix getHeader * Update to erigon-lib main * Add tracer indices and event log indices * Fix calltracer * Fix calltracer * Duplicate rpcdaemon into rpcdaemon22 * Fix tests * Fix tests * Fix tests * Update to latest erigon-lib Co-authored-by: Alexey Sharp <[email protected]> Co-authored-by: Alex Sharp <[email protected]>
1 parent 43f5f0a commit 8e3ac8a

File tree

119 files changed

+25816
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+25816
-68
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ COMMANDS += integration
6868
COMMANDS += observer
6969
COMMANDS += pics
7070
COMMANDS += rpcdaemon
71+
COMMANDS += rpcdaemon22
7172
COMMANDS += rpctest
7273
COMMANDS += sentry
7374
COMMANDS += state

cmd/rpcdaemon/cli/config.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli/httpcfg"
3232
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/health"
3333
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
34-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
3534
"github.com/ledgerwatch/erigon/cmd/utils"
3635
"github.com/ledgerwatch/erigon/common"
3736
"github.com/ledgerwatch/erigon/common/hexutil"
@@ -41,6 +40,7 @@ import (
4140
"github.com/ledgerwatch/erigon/node/nodecfg"
4241
"github.com/ledgerwatch/erigon/params"
4342
"github.com/ledgerwatch/erigon/rpc"
43+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
4444
"github.com/ledgerwatch/erigon/turbo/services"
4545
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
4646
"github.com/ledgerwatch/erigon/turbo/snapshotsync/snap"
@@ -209,7 +209,7 @@ func checkDbCompatibility(ctx context.Context, db kv.RoDB) error {
209209
func EmbeddedServices(ctx context.Context, erigonDB kv.RoDB, stateCacheCfg kvcache.CoherentConfig, blockReader services.FullBlockReader, ethBackendServer remote.ETHBACKENDServer,
210210
txPoolServer txpool.TxpoolServer, miningServer txpool.MiningServer,
211211
) (
212-
eth rpcinterfaces.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient, starknet *rpcservices.StarknetService, stateCache kvcache.Cache, ff *rpcservices.Filters, err error,
212+
eth rpchelper.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient, starknet *rpcservices.StarknetService, stateCache kvcache.Cache, ff *rpchelper.Filters, err error,
213213
) {
214214
if stateCacheCfg.KeysLimit > 0 {
215215
stateCache = kvcache.New(stateCacheCfg)
@@ -226,18 +226,18 @@ func EmbeddedServices(ctx context.Context, erigonDB kv.RoDB, stateCacheCfg kvcac
226226
eth = rpcservices.NewRemoteBackend(directClient, erigonDB, blockReader)
227227
txPool = direct.NewTxPoolClient(txPoolServer)
228228
mining = direct.NewMiningClient(miningServer)
229-
ff = rpcservices.New(ctx, eth, txPool, mining, func() {})
229+
ff = rpchelper.New(ctx, eth, txPool, mining, func() {})
230230
return
231231
}
232232

233233
// RemoteServices - use when RPCDaemon run as independent process. Still it can use --datadir flag to enable
234234
// `cfg.WithDatadir` (mode when it on 1 machine with Erigon)
235235
func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, rootCancel context.CancelFunc) (
236236
db kv.RoDB, borDb kv.RoDB,
237-
eth rpcinterfaces.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient,
237+
eth rpchelper.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient,
238238
starknet *rpcservices.StarknetService,
239239
stateCache kvcache.Cache, blockReader services.FullBlockReader,
240-
ff *rpcservices.Filters, err error) {
240+
ff *rpchelper.Filters, err error) {
241241
if !cfg.WithDatadir && cfg.PrivateApiAddr == "" {
242242
return nil, nil, nil, nil, nil, nil, nil, nil, ff, fmt.Errorf("either remote db or local db must be specified")
243243
}
@@ -419,7 +419,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
419419
starknet = rpcservices.NewStarknetService(starknetConn)
420420
}
421421

422-
ff = rpcservices.New(ctx, eth, txPool, mining, onNewSnapshot)
422+
ff = rpchelper.New(ctx, eth, txPool, mining, onNewSnapshot)
423423

424424
return db, borDb, eth, txPool, mining, starknet, stateCache, blockReader, ff, err
425425
}

cmd/rpcdaemon/commands/admin_api.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"errors"
66
"fmt"
77

8-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
98
"github.com/ledgerwatch/erigon/p2p"
9+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1010
)
1111

1212
// AdminAPI the interface for the admin_* RPC commands.
@@ -21,11 +21,11 @@ type AdminAPI interface {
2121

2222
// AdminAPIImpl data structure to store things needed for admin_* commands.
2323
type AdminAPIImpl struct {
24-
ethBackend rpcinterfaces.ApiBackend
24+
ethBackend rpchelper.ApiBackend
2525
}
2626

2727
// NewAdminAPI returns AdminAPIImpl instance.
28-
func NewAdminAPI(eth rpcinterfaces.ApiBackend) *AdminAPIImpl {
28+
func NewAdminAPI(eth rpchelper.ApiBackend) *AdminAPIImpl {
2929
return &AdminAPIImpl{
3030
ethBackend: eth,
3131
}

cmd/rpcdaemon/commands/daemon.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import (
66
"github.com/ledgerwatch/erigon-lib/kv"
77
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
88
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli/httpcfg"
9-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
10-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
119
"github.com/ledgerwatch/erigon/rpc"
10+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1211
"github.com/ledgerwatch/erigon/turbo/services"
1312
)
1413

1514
// APIList describes the list of available RPC apis
16-
func APIList(db kv.RoDB, borDb kv.RoDB, eth rpcinterfaces.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient,
17-
starknet starknet.CAIROVMClient, filters *rpcservices.Filters, stateCache kvcache.Cache,
15+
func APIList(db kv.RoDB, borDb kv.RoDB, eth rpchelper.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient,
16+
starknet starknet.CAIROVMClient, filters *rpchelper.Filters, stateCache kvcache.Cache,
1817
blockReader services.FullBlockReader, cfg httpcfg.HttpCfg) (list []rpc.API) {
1918

2019
base := NewBaseApi(filters, stateCache, blockReader, cfg.WithDatadir)

cmd/rpcdaemon/commands/engine_api.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"github.com/ledgerwatch/erigon-lib/gointerfaces/remote"
1212
types2 "github.com/ledgerwatch/erigon-lib/gointerfaces/types"
1313
"github.com/ledgerwatch/erigon-lib/kv"
14-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
1514
"github.com/ledgerwatch/erigon/common"
1615
"github.com/ledgerwatch/erigon/common/hexutil"
1716
"github.com/ledgerwatch/erigon/core/types"
17+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1818
"github.com/ledgerwatch/log/v3"
1919
)
2020

@@ -69,7 +69,7 @@ type EngineAPI interface {
6969
type EngineImpl struct {
7070
*BaseAPI
7171
db kv.RoDB
72-
api rpcinterfaces.ApiBackend
72+
api rpchelper.ApiBackend
7373
}
7474

7575
func convertPayloadStatus(x *remote.EnginePayloadStatus) map[string]interface{} {
@@ -253,7 +253,7 @@ func (e *EngineImpl) ExchangeTransitionConfigurationV1(ctx context.Context, beac
253253
}
254254

255255
// NewEngineAPI returns EngineImpl instance
256-
func NewEngineAPI(base *BaseAPI, db kv.RoDB, api rpcinterfaces.ApiBackend) *EngineImpl {
256+
func NewEngineAPI(base *BaseAPI, db kv.RoDB, api rpchelper.ApiBackend) *EngineImpl {
257257
return &EngineImpl{
258258
BaseAPI: base,
259259
db: db,

cmd/rpcdaemon/commands/erigon_api.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"context"
55

66
"github.com/ledgerwatch/erigon-lib/kv"
7-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
87
"github.com/ledgerwatch/erigon/common"
98
"github.com/ledgerwatch/erigon/core/types"
109
"github.com/ledgerwatch/erigon/p2p"
1110
"github.com/ledgerwatch/erigon/rpc"
11+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1212
)
1313

1414
// ErigonAPI Erigon specific routines
@@ -39,11 +39,11 @@ type ErigonAPI interface {
3939
type ErigonImpl struct {
4040
*BaseAPI
4141
db kv.RoDB
42-
ethBackend rpcinterfaces.ApiBackend
42+
ethBackend rpchelper.ApiBackend
4343
}
4444

4545
// NewErigonAPI returns ErigonImpl instance
46-
func NewErigonAPI(base *BaseAPI, db kv.RoDB, eth rpcinterfaces.ApiBackend) *ErigonImpl {
46+
func NewErigonAPI(base *BaseAPI, db kv.RoDB, eth rpchelper.ApiBackend) *ErigonImpl {
4747
return &ErigonImpl{
4848
BaseAPI: base,
4949
db: db,

cmd/rpcdaemon/commands/eth_api.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
"github.com/ledgerwatch/erigon-lib/gointerfaces/txpool"
1212
"github.com/ledgerwatch/erigon-lib/kv"
1313
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
14-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
15-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
1614
"github.com/ledgerwatch/erigon/common"
1715
"github.com/ledgerwatch/erigon/common/hexutil"
1816
"github.com/ledgerwatch/erigon/common/math"
@@ -23,6 +21,7 @@ import (
2321
"github.com/ledgerwatch/erigon/internal/ethapi"
2422
"github.com/ledgerwatch/erigon/params"
2523
"github.com/ledgerwatch/erigon/rpc"
24+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
2625
"github.com/ledgerwatch/erigon/turbo/services"
2726
)
2827

@@ -96,7 +95,7 @@ type EthAPI interface {
9695
type BaseAPI struct {
9796
stateCache kvcache.Cache // thread-safe
9897
blocksLRU *lru.Cache // thread-safe
99-
filters *rpcservices.Filters
98+
filters *rpchelper.Filters
10099
_chainConfig *params.ChainConfig
101100
_genesis *types.Block
102101
_genesisLock sync.RWMutex
@@ -106,7 +105,7 @@ type BaseAPI struct {
106105
TevmEnabled bool // experiment
107106
}
108107

109-
func NewBaseApi(f *rpcservices.Filters, stateCache kvcache.Cache, blockReader services.FullBlockReader, singleNodeMode bool) *BaseAPI {
108+
func NewBaseApi(f *rpchelper.Filters, stateCache kvcache.Cache, blockReader services.FullBlockReader, singleNodeMode bool) *BaseAPI {
110109
blocksLRUSize := 128 // ~32Mb
111110
if !singleNodeMode {
112111
blocksLRUSize = 512
@@ -230,15 +229,15 @@ func (api *BaseAPI) blockByRPCNumber(number rpc.BlockNumber, tx kv.Tx) (*types.B
230229
// APIImpl is implementation of the EthAPI interface based on remote Db access
231230
type APIImpl struct {
232231
*BaseAPI
233-
ethBackend rpcinterfaces.ApiBackend
232+
ethBackend rpchelper.ApiBackend
234233
txPool txpool.TxpoolClient
235234
mining txpool.MiningClient
236235
db kv.RoDB
237236
GasCap uint64
238237
}
239238

240239
// NewEthAPI returns APIImpl instance
241-
func NewEthAPI(base *BaseAPI, db kv.RoDB, eth rpcinterfaces.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient, gascap uint64) *APIImpl {
240+
func NewEthAPI(base *BaseAPI, db kv.RoDB, eth rpchelper.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient, gascap uint64) *APIImpl {
242241
if gascap == 0 {
243242
gascap = uint64(math.MaxUint64 / 2)
244243
}

cmd/rpcdaemon/commands/eth_filters.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"context"
55
"fmt"
66

7-
filters2 "github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
87
"github.com/ledgerwatch/erigon/common"
98
"github.com/ledgerwatch/erigon/common/debug"
109
"github.com/ledgerwatch/erigon/common/hexutil"
1110
"github.com/ledgerwatch/erigon/core/types"
1211
"github.com/ledgerwatch/erigon/eth/filters"
1312
"github.com/ledgerwatch/erigon/rpc"
13+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1414
"github.com/ledgerwatch/log/v3"
1515
)
1616

@@ -90,11 +90,11 @@ func (api *APIImpl) UninstallFilter(_ context.Context, index string) (bool, erro
9090
if len(index) >= 2 && index[0] == '0' && (index[1] == 'x' || index[1] == 'X') {
9191
index = index[2:]
9292
}
93-
isDeleted := api.filters.UnsubscribePendingBlock(filters2.PendingBlockSubID(index)) ||
94-
api.filters.UnsubscribePendingTxs(filters2.PendingTxsSubID(index))
93+
isDeleted := api.filters.UnsubscribePendingBlock(rpchelper.PendingBlockSubID(index)) ||
94+
api.filters.UnsubscribePendingTxs(rpchelper.PendingTxsSubID(index))
9595
id, err := hexutil.DecodeUint64(index)
9696
if err == nil {
97-
return isDeleted || api.filters.UnsubscribeLogs(filters2.LogsSubID(id)), nil
97+
return isDeleted || api.filters.UnsubscribeLogs(rpchelper.LogsSubID(id)), nil
9898
}
9999
}
100100

@@ -112,13 +112,13 @@ func (api *APIImpl) GetFilterChanges(_ context.Context, index string) ([]interfa
112112
if len(index) >= 2 && index[0] == '0' && (index[1] == 'x' || index[1] == 'X') {
113113
index = index[2:]
114114
}
115-
if blocks, ok := api.filters.ReadPendingBlocks(filters2.PendingBlockSubID(index)); ok {
115+
if blocks, ok := api.filters.ReadPendingBlocks(rpchelper.PendingBlockSubID(index)); ok {
116116
for _, v := range blocks {
117117
stub = append(stub, v.Hash())
118118
}
119119
return stub, nil
120120
}
121-
if txs, ok := api.filters.ReadPendingTxs(filters2.PendingTxsSubID(index)); ok {
121+
if txs, ok := api.filters.ReadPendingTxs(rpchelper.PendingTxsSubID(index)); ok {
122122
for _, v := range txs {
123123
for _, tx := range v {
124124
stub = append(stub, tx.Hash())
@@ -130,7 +130,7 @@ func (api *APIImpl) GetFilterChanges(_ context.Context, index string) ([]interfa
130130
if err != nil {
131131
return stub, fmt.Errorf("eth_getFilterChanges, wrong index: %w", err)
132132
}
133-
if logs, ok := api.filters.ReadLogs(filters2.LogsSubID(id)); ok {
133+
if logs, ok := api.filters.ReadLogs(rpchelper.LogsSubID(id)); ok {
134134
for _, v := range logs {
135135
stub = append(stub, v)
136136
}

cmd/rpcdaemon/commands/eth_ming_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"github.com/ledgerwatch/erigon-lib/gointerfaces/txpool"
99
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
1010
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
11-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
1211
"github.com/ledgerwatch/erigon/core/types"
1312
"github.com/ledgerwatch/erigon/rlp"
13+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1414
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
1515
"github.com/ledgerwatch/erigon/turbo/stages"
1616
"github.com/stretchr/testify/require"
@@ -19,7 +19,7 @@ import (
1919
func TestPendingBlock(t *testing.T) {
2020
ctx, conn := rpcdaemontest.CreateTestGrpcConn(t, stages.Mock(t))
2121
mining := txpool.NewMiningClient(conn)
22-
ff := rpcservices.New(ctx, nil, nil, mining, func() {})
22+
ff := rpchelper.New(ctx, nil, nil, mining, func() {})
2323
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
2424
api := NewEthAPI(NewBaseApi(ff, stateCache, snapshotsync.NewBlockReader(), false), nil, nil, nil, mining, 5000000)
2525
expect := uint64(12345)
@@ -44,7 +44,7 @@ func TestPendingBlock(t *testing.T) {
4444
func TestPendingLogs(t *testing.T) {
4545
ctx, conn := rpcdaemontest.CreateTestGrpcConn(t, stages.Mock(t))
4646
mining := txpool.NewMiningClient(conn)
47-
ff := rpcservices.New(ctx, nil, nil, mining, func() {})
47+
ff := rpchelper.New(ctx, nil, nil, mining, func() {})
4848
expect := []byte{211}
4949

5050
ch := make(chan types.Logs, 1)

cmd/rpcdaemon/commands/eth_subscribe_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/ledgerwatch/erigon/core/types"
1313
"github.com/ledgerwatch/erigon/eth/protocols/eth"
1414
"github.com/ledgerwatch/erigon/rlp"
15+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1516
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
1617
"github.com/ledgerwatch/erigon/turbo/stages"
1718
"github.com/stretchr/testify/require"
@@ -38,7 +39,7 @@ func TestEthSubscribe(t *testing.T) {
3839

3940
ctx, conn := rpcdaemontest.CreateTestGrpcConn(t, m)
4041
backend := rpcservices.NewRemoteBackend(remote.NewETHBACKENDClient(conn), m.DB, snapshotsync.NewBlockReader())
41-
ff := rpcservices.New(ctx, backend, nil, nil, func() {})
42+
ff := rpchelper.New(ctx, backend, nil, nil, func() {})
4243

4344
newHeads := make(chan *types.Header)
4445
defer close(newHeads)

cmd/rpcdaemon/commands/net_api.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"fmt"
66
"strconv"
77

8-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices/rpcinterfaces"
98
"github.com/ledgerwatch/erigon/common/hexutil"
9+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1010
)
1111

1212
// NetAPI the interface for the net_ RPC commands
@@ -18,11 +18,11 @@ type NetAPI interface {
1818

1919
// NetAPIImpl data structure to store things needed for net_ commands
2020
type NetAPIImpl struct {
21-
ethBackend rpcinterfaces.ApiBackend
21+
ethBackend rpchelper.ApiBackend
2222
}
2323

2424
// NewNetAPIImpl returns NetAPIImplImpl instance
25-
func NewNetAPIImpl(eth rpcinterfaces.ApiBackend) *NetAPIImpl {
25+
func NewNetAPIImpl(eth rpchelper.ApiBackend) *NetAPIImpl {
2626
return &NetAPIImpl{
2727
ethBackend: eth,
2828
}

cmd/rpcdaemon/commands/send_transaction_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
1313
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands"
1414
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
15-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
1615
"github.com/ledgerwatch/erigon/common"
1716
"github.com/ledgerwatch/erigon/common/u256"
1817
"github.com/ledgerwatch/erigon/core"
1918
"github.com/ledgerwatch/erigon/core/types"
2019
"github.com/ledgerwatch/erigon/eth/protocols/eth"
2120
"github.com/ledgerwatch/erigon/params"
2221
"github.com/ledgerwatch/erigon/rlp"
22+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
2323
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
2424
"github.com/ledgerwatch/erigon/turbo/stages"
2525
"github.com/stretchr/testify/require"
@@ -70,7 +70,7 @@ func TestSendRawTransaction(t *testing.T) {
7070

7171
ctx, conn := rpcdaemontest.CreateTestGrpcConn(t, m)
7272
txPool := txpool.NewTxpoolClient(conn)
73-
ff := rpcservices.New(ctx, nil, txPool, txpool.NewMiningClient(conn), func() {})
73+
ff := rpchelper.New(ctx, nil, txPool, txpool.NewMiningClient(conn), func() {})
7474
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
7575
api := commands.NewEthAPI(commands.NewBaseApi(ff, stateCache, snapshotsync.NewBlockReader(), false), m.DB, nil, txPool, nil, 5000000)
7676

cmd/rpcdaemon/commands/starknet_send_transaction_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"github.com/ledgerwatch/erigon-lib/kv/kvcache"
1111
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands"
1212
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
13-
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcservices"
1413
"github.com/ledgerwatch/erigon/common"
1514
"github.com/ledgerwatch/erigon/common/hexutil"
1615
"github.com/ledgerwatch/erigon/core/types"
16+
"github.com/ledgerwatch/erigon/turbo/rpchelper"
1717
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
1818
"github.com/ledgerwatch/erigon/turbo/stages"
1919
"github.com/stretchr/testify/require"
@@ -33,7 +33,7 @@ func TestErrorStarknetSendRawTransaction(t *testing.T) {
3333
ctx, conn := rpcdaemontest.CreateTestGrpcConn(t, m)
3434
txPool := txpool.NewTxpoolClient(conn)
3535
starknetClient := starknet.NewCAIROVMClient(conn)
36-
ff := rpcservices.New(ctx, nil, txPool, txpool.NewMiningClient(conn), func() {})
36+
ff := rpchelper.New(ctx, nil, txPool, txpool.NewMiningClient(conn), func() {})
3737
stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
3838

3939
for _, tt := range cases {

0 commit comments

Comments
 (0)