okx / xlayer-erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
19 stars 6 forks source link

Sequencer generated empty block even though pending cache has lots of txs #52

Closed louisliu2048 closed 1 month ago

louisliu2048 commented 3 months ago

System information

Erigon version: ./erigon --version

OS & Version: Windows/Linux/OSX

Commit hash:

Erigon Command (with flags/config):

Concensus Layer:

Concensus Layer Command (with flags/config):

Chain/Network:

Expected behaviour

Actual behaviour

Steps to reproduce the behaviour

Backtrace

[INFO] [07-04|09:20:41.049] [4/12 Execution] Finish block 350 with 0 transactions... 
[INFO] [07-04|09:20:41.049] [4/12 Execution] Starting block 351... 
[INFO] [07-04|09:20:41.049] [4/12 Execution] Waiting for txs from the pool... 
[INFO] [07-04|09:20:42.581] [p2p] GoodPeers 
[INFO] [07-04|09:20:42.667] [txpool] stat                            pending=200000 baseFee=0 queued=6463 alloc=902.9MB sys=1.2GB
louisliu2048 commented 3 months ago

When sequencer rpc has too many connection, it will exhausting connection handles of MdbxKV database, so we cannot get txs from pending pool, and generated empty block.

195 @ 0x460b80 0x47165c 0xe48314 0xe4aed8 0x1133c74 0x1104c10 0x165a7dc 0x4c72e8 0x4c68c0 0x85ff20 0x85920c 0x8588a0 0x8577fc 0x856574 0x856efc 0x494104
#   0xe48313    golang.org/x/sync/semaphore.(*Weighted).Acquire+0x443                       golang.org/x/sync@v0.7.0/semaphore/semaphore.go:74
#   0xe4aed7    github.com/gateway-fm/cdk-erigon-lib/kv/mdbx.(*MdbxKV).BeginRo+0x87             github.com/gateway-fm/cdk-erigon-lib@v0.0.0-20240415152010-66aa405ca33f/kv/mdbx/kv_mdbx.go:492
#   0x1133c73   github.com/ledgerwatch/erigon/zk/txpool.(*GrpcServer).Add+0x53                  github.com/ledgerwatch/erigon/zk/txpool/txpool_grpc_server.go:176
#   0x1104c0f   github.com/gateway-fm/cdk-erigon-lib/direct.(*TxPoolClient).Add+0x2f                github.com/gateway-fm/cdk-erigon-lib@v0.0.0-20240415152010-66aa405ca33f/direct/txpool_client.go:48
#   0x165a7db   github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands.(*APIImpl).SendRawTransaction+0x4eb    github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands/send_transaction.go:60
#   0x4c72e7    reflect.Value.call+0x837                                    reflect/value.go:586
#   0x4c68bf    reflect.Value.Call+0x8f                                     reflect/value.go:370
#   0x85ff1f    github.com/ledgerwatch/erigon/rpc.(*callback).call+0x4af                    github.com/ledgerwatch/erigon/rpc/service.go:222
#   0x85920b    github.com/ledgerwatch/erigon/rpc.(*handler).runMethod+0x1db                    github.com/ledgerwatch/erigon/rpc/handler.go:494
#   0x85889f    github.com/ledgerwatch/erigon/rpc.(*handler).handleCall+0x26f                   github.com/ledgerwatch/erigon/rpc/handler.go:444
#   0x8577fb    github.com/ledgerwatch/erigon/rpc.(*handler).handleCallMsg+0x8b                 github.com/ledgerwatch/erigon/rpc/handler.go:392
#   0x856573    github.com/ledgerwatch/erigon/rpc.(*handler).handleMsg.func1+0x143              github.com/ledgerwatch/erigon/rpc/handler.go:223
#   0x856efb    github.com/ledgerwatch/erigon/rpc.(*handler).startCallProc.func1+0xbb               github.com/ledgerwatch/erigon/rpc/handler.go:316

1 @ 0x460b80 0x47165c 0xe48314 0xe4aed8 0xe4be74 0x111e258 0x111bf60 0x494104
#   0xe48313    golang.org/x/sync/semaphore.(*Weighted).Acquire+0x443               golang.org/x/sync@v0.7.0/semaphore/semaphore.go:74
#   0xe4aed7    github.com/gateway-fm/cdk-erigon-lib/kv/mdbx.(*MdbxKV).BeginRo+0x87     github.com/gateway-fm/cdk-erigon-lib@v0.0.0-20240415152010-66aa405ca33f/kv/mdbx/kv_mdbx.go:492
#   0xe4be73    github.com/gateway-fm/cdk-erigon-lib/kv/mdbx.(*MdbxKV).View+0x33        github.com/gateway-fm/cdk-erigon-lib@v0.0.0-20240415152010-66aa405ca33f/kv/mdbx/kv_mdbx.go:658
#   0x111e257   github.com/ledgerwatch/erigon/zk/txpool.(*Fetch).handleStateChanges+0x287   github.com/ledgerwatch/erigon/zk/txpool/fetch.go:493
#   0x111bf5f   github.com/ledgerwatch/erigon/zk/txpool.(*Fetch).ConnectCore.func1+0x5f     github.com/ledgerwatch/erigon/zk/txpool/fetch.go:116

1 @ 0x460b80 0x47165c 0xe48314 0xe4aed8 0xe4be74 0x16082d4 0x16049a8 0x16105b0 0x125f55c 0x125e65c 0x1ce1348 0x1ce0c98 0x494104
#   0xe48313    golang.org/x/sync/semaphore.(*Weighted).Acquire+0x443           golang.org/x/sync@v0.7.0/semaphore/semaphore.go:74
#   0xe4aed7    github.com/gateway-fm/cdk-erigon-lib/kv/mdbx.(*MdbxKV).BeginRo+0x87 github.com/gateway-fm/cdk-erigon-lib@v0.0.0-20240415152010-66aa405ca33f/kv/mdbx/kv_mdbx.go:492
#   0xe4be73    github.com/gateway-fm/cdk-erigon-lib/kv/mdbx.(*MdbxKV).View+0x33    github.com/gateway-fm/cdk-erigon-lib@v0.0.0-20240415152010-66aa405ca33f/kv/mdbx/kv_mdbx.go:658
#   0x16082d3   github.com/ledgerwatch/erigon/zk/stages.getNextPoolTransactions+0x1d3   github.com/ledgerwatch/erigon/zk/stages/stage_sequence_execute_transactions.go:40
#   0x16049a7   github.com/ledgerwatch/erigon/zk/stages.SpawnSequencingStage+0x2167 github.com/ledgerwatch/erigon/zk/stages/stage_sequence_execute.go:269
#   0x16105af   github.com/ledgerwatch/erigon/zk/stages.SequencerZkStages.func10+0x8f   github.com/ledgerwatch/erigon/zk/stages/stages.go:91
#   0x125f55b   github.com/ledgerwatch/erigon/eth/stagedsync.(*Sync).runStage+0xeb  github.com/ledgerwatch/erigon/eth/stagedsync/sync.go:358
#   0x125e65b   github.com/ledgerwatch/erigon/eth/stagedsync.(*Sync).Run+0x20b      github.com/ledgerwatch/erigon/eth/stagedsync/sync.go:260
#   0x1ce1347   github.com/ledgerwatch/erigon/turbo/stages.StageLoopStep+0x317      github.com/ledgerwatch/erigon/turbo/stages/stageloop.go:169
#   0x1ce0c97   github.com/ledgerwatch/erigon/turbo/stages.StageLoop+0xd7       github.com/ledgerwatch/erigon/turbo/stages/stageloop.go:95
github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 7 days with no activity.