mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
fix startup
This commit is contained in:
parent
1b8ae03034
commit
8b8b66352a
6 changed files with 34 additions and 9 deletions
|
|
@ -419,6 +419,11 @@ func importHistory(ctx *cli.Context) error {
|
||||||
network = "mainnet"
|
network = "mainnet"
|
||||||
case ctx.Bool(utils.SepoliaFlag.Name):
|
case ctx.Bool(utils.SepoliaFlag.Name):
|
||||||
network = "sepolia"
|
network = "sepolia"
|
||||||
|
// SYSCOIN
|
||||||
|
case ctx.Bool(utils.SyscoinFlag.Name):
|
||||||
|
network = "syscoin"
|
||||||
|
case ctx.Bool(utils.TanenbaumFlag.Name):
|
||||||
|
network = "tanenbaum"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No network flag set, try to determine network based on files
|
// No network flag set, try to determine network based on files
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,8 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
blsyncer := blsync.NewClient(ctx)
|
blsyncer := blsync.NewClient(ctx)
|
||||||
blsyncer.SetEngineRPC(rpc.DialInProc(srv))
|
blsyncer.SetEngineRPC(rpc.DialInProc(srv))
|
||||||
stack.RegisterLifecycle(blsyncer)
|
stack.RegisterLifecycle(blsyncer)
|
||||||
} else {
|
// SYSCOIN
|
||||||
|
} else if eth.BlockChain().GetChainConfig().SyscoinBlock == nil {
|
||||||
// Launch the engine API for interacting with external consensus client.
|
// Launch the engine API for interacting with external consensus client.
|
||||||
err := catalyst.Register(stack, eth)
|
err := catalyst.Register(stack, eth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,7 @@ var (
|
||||||
}
|
}
|
||||||
MainnetFlag = &cli.BoolFlag{
|
MainnetFlag = &cli.BoolFlag{
|
||||||
Name: "mainnet",
|
Name: "mainnet",
|
||||||
// SYSCOIN
|
Usage: "Ethereum mainnet",
|
||||||
Usage: "Syscoin mainnet",
|
|
||||||
Category: flags.EthCategory,
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
// SYSCOIN
|
// SYSCOIN
|
||||||
|
|
@ -152,10 +151,12 @@ var (
|
||||||
TanenbaumFlag = &cli.BoolFlag{
|
TanenbaumFlag = &cli.BoolFlag{
|
||||||
Name: "tanenbaum",
|
Name: "tanenbaum",
|
||||||
Usage: "Tanenbaum network: pre-configured NEVM-based Tanenbaum test network.",
|
Usage: "Tanenbaum network: pre-configured NEVM-based Tanenbaum test network.",
|
||||||
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
SyscoinFlag = &cli.BoolFlag{
|
SyscoinFlag = &cli.BoolFlag{
|
||||||
Name: "syscoin",
|
Name: "syscoin",
|
||||||
Usage: "Syscoin network: pre-configured NEVM-based Syscoin network.",
|
Usage: "Syscoin network: pre-configured NEVM-based Syscoin mainnet.",
|
||||||
|
Category: flags.EthCategory,
|
||||||
}
|
}
|
||||||
SepoliaFlag = &cli.BoolFlag{
|
SepoliaFlag = &cli.BoolFlag{
|
||||||
Name: "sepolia",
|
Name: "sepolia",
|
||||||
|
|
@ -971,10 +972,12 @@ var (
|
||||||
// TestnetFlags is the flag group of all built-in supported testnets.
|
// TestnetFlags is the flag group of all built-in supported testnets.
|
||||||
TestnetFlags = []cli.Flag{
|
TestnetFlags = []cli.Flag{
|
||||||
SepoliaFlag,
|
SepoliaFlag,
|
||||||
|
// SYSCOIN
|
||||||
|
TanenbaumFlag,
|
||||||
HoleskyFlag,
|
HoleskyFlag,
|
||||||
}
|
}
|
||||||
// NetworkFlags is the flag group of all built-in supported networks.
|
// SYSCOIN NetworkFlags is the flag group of all built-in supported networks.
|
||||||
NetworkFlags = append([]cli.Flag{MainnetFlag}, TestnetFlags...)
|
NetworkFlags = append([]cli.Flag{MainnetFlag, SyscoinFlag}, TestnetFlags...)
|
||||||
|
|
||||||
// DatabaseFlags is the flag group of all database flags.
|
// DatabaseFlags is the flag group of all database flags.
|
||||||
DatabaseFlags = []cli.Flag{
|
DatabaseFlags = []cli.Flag{
|
||||||
|
|
@ -1670,8 +1673,8 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
|
||||||
|
|
||||||
// SetEthConfig applies eth-related command line flags to the config.
|
// SetEthConfig applies eth-related command line flags to the config.
|
||||||
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
// Avoid conflicting network flags
|
// SYSCOIN Avoid conflicting network flags
|
||||||
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, SepoliaFlag, HoleskyFlag)
|
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, SepoliaFlag, TanenbaumFlag, SyscoinFlag, HoleskyFlag)
|
||||||
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
|
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
|
||||||
|
|
||||||
// Set configurations from CLI flags
|
// Set configurations from CLI flags
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
|
||||||
}
|
}
|
||||||
// Verify the block's difficulty to ensure it's the default constant
|
// Verify the block's difficulty to ensure it's the default constant
|
||||||
if !chain.Config().IsNexus(header.Number) {
|
if !chain.Config().IsNexus(header.Number) {
|
||||||
if beaconDifficulty.Cmp(big.NewInt(1)) != 0 {
|
if header.Difficulty.Cmp(big.NewInt(1)) != 0 {
|
||||||
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, new(big.Int).SetInt64(1))
|
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, new(big.Int).SetInt64(1))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ const (
|
||||||
headerCacheLimit = 512
|
headerCacheLimit = 512
|
||||||
tdCacheLimit = 1024
|
tdCacheLimit = 1024
|
||||||
numberCacheLimit = 2048
|
numberCacheLimit = 2048
|
||||||
|
// SYSCOIN
|
||||||
|
SYSBlockCacheLimit = 50001
|
||||||
)
|
)
|
||||||
|
|
||||||
// HeaderChain implements the basic block header chain logic. It is not usable
|
// HeaderChain implements the basic block header chain logic. It is not usable
|
||||||
|
|
@ -85,6 +87,10 @@ func NewHeaderChain(chainDb ethdb.Database, config *params.ChainConfig, engine c
|
||||||
headerCache: lru.NewCache[common.Hash, *types.Header](headerCacheLimit),
|
headerCache: lru.NewCache[common.Hash, *types.Header](headerCacheLimit),
|
||||||
tdCache: lru.NewCache[common.Hash, *big.Int](tdCacheLimit),
|
tdCache: lru.NewCache[common.Hash, *big.Int](tdCacheLimit),
|
||||||
numberCache: lru.NewCache[common.Hash, uint64](numberCacheLimit),
|
numberCache: lru.NewCache[common.Hash, uint64](numberCacheLimit),
|
||||||
|
// SYSCOIN
|
||||||
|
SYSHashCache: lru.NewCache[uint64, []byte](SYSBlockCacheLimit),
|
||||||
|
DataHashCache: lru.NewCache[common.Hash, []byte](SYSBlockCacheLimit),
|
||||||
|
NEVMCache: lru.NewCache[common.Hash, []byte](headerCacheLimit),
|
||||||
procInterrupt: procInterrupt,
|
procInterrupt: procInterrupt,
|
||||||
engine: engine,
|
engine: engine,
|
||||||
}
|
}
|
||||||
|
|
@ -728,6 +734,10 @@ func (hc *HeaderChain) setHead(headBlock uint64, headTime uint64, updateFn Updat
|
||||||
hc.headerCache.Purge()
|
hc.headerCache.Purge()
|
||||||
hc.tdCache.Purge()
|
hc.tdCache.Purge()
|
||||||
hc.numberCache.Purge()
|
hc.numberCache.Purge()
|
||||||
|
// SYSCOIN
|
||||||
|
hc.SYSHashCache.Purge()
|
||||||
|
hc.NEVMCache.Purge()
|
||||||
|
hc.DataHashCache.Purge()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetGenesis sets a new genesis block header for the chain
|
// SetGenesis sets a new genesis block header for the chain
|
||||||
|
|
|
||||||
|
|
@ -339,6 +339,9 @@ var (
|
||||||
// NetworkNames are user friendly names to use in the chain spec banner.
|
// NetworkNames are user friendly names to use in the chain spec banner.
|
||||||
var NetworkNames = map[string]string{
|
var NetworkNames = map[string]string{
|
||||||
MainnetChainConfig.ChainID.String(): "mainnet",
|
MainnetChainConfig.ChainID.String(): "mainnet",
|
||||||
|
// SYSCOIN
|
||||||
|
SyscoinChainConfig.ChainID.String(): "syscoin",
|
||||||
|
TanenbaumChainConfig.ChainID.String(): "tanenbaum",
|
||||||
SepoliaChainConfig.ChainID.String(): "sepolia",
|
SepoliaChainConfig.ChainID.String(): "sepolia",
|
||||||
HoleskyChainConfig.ChainID.String(): "holesky",
|
HoleskyChainConfig.ChainID.String(): "holesky",
|
||||||
}
|
}
|
||||||
|
|
@ -430,6 +433,9 @@ func (c *ChainConfig) Description() string {
|
||||||
}
|
}
|
||||||
banner += fmt.Sprintf("Chain ID: %v (%s)\n", c.ChainID, network)
|
banner += fmt.Sprintf("Chain ID: %v (%s)\n", c.ChainID, network)
|
||||||
switch {
|
switch {
|
||||||
|
// SYSCOIN
|
||||||
|
case c.SyscoinBlock != nil:
|
||||||
|
banner += "Consensus: Beacon (proof-of-work), merged with Bitcoin (AuxPoW)\n"
|
||||||
case c.Ethash != nil:
|
case c.Ethash != nil:
|
||||||
if c.TerminalTotalDifficulty == nil {
|
if c.TerminalTotalDifficulty == nil {
|
||||||
banner += "Consensus: Ethash (proof-of-work)\n"
|
banner += "Consensus: Ethash (proof-of-work)\n"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue