fix random attr

This commit is contained in:
Sina Mahmoodi 2024-02-29 12:32:10 +01:00
parent 0c58f4a559
commit 0b4adbc4a6

View file

@ -161,8 +161,9 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
c.setCurrentState(header.Hash(), *finalizedHash) c.setCurrentState(header.Hash(), *finalizedHash)
} }
var random [32]byte
rand.Read(random[:])
var ( var (
random [32]byte
payloadVersion = engine.PayloadV2 payloadVersion = engine.PayloadV2
attrs = &engine.PayloadAttributes{ attrs = &engine.PayloadAttributes{
Timestamp: timestamp, Timestamp: timestamp,
@ -171,7 +172,6 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
Random: random, Random: random,
} }
) )
rand.Read(random[:])
if isCancun { if isCancun {
payloadVersion = engine.PayloadV3 payloadVersion = engine.PayloadV3
attrs.BeaconRoot = &common.Hash{} attrs.BeaconRoot = &common.Hash{}