eth/catalyst: add catalyst API prototype (#22641)

This change adds the --catalyst flag, enabling an RPC API for eth2 integration.
In this initial version, catalyst mode also disables all peer-to-peer networking.

Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Guillaume Ballet
2021-04-16 21:29:22 +02:00
committed by GitHub
parent 4f3ba6742f
commit f79cce5de9
13 changed files with 823 additions and 12 deletions

View File

@ -315,6 +315,8 @@ func (ethash *Ethash) CalcDifficulty(chain consensus.ChainHeaderReader, time uin
func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int {
next := new(big.Int).Add(parent.Number, big1)
switch {
case config.IsCatalyst(next):
return big.NewInt(1)
case config.IsMuirGlacier(next):
return calcDifficultyEip2384(time, parent)
case config.IsConstantinople(next):