mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fix beacon root and payload version
This commit is contained in:
parent
b3c9b7eaa9
commit
4cc0f14c90
1 changed files with 15 additions and 7 deletions
|
|
@ -161,14 +161,22 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
|
||||||
c.setCurrentState(header.Hash(), *finalizedHash)
|
c.setCurrentState(header.Hash(), *finalizedHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
var random [32]byte
|
var (
|
||||||
|
random [32]byte
|
||||||
|
payloadVersion = engine.PayloadV2
|
||||||
|
attrs = &engine.PayloadAttributes{
|
||||||
|
Timestamp: timestamp,
|
||||||
|
SuggestedFeeRecipient: feeRecipient,
|
||||||
|
Withdrawals: withdrawals,
|
||||||
|
Random: random,
|
||||||
|
}
|
||||||
|
)
|
||||||
rand.Read(random[:])
|
rand.Read(random[:])
|
||||||
fcResponse, err := c.engineAPI.forkchoiceUpdated(c.curForkchoiceState, &engine.PayloadAttributes{
|
if isCancun {
|
||||||
Timestamp: timestamp,
|
payloadVersion = engine.PayloadV3
|
||||||
SuggestedFeeRecipient: feeRecipient,
|
attrs.BeaconRoot = &common.Hash{}
|
||||||
Withdrawals: withdrawals,
|
}
|
||||||
Random: random,
|
fcResponse, err := c.engineAPI.forkchoiceUpdated(c.curForkchoiceState, attrs, payloadVersion, true)
|
||||||
}, engine.PayloadV2, true)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue