mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +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"
|
"crypto/sha256"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -193,7 +194,9 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
|
||||||
version := payloadVersion(c.eth.BlockChain().Config(), timestamp)
|
version := payloadVersion(c.eth.BlockChain().Config(), timestamp)
|
||||||
|
|
||||||
var random [32]byte
|
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{
|
fcResponse, err := c.engineAPI.forkchoiceUpdated(c.curForkchoiceState, &engine.PayloadAttributes{
|
||||||
Timestamp: timestamp,
|
Timestamp: timestamp,
|
||||||
SuggestedFeeRecipient: feeRecipient,
|
SuggestedFeeRecipient: feeRecipient,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue