Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed May 27, 2024
1 parent 7236f64 commit 67d4dd5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion mod/engine-primitives/pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ var (
"nil payload status received from execution client",
)

// ErrExecutionClientIsSyncing indicates that the execution client is syncing.
// ErrExecutionClientIsSyncing indicates that the execution client is
// syncing.
ErrExecutionClientIsSyncing = errors.New("execution client is syncing")
)
6 changes: 5 additions & 1 deletion mod/execution/pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ func (s *EngineClient[ExecutionPayloadDenebT]) syncCheck(ctx context.Context) {
ticker := time.NewTicker(s.cfg.SyncCheckInterval)
defer ticker.Stop()
for {
s.logger.Info("starting sync check rountine", "interval", s.cfg.SyncCheckInterval)
s.logger.Info(
"starting sync check rountine",
"interval",
s.cfg.SyncCheckInterval,
)
select {
case <-ticker.C:
syncProgress, err := s.SyncProgress(ctx)
Expand Down
7 changes: 5 additions & 2 deletions mod/execution/pkg/client/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ func (s *EngineClient[ExecutionPayloadDenebT]) ForkchoiceUpdated(
dctx, cancel := context.WithTimeout(ctx, s.cfg.RPCTimeout)
defer cancel()

// If the execution client is syncing, sanitize the payload attributes.
// If the execution client is syncing, sanitize the payload attributes
// as trying to build a block while syncing can be problematic.
if errors.Is(s.status(), engineerrors.ErrExecutionClientIsSyncing) {
s.logger.Warn("execution client is syncing, sanitizing payload attributes")
s.logger.Warn(
"execution client is syncing, sanitizing payload attributes",
)
attrs = nil
}

Expand Down

0 comments on commit 67d4dd5

Please sign in to comment.