Skip to content

Commit c2044b4

Browse files
committed
log when EthereumExecutionModule semaphore is busy
1 parent 498ebcb commit c2044b4

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

turbo/execution/eth1/block_building.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func (e *EthereumExecutionModule) evictOldBuilders() {
4242
// Missing: NewPayload, AssembleBlock
4343
func (e *EthereumExecutionModule) AssembleBlock(ctx context.Context, req *execution.AssembleBlockRequest) (*execution.AssembleBlockResponse, error) {
4444
if !e.semaphore.TryAcquire(1) {
45+
e.logger.Warn("ethereumExecutionModule.AssembleBlock: ExecutionStatus_Busy")
4546
return &execution.AssembleBlockResponse{
4647
Id: 0,
4748
Busy: true,
@@ -108,6 +109,7 @@ func blockValue(br *types.BlockWithReceipts, baseFee *uint256.Int) *uint256.Int
108109

109110
func (e *EthereumExecutionModule) GetAssembledBlock(ctx context.Context, req *execution.GetAssembledBlockRequest) (*execution.GetAssembledBlockResponse, error) {
110111
if !e.semaphore.TryAcquire(1) {
112+
e.logger.Warn("ethereumExecutionModule.GetAssembledBlock: ExecutionStatus_Busy")
111113
return &execution.GetAssembledBlockResponse{
112114
Busy: true,
113115
}, nil

turbo/execution/eth1/ethereum_execution.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ import (
55
"errors"
66
"math/big"
77

8+
"github.com/ledgerwatch/log/v3"
9+
"golang.org/x/sync/semaphore"
10+
"google.golang.org/protobuf/types/known/emptypb"
11+
812
"github.com/ledgerwatch/erigon-lib/chain"
913
libcommon "github.com/ledgerwatch/erigon-lib/common"
1014
"github.com/ledgerwatch/erigon-lib/gointerfaces"
1115
"github.com/ledgerwatch/erigon-lib/gointerfaces/execution"
1216
"github.com/ledgerwatch/erigon-lib/kv/dbutils"
1317
"github.com/ledgerwatch/erigon-lib/wrap"
14-
"github.com/ledgerwatch/log/v3"
15-
"golang.org/x/sync/semaphore"
16-
"google.golang.org/protobuf/types/known/emptypb"
1718

1819
"github.com/ledgerwatch/erigon-lib/kv"
1920
"github.com/ledgerwatch/erigon/common/math"
@@ -150,6 +151,7 @@ func (e *EthereumExecutionModule) canonicalHash(ctx context.Context, tx kv.Tx, b
150151

151152
func (e *EthereumExecutionModule) ValidateChain(ctx context.Context, req *execution.ValidationRequest) (*execution.ValidationReceipt, error) {
152153
if !e.semaphore.TryAcquire(1) {
154+
e.logger.Warn("ethereumExecutionModule.ValidateChain: ExecutionStatus_Busy")
153155
return &execution.ValidationReceipt{
154156
LatestValidHash: gointerfaces.ConvertHashToH256(libcommon.Hash{}),
155157
ValidationStatus: execution.ExecutionStatus_Busy,
@@ -267,6 +269,7 @@ func (e *EthereumExecutionModule) Start(ctx context.Context) {
267269

268270
func (e *EthereumExecutionModule) Ready(context.Context, *emptypb.Empty) (*execution.ReadyResponse, error) {
269271
if !e.semaphore.TryAcquire(1) {
272+
e.logger.Warn("ethereumExecutionModule.Ready: ExecutionStatus_Busy")
270273
return &execution.ReadyResponse{Ready: false}, nil
271274
}
272275
defer e.semaphore.Release(1)

turbo/execution/eth1/forkchoice.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func writeForkChoiceHashes(tx kv.RwTx, blockHash, safeHash, finalizedHash libcom
103103

104104
func (e *EthereumExecutionModule) updateForkChoice(ctx context.Context, blockHash, safeHash, finalizedHash libcommon.Hash, outcomeCh chan forkchoiceOutcome) {
105105
if !e.semaphore.TryAcquire(1) {
106+
e.logger.Warn("ethereumExecutionModule.updateForkChoice: ExecutionStatus_Busy")
106107
sendForkchoiceReceiptWithoutWaiting(outcomeCh, &execution.ForkChoiceReceipt{
107108
LatestValidHash: gointerfaces.ConvertHashToH256(libcommon.Hash{}),
108109
Status: execution.ExecutionStatus_Busy,

turbo/execution/eth1/inserters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func (s *EthereumExecutionModule) validatePayloadBlobs(expectedBlobHashes []libc
3535

3636
func (e *EthereumExecutionModule) InsertBlocks(ctx context.Context, req *execution.InsertBlocksRequest) (*execution.InsertionResult, error) {
3737
if !e.semaphore.TryAcquire(1) {
38+
e.logger.Warn("ethereumExecutionModule.InsertBlocks: ExecutionStatus_Busy")
3839
return &execution.InsertionResult{
3940
Result: execution.ExecutionStatus_Busy,
4041
}, nil

0 commit comments

Comments
 (0)