mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "eth/catalyst: set finalized block hash properly in dev mode (#27886)"
This reverts commit 9070fc89a9.
This commit is contained in:
parent
32a2afbb9c
commit
8ee11d5657
1 changed files with 1 additions and 10 deletions
|
|
@ -32,8 +32,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
const devEpochLength = 32
|
|
||||||
|
|
||||||
// withdrawalQueue implements a FIFO queue which holds withdrawals that are
|
// withdrawalQueue implements a FIFO queue which holds withdrawals that are
|
||||||
// pending inclusion.
|
// pending inclusion.
|
||||||
type withdrawalQueue struct {
|
type withdrawalQueue struct {
|
||||||
|
|
@ -159,13 +157,6 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
|
||||||
}
|
}
|
||||||
payload := envelope.ExecutionPayload
|
payload := envelope.ExecutionPayload
|
||||||
|
|
||||||
var finalizedHash common.Hash
|
|
||||||
if payload.Number%devEpochLength == 0 {
|
|
||||||
finalizedHash = payload.BlockHash
|
|
||||||
} else {
|
|
||||||
finalizedHash = c.eth.BlockChain().GetBlockByNumber((payload.Number - 1) / devEpochLength * devEpochLength).Hash()
|
|
||||||
}
|
|
||||||
|
|
||||||
// mark the payload as canon
|
// mark the payload as canon
|
||||||
if _, err = c.engineAPI.NewPayloadV2(*payload); err != nil {
|
if _, err = c.engineAPI.NewPayloadV2(*payload); err != nil {
|
||||||
return fmt.Errorf("failed to mark payload as canonical: %v", err)
|
return fmt.Errorf("failed to mark payload as canonical: %v", err)
|
||||||
|
|
@ -173,7 +164,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
|
||||||
c.curForkchoiceState = engine.ForkchoiceStateV1{
|
c.curForkchoiceState = engine.ForkchoiceStateV1{
|
||||||
HeadBlockHash: payload.BlockHash,
|
HeadBlockHash: payload.BlockHash,
|
||||||
SafeBlockHash: payload.BlockHash,
|
SafeBlockHash: payload.BlockHash,
|
||||||
FinalizedBlockHash: finalizedHash,
|
FinalizedBlockHash: payload.BlockHash,
|
||||||
}
|
}
|
||||||
// mark the block containing the payload as canonical
|
// mark the block containing the payload as canonical
|
||||||
if _, err = c.engineAPI.ForkchoiceUpdatedV2(c.curForkchoiceState, nil); err != nil {
|
if _, err = c.engineAPI.ForkchoiceUpdatedV2(c.curForkchoiceState, nil); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue