mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-29 16:13:47 +00:00
* feat(beacon): introduce soft blocks * feat: update api.go * chore(ci): update CI * feat: update L1Origin * feat: update `verifyHeader` * test: update tests * feat: update consensus * feat: update consensus * feat: update genesis * feat: remove timestamp check in prepareWork * feat: merge changes in #281 * Update eth/catalyst/api.go Co-authored-by: maskpp <maskpp266@gmail.com> * Update internal/ethapi/taiko_preconf.go Co-authored-by: maskpp <maskpp266@gmail.com> * fix consensus test * revert commit f1df58 * fix consensus test (#349) * Update eth/catalyst/api.go Co-authored-by: maskpp <maskpp266@gmail.com> * feat: add back timestamp check in worker * add genesis * temp fix for old l1origin * nil value * feat: rename to `L1OriginLegacy` * feat: change `common.Big0` as the default value for legacy l1Origin, to make `IsSoftblock` return `false` * feat(beacon): change the reorg log level (#350) * use debug log level to avoid logging too many logs when frequently soft block reorg. * use debug log level to avoid logging too many logs when frequently soft block reorg. * feat: check --taiko flag --------- Co-authored-by: David <david@taiko.xyz> * add rlp optional flag (#353) * fix lint * fix test case * feat(l1Origin): remove the reverted l1Origins (#355) * remove the reverted l1Origins * feat: add more comments --------- Co-authored-by: David <david@taiko.xyz> * only forward txs * chore: update ci --------- Co-authored-by: maskpp <maskpp266@gmail.com> Co-authored-by: Jeffery Walsh <cyberhorsey@gmail.com>
82 lines
2.9 KiB
Go
82 lines
2.9 KiB
Go
package core
|
|
|
|
import (
|
|
"math/big"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
taikoGenesis "github.com/ethereum/go-ethereum/core/taiko_genesis"
|
|
"github.com/ethereum/go-ethereum/log"
|
|
"github.com/ethereum/go-ethereum/params"
|
|
)
|
|
|
|
var (
|
|
InternalDevnetOntakeBlock = common.Big0
|
|
PreconfDevnetOntakeBlock = common.Big0
|
|
HeklaOntakeBlock = new(big.Int).SetUint64(840_512)
|
|
MainnetOntakeBlock = new(big.Int).SetUint64(538_304)
|
|
)
|
|
|
|
// TaikoGenesisBlock returns the Taiko network genesis block configs.
|
|
func TaikoGenesisBlock(networkID uint64) *Genesis {
|
|
chainConfig := params.TaikoChainConfig
|
|
|
|
var allocJSON []byte
|
|
switch networkID {
|
|
case params.TaikoMainnetNetworkID.Uint64():
|
|
chainConfig.ChainID = params.TaikoMainnetNetworkID
|
|
chainConfig.OntakeBlock = MainnetOntakeBlock
|
|
allocJSON = taikoGenesis.MainnetGenesisAllocJSON
|
|
case params.TaikoInternalL2ANetworkID.Uint64():
|
|
chainConfig.ChainID = params.TaikoInternalL2ANetworkID
|
|
chainConfig.OntakeBlock = InternalDevnetOntakeBlock
|
|
allocJSON = taikoGenesis.InternalL2AGenesisAllocJSON
|
|
case params.TaikoInternalL2BNetworkID.Uint64():
|
|
chainConfig.ChainID = params.TaikoInternalL2BNetworkID
|
|
allocJSON = taikoGenesis.InternalL2BGenesisAllocJSON
|
|
case params.SnaefellsjokullNetworkID.Uint64():
|
|
chainConfig.ChainID = params.SnaefellsjokullNetworkID
|
|
allocJSON = taikoGenesis.SnaefellsjokullGenesisAllocJSON
|
|
case params.AskjaNetworkID.Uint64():
|
|
chainConfig.ChainID = params.AskjaNetworkID
|
|
allocJSON = taikoGenesis.AskjaGenesisAllocJSON
|
|
case params.GrimsvotnNetworkID.Uint64():
|
|
chainConfig.ChainID = params.GrimsvotnNetworkID
|
|
allocJSON = taikoGenesis.GrimsvotnGenesisAllocJSON
|
|
case params.EldfellNetworkID.Uint64():
|
|
chainConfig.ChainID = params.EldfellNetworkID
|
|
allocJSON = taikoGenesis.EldfellGenesisAllocJSON
|
|
case params.JolnirNetworkID.Uint64():
|
|
chainConfig.ChainID = params.JolnirNetworkID
|
|
allocJSON = taikoGenesis.JolnirGenesisAllocJSON
|
|
case params.KatlaNetworkID.Uint64():
|
|
chainConfig.ChainID = params.KatlaNetworkID
|
|
allocJSON = taikoGenesis.KatlaGenesisAllocJSON
|
|
case params.HeklaNetworkID.Uint64():
|
|
chainConfig.ChainID = params.HeklaNetworkID
|
|
chainConfig.OntakeBlock = HeklaOntakeBlock
|
|
allocJSON = taikoGenesis.HeklaGenesisAllocJSON
|
|
case params.PreconfDevnetNetworkID.Uint64():
|
|
chainConfig.ChainID = params.PreconfDevnetNetworkID
|
|
chainConfig.OntakeBlock = PreconfDevnetOntakeBlock
|
|
allocJSON = taikoGenesis.PreconfDevnetGenesisAllocJSON
|
|
default:
|
|
chainConfig.ChainID = params.TaikoInternalL2ANetworkID
|
|
chainConfig.OntakeBlock = InternalDevnetOntakeBlock
|
|
allocJSON = taikoGenesis.InternalL2AGenesisAllocJSON
|
|
}
|
|
|
|
var alloc GenesisAlloc
|
|
if err := alloc.UnmarshalJSON(allocJSON); err != nil {
|
|
log.Crit("unmarshal alloc json error", "error", err)
|
|
}
|
|
|
|
return &Genesis{
|
|
Config: chainConfig,
|
|
ExtraData: []byte{},
|
|
GasLimit: uint64(15_000_000),
|
|
Difficulty: common.Big0,
|
|
Alloc: alloc,
|
|
GasUsed: 0,
|
|
BaseFee: new(big.Int).SetUint64(10_000_000),
|
|
}
|
|
}
|