Skip to content

Commit 911d22f

Browse files
committed
Rework BatchTxPool functionality to a legitimate Ethereum tx mempool
1 parent 1276961 commit 911d22f

4 files changed

Lines changed: 779 additions & 153 deletions

File tree

bootstrap/bootstrap.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ func (b *Bootstrap) StartAPIServer(ctx context.Context) error {
287287
nonceProvider,
288288
)
289289
} else if b.config.TxBatchMode {
290+
nonceProvider := requester.NewLocalNonceProvider(
291+
b.config.FlowNetworkID,
292+
b.storages.Registers,
293+
b.storages.Blocks,
294+
b.collector,
295+
)
290296
txPool, err = requester.NewBatchTxPool(
291297
ctx,
292298
b.client,
@@ -295,6 +301,7 @@ func (b *Bootstrap) StartAPIServer(ctx context.Context) error {
295301
b.config,
296302
b.collector,
297303
b.keystore,
304+
nonceProvider,
298305
)
299306
} else {
300307
txPool, err = requester.NewSingleTxPool(

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require (
77
github.com/ethereum/go-ethereum v1.17.4
88
github.com/goccy/go-json v0.10.4
99
github.com/hashicorp/go-multierror v1.1.1
10-
github.com/hashicorp/golang-lru/v2 v2.0.7
1110
github.com/holiman/uint256 v1.3.2
1211
github.com/onflow/atree v0.16.1
1312
github.com/onflow/cadence v1.10.5
@@ -98,6 +97,7 @@ require (
9897
github.com/gorilla/websocket v1.5.3 // indirect
9998
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
10099
github.com/hashicorp/errwrap v1.1.0 // indirect
100+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
101101
github.com/hashicorp/hcl v1.0.0 // indirect
102102
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
103103
github.com/huandu/go-clone v1.6.0 // indirect

0 commit comments

Comments
 (0)