mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 07:53:47 +00:00
eth/catalyst: use IsAmsterdam when sealing simulated beacon blocks (#35392)
This commit is contained in:
parent
c6c7ffbbaf
commit
b14428613b
1 changed files with 4 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
"math/big"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -178,9 +179,10 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
|
||||||
c.feeRecipientLock.Lock()
|
c.feeRecipientLock.Lock()
|
||||||
feeRecipient := c.feeRecipient
|
feeRecipient := c.feeRecipient
|
||||||
c.feeRecipientLock.Unlock()
|
c.feeRecipientLock.Unlock()
|
||||||
|
header := c.eth.BlockChain().CurrentBlock()
|
||||||
|
|
||||||
// Reset to CurrentBlock in case of the chain was rewound
|
// Reset to CurrentBlock in case of the chain was rewound
|
||||||
if header := c.eth.BlockChain().CurrentBlock(); c.curForkchoiceState.HeadBlockHash != header.Hash() {
|
if c.curForkchoiceState.HeadBlockHash != header.Hash() {
|
||||||
finalizedHash := c.finalizedBlockHash(header.Number.Uint64())
|
finalizedHash := c.finalizedBlockHash(header.Number.Uint64())
|
||||||
c.setCurrentState(header.Hash(), *finalizedHash)
|
c.setCurrentState(header.Hash(), *finalizedHash)
|
||||||
}
|
}
|
||||||
|
|
@ -208,7 +210,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
|
||||||
Random: random,
|
Random: random,
|
||||||
BeaconRoot: &common.Hash{},
|
BeaconRoot: &common.Hash{},
|
||||||
}
|
}
|
||||||
if c.eth.BlockChain().Config().LatestFork(timestamp) == forks.Amsterdam {
|
if c.eth.BlockChain().Config().IsAmsterdam(new(big.Int).Add(header.Number, big.NewInt(1)), timestamp) {
|
||||||
slotNumber := uint64(0)
|
slotNumber := uint64(0)
|
||||||
attribute.SlotNumber = &slotNumber
|
attribute.SlotNumber = &slotNumber
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue