Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-nr committed Oct 29, 2024
1 parent 87c4614 commit 38d7a87
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
18 changes: 0 additions & 18 deletions eth/catalyst/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/ethereum/go-ethereum/beacon/engine"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/miner"
)

Expand Down Expand Up @@ -93,23 +92,6 @@ func (q *payloadQueue) get(id engine.PayloadID, full bool) *engine.ExecutionPayl
return nil
}

// getWithoutStatus retrieves a previously stored payload item or nil if it does not exist.
func (q *payloadQueue) getWithoutStatus(id engine.PayloadID) *miner.Payload {
q.lock.RLock()
defer q.lock.RUnlock()

for _, item := range q.payloads {
if item == nil {
log.Info("getting payload not found", "id", id)
return nil // no more items
}
if item.id == id {
return item.payload
}
}
return nil
}

// waitFull waits until the first full payload has been built for the specified payload id
// The method returns immediately if the payload is unknown.
func (q *payloadQueue) waitFull(id engine.PayloadID) error {
Expand Down
49 changes: 0 additions & 49 deletions miner/payload_building.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"crypto/sha256"
"encoding/binary"
"errors"
"fmt"
"math/big"
"strings"
"sync"
Expand Down Expand Up @@ -452,54 +451,6 @@ func (w *worker) buildPayload(args *BuildPayloadArgs) (*Payload, error) {
return payload, nil
}

// retryPayloadUpdate retries the payload update process after a fix operation.
//
// This function reconstructs the block using the provided BuildPayloadArgs and
// attempts to update the payload in the system. It performs validation of the
// block parameters and updates the payload if the block is successfully built.
func (w *worker) retryPayloadUpdate(args *BuildPayloadArgs, payload *Payload) error {
fullParams := &generateParams{
timestamp: args.Timestamp,
forceTime: true,
parentHash: args.Parent,
coinbase: args.FeeRecipient,
random: args.Random,
withdrawals: args.Withdrawals,
beaconRoot: args.BeaconRoot,
noTxs: false,
txs: args.Transactions,
gasLimit: args.GasLimit,
}

// Since we skip building the empty block when using the tx pool, we need to explicitly
// validate the BuildPayloadArgs here.
_, err := w.validateParams(fullParams)
if err != nil {
log.Error("Failed to validate payload parameters", "id", payload.id, "err", err)
return fmt.Errorf("failed to validate payload parameters: %w", err)
}

// set shared interrupt
fullParams.interrupt = payload.interrupt

r := w.getSealingBlock(fullParams)
if r.err != nil {
log.Error("Failed to build full payload after fix", "id", payload.id, "err", r.err)
return fmt.Errorf("failed to build full payload after fix: %w", r.err)
}

payload.update(r, 0, func() {
w.cacheMiningBlock(r.block, r.env)
})

if r.err == nil {
fullParams.isUpdate = true
}

log.Info("Successfully updated payload after fix", "id", payload.id)
return nil
}

func (w *worker) cacheMiningBlock(block *types.Block, env *environment) {
var (
start = time.Now()
Expand Down

0 comments on commit 38d7a87

Please sign in to comment.