mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth/catalyst: disable heartbeat for simulated beacon node
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
4c7053baf1
commit
af54fd5495
2 changed files with 18 additions and 1 deletions
|
|
@ -151,6 +151,23 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI {
|
|||
return api
|
||||
}
|
||||
|
||||
// newConsensusAPIWithoutHeartbeat creates a new consensus api for the SimulatedBeacon Node.
|
||||
func newConsensusAPIWithoutHeartbeat(eth *eth.Ethereum) *ConsensusAPI {
|
||||
if eth.BlockChain().Config().TerminalTotalDifficulty == nil {
|
||||
log.Warn("Engine API started but chain not configured for merge yet")
|
||||
}
|
||||
api := &ConsensusAPI{
|
||||
eth: eth,
|
||||
remoteBlocks: newHeaderQueue(),
|
||||
localBlocks: newPayloadQueue(),
|
||||
invalidBlocksHits: make(map[common.Hash]int),
|
||||
invalidTipsets: make(map[common.Hash]*types.Header),
|
||||
}
|
||||
eth.Downloader().SetBadBlockCallback(api.setInvalidAncestor)
|
||||
|
||||
return api
|
||||
}
|
||||
|
||||
// ForkchoiceUpdatedV1 has several responsibilities:
|
||||
//
|
||||
// We try to set our blockchain to the headBlock.
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ func NewSimulatedBeacon(period uint64, eth *eth.Ethereum) (*SimulatedBeacon, err
|
|||
SafeBlockHash: block.Hash(),
|
||||
FinalizedBlockHash: block.Hash(),
|
||||
}
|
||||
engineAPI := NewConsensusAPI(eth)
|
||||
engineAPI := newConsensusAPIWithoutHeartbeat(eth)
|
||||
|
||||
// if genesis block, send forkchoiceUpdated to trigger transition to PoS
|
||||
if block.Number.Sign() == 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue