mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
eth/catalyst: handle crypto/rand error when generating prevRandao
This commit is contained in:
parent
488d987fc4
commit
dd37b9066f
1 changed files with 4 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"crypto/sha256"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"sync"
|
||||
"time"
|
||||
|
|
@ -193,7 +194,9 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
|
|||
version := payloadVersion(c.eth.BlockChain().Config(), timestamp)
|
||||
|
||||
var random [32]byte
|
||||
rand.Read(random[:])
|
||||
if _, err := io.ReadFull(rand.Reader, random[:]); err != nil {
|
||||
return fmt.Errorf("failed to read randomness: %w", err)
|
||||
}
|
||||
fcResponse, err := c.engineAPI.forkchoiceUpdated(c.curForkchoiceState, &engine.PayloadAttributes{
|
||||
Timestamp: timestamp,
|
||||
SuggestedFeeRecipient: feeRecipient,
|
||||
|
|
|
|||
Loading…
Reference in a new issue