diff --git a/cl/blockbuilder/blockbuilder.go b/cl/blockbuilder/blockbuilder.go index 78378287a..fdce4bf49 100644 --- a/cl/blockbuilder/blockbuilder.go +++ b/cl/blockbuilder/blockbuilder.go @@ -134,8 +134,6 @@ func (bb *BlockBuilder) GetPayload(ctx context.Context) error { if err != nil { return fmt.Errorf("failed to set execution head from rpc: %w", err) } - } else { - bb.logger.Debug("executionHead is not nil, using cached value") } mempoolStatus, err := bb.GetMempoolStatus(ctx) @@ -144,17 +142,10 @@ func (bb *BlockBuilder) GetPayload(ctx context.Context) error { } lastBlockTime := time.UnixMilli(int64(bb.executionHead.BlockTime)) - bb.logger.Debug("lastBlockTime from execution head", "lastBlockTime", lastBlockTime) if mempoolStatus.Pending == 0 { timeSinceLastBlock := time.Since(lastBlockTime) if timeSinceLastBlock < bb.buildEmptyBlocksDelay { - bb.logger.Debug( - "Leader: Skipping empty block", - "timeSinceLastBlock", timeSinceLastBlock, - "pendingTxes", mempoolStatus.Pending, - "queuedTxes", mempoolStatus.Queued, - ) return ErrEmptyBlock } bb.logger.Info( diff --git a/cl/singlenode/payloadstore/postgres.go b/cl/singlenode/payloadstore/postgres.go index c0389cf3d..50b50b7ed 100644 --- a/cl/singlenode/payloadstore/postgres.go +++ b/cl/singlenode/payloadstore/postgres.go @@ -45,7 +45,7 @@ func NewPostgresRepository(ctx context.Context, dsn string, logger *slog.Logger) schemaCreationQuery := ` CREATE TABLE IF NOT EXISTS execution_payloads ( id SERIAL PRIMARY KEY, - payload_id VARCHAR(66) UNIQUE NOT NULL, -- e.g., 0x... (32 bytes hex + 0x prefix) + payload_id VARCHAR(66) NOT NULL, -- e.g., 0x... (32 bytes hex + 0x prefix) raw_execution_payload TEXT NOT NULL, block_height BIGINT NOT NULL, inserted_at TIMESTAMPTZ DEFAULT NOW(), @@ -76,8 +76,11 @@ func (r *PostgresRepository) SavePayload(ctx context.Context, info *types.Payloa query := ` INSERT INTO execution_payloads (payload_id, raw_execution_payload, block_height) VALUES ($1, $2, $3) - ON CONFLICT (payload_id) DO NOTHING; - ` // ON CONFLICT DO NOTHING will silently ignore duplicates by payload_id + ON CONFLICT (block_height) DO UPDATE + SET payload_id = EXCLUDED.payload_id, + raw_execution_payload = EXCLUDED.raw_execution_payload, + inserted_at = NOW(); + ` insertCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() diff --git a/cl/singlenode/singlenode.go b/cl/singlenode/singlenode.go index 72252e774..5dc5c1380 100644 --- a/cl/singlenode/singlenode.go +++ b/cl/singlenode/singlenode.go @@ -286,7 +286,6 @@ func (app *SingleNodeApp) runLoop() { if err != nil { if errors.Is(err, blockbuilder.ErrEmptyBlock) { - app.logger.Debug("no pending transactions, will try again after timeout", "timeout", app.cfg.TxPoolPollingInterval) time.Sleep(app.cfg.TxPoolPollingInterval) continue } else if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {