refactor: remove Scroll Alpha configurations (#965)

This commit is contained in:
Péter Garamvölgyi 2024-08-07 17:21:05 +02:00 committed by GitHub
parent ddf94b3e5a
commit 959f09d4f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 4 additions and 90 deletions

View file

@ -291,9 +291,6 @@ func prepare(ctx *cli.Context) {
case ctx.IsSet(utils.HoleskyFlag.Name):
log.Info("Starting Geth on Holesky testnet...")
case ctx.IsSet(utils.ScrollAlphaFlag.Name):
log.Info("Starting l2geth on Scroll Alpha testnet...")
case ctx.IsSet(utils.ScrollSepoliaFlag.Name):
log.Info("Starting l2geth on Scroll Sepolia testnet...")
@ -327,7 +324,6 @@ func prepare(ctx *cli.Context) {
if !ctx.IsSet(utils.HoleskyFlag.Name) &&
!ctx.IsSet(utils.SepoliaFlag.Name) &&
!ctx.IsSet(utils.GoerliFlag.Name) &&
!ctx.IsSet(utils.ScrollAlphaFlag.Name) &&
!ctx.IsSet(utils.ScrollSepoliaFlag.Name) &&
!ctx.IsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!

View file

@ -169,11 +169,6 @@ var (
Usage: "Scroll mainnet",
Category: flags.EthCategory,
}
ScrollAlphaFlag = &cli.BoolFlag{
Name: "scroll-alpha",
Usage: "Scroll Alpha test network",
Category: flags.EthCategory,
}
ScrollSepoliaFlag = &cli.BoolFlag{
Name: "scroll-sepolia",
Usage: "Scroll Sepolia test network",
@ -1024,7 +1019,6 @@ var (
GoerliFlag,
SepoliaFlag,
HoleskyFlag,
ScrollAlphaFlag,
ScrollSepoliaFlag,
}
// NetworkFlags is the flag group of all built-in supported networks.
@ -1055,9 +1049,6 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.Bool(HoleskyFlag.Name) {
return filepath.Join(path, "holesky")
}
if ctx.Bool(ScrollAlphaFlag.Name) {
return filepath.Join(path, "scroll-alpha")
}
if ctx.Bool(ScrollSepoliaFlag.Name) {
return filepath.Join(path, "scroll-sepolia")
}
@ -1126,8 +1117,6 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.SepoliaBootnodes
case ctx.Bool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.Bool(ScrollAlphaFlag.Name):
urls = params.ScrollAlphaBootnodes
case ctx.Bool(ScrollSepoliaFlag.Name):
urls = params.ScrollSepoliaBootnodes
case ctx.Bool(ScrollFlag.Name):
@ -1619,8 +1608,6 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia")
case ctx.Bool(HoleskyFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "holesky")
case ctx.Bool(ScrollAlphaFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "scroll-alpha")
case ctx.Bool(ScrollSepoliaFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "scroll-sepolia")
case ctx.Bool(ScrollFlag.Name) && cfg.DataDir == node.DefaultDataDir():
@ -1810,7 +1797,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// Avoid conflicting network flags
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag, ScrollAlphaFlag, ScrollSepoliaFlag, ScrollFlag)
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag, ScrollSepoliaFlag, ScrollFlag)
CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
@ -1980,12 +1967,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
cfg.Genesis = core.DefaultGoerliGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash)
case ctx.Bool(ScrollAlphaFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 534353
}
cfg.Genesis = core.DefaultScrollAlphaGenesisBlock()
// SetDNSDiscoveryDefaults(cfg, params.ScrollAlphaGenesisHash)
case ctx.Bool(ScrollSepoliaFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 534351
@ -2356,8 +2337,6 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultSepoliaGenesisBlock()
case ctx.Bool(GoerliFlag.Name):
genesis = core.DefaultGoerliGenesisBlock()
case ctx.Bool(ScrollAlphaFlag.Name):
genesis = core.DefaultScrollAlphaGenesisBlock()
case ctx.Bool(ScrollSepoliaFlag.Name):
genesis = core.DefaultScrollSepoliaGenesisBlock()
case ctx.Bool(ScrollFlag.Name):

View file

@ -421,8 +421,6 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.SepoliaChainConfig
case ghash == params.GoerliGenesisHash:
return params.GoerliChainConfig
case ghash == params.ScrollAlphaGenesisHash:
return params.ScrollAlphaChainConfig
case ghash == params.ScrollSepoliaGenesisHash:
return params.ScrollSepoliaChainConfig
case ghash == params.ScrollMainnetGenesisHash:
@ -589,18 +587,6 @@ func DefaultHoleskyGenesisBlock() *Genesis {
}
}
// DefaultScrollAlphaGenesisBlock returns the Scroll Alpha network genesis block.
func DefaultScrollAlphaGenesisBlock() *Genesis {
return &Genesis{
Config: params.ScrollAlphaChainConfig,
Timestamp: 0x63f67207,
ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000b7C0c58702D0781C0e2eB3aaE301E4c340073448Ec9c139eFCBBe6323DA406fffBF4Db02a60A9720589c71deC4302fE718bE62350c174922782Cc6600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 8000000,
Difficulty: big.NewInt(1),
Alloc: decodePrealloc(scrollAlphaAllocData),
}
}
// DefaultScrollSepoliaGenesisBlock returns the Scroll Sepolia network genesis block.
func DefaultScrollSepoliaGenesisBlock() *Genesis {
return &Genesis{

File diff suppressed because one or more lines are too long

View file

@ -184,7 +184,6 @@ func TestGenesisHashes(t *testing.T) {
// {DefaultGenesisBlock(), params.MainnetGenesisHash},
// {DefaultGoerliGenesisBlock(), params.GoerliGenesisHash},
// {DefaultSepoliaGenesisBlock(), params.SepoliaGenesisHash},
// {DefaultScrollAlphaGenesisBlock(), params.ScrollAlphaGenesisHash},
{DefaultScrollSepoliaGenesisBlock(), params.ScrollSepoliaGenesisHash},
{DefaultScrollMainnetGenesisBlock(), params.ScrollMainnetGenesisHash},
} {

View file

@ -64,13 +64,6 @@ var GoerliBootnodes = []string{
"enode://d2b720352e8216c9efc470091aa91ddafc53e222b32780f505c817ceef69e01d5b0b0797b69db254c586f493872352f5a022b4d8479a00fc92ec55f9ad46a27e@88.99.70.182:30303",
}
// ScrollAlphaBootnodes are the enode URLs of the P2P bootstrap nodes running on the Scroll Alpha test network.
var ScrollAlphaBootnodes = []string{
"enode://996a655365e731321ca35636f5a62fdf37c0b75dc56a8832c472d077da5af47effe45874196268f6083b8f65e1a9589ed25015f68f47598c7bcc93ac8ea29e8a@35.85.116.190:30303",
"enode://a4e90d8108bbcd8b13066567c786f800812a9b6b3eeb92947e64edd19ac9231bf371da1a86796af2ccd7b7e781218ebbe2d04130d63f7b3f25d6372a706fc022@44.224.134.190:30303",
"enode://cf85bfa5828239b1f6b21758579ee8aaaba2a1fb4c658d6967c5f7ed4f040d95dee5b5cef0c77d656a191f6b0875dd03f05b30a3b2b3e15bfcf18b500d8f634c@35.155.117.77:30303",
}
// ScrollSepoliaBootnodes are the enode URLs of the P2P bootstrap nodes running on the Scroll Sepolia test network.
var ScrollSepoliaBootnodes = []string{
"enode://ceb1636bac5cbb262e5ad5b2cd22014bdb35ffe7f58b3506970d337a63099481814a338dbcd15f2d28757151e3ecd40ba38b41350b793cd0d910ff0436654f8c@35.85.84.250:30303",

View file

@ -31,7 +31,6 @@ var (
SepoliaGenesisHash = common.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9")
GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a")
ScrollAlphaGenesisHash = common.HexToHash("0xa4fc62b9b0643e345bdcebe457b3ae898bef59c7203c3db269200055e037afda")
ScrollSepoliaGenesisHash = common.HexToHash("0xaa62d1a8b2bffa9e5d2368b63aae0d98d54928bd713125e3fd9e5c896c68592c")
ScrollMainnetGenesisHash = common.HexToHash("0xbbc05efd412b7cd47a2ed0e5ddfcf87af251e414ea4c801d78b6784513180a80")
)
@ -183,45 +182,7 @@ var (
},
}
// ScrollAlphaChainConfig contains the chain parameters to run a node on the Scroll Alpha test network.
ScrollAlphaChainConfig = &ChainConfig{
ChainID: big.NewInt(534353),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: nil,
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: nil,
ShanghaiTime: nil,
ArchimedesBlock: big.NewInt(2646311),
BernoulliBlock: nil,
CurieBlock: nil,
DarwinTime: nil,
Clique: &CliqueConfig{
Period: 3,
Epoch: 30000,
},
Scroll: ScrollConfig{
UseZktrie: true,
MaxTxPerBlock: &rcfg.ScrollMaxTxPerBlock,
MaxTxPayloadBytesPerBlock: &rcfg.ScrollMaxTxPayloadBytesPerBlock,
FeeVaultAddress: &rcfg.ScrollFeeVaultAddress,
L1Config: &L1Config{
L1ChainId: 5,
L1MessageQueueAddress: common.HexToAddress("0x79DB48002Aa861C8cb189cabc21c6B1468BC83BB"),
NumL1MessagesPerBlock: 0,
ScrollChainAddress: common.HexToAddress("0x3C584eC7f0f2764CC715ac3180Ae9828465E9833"),
},
},
}
// ScrollSepoliaChainConfig contains the chain parameters to run a node on the Scroll Sepolia test network.
ScrollSepoliaChainConfig = &ChainConfig{
ChainID: big.NewInt(534351),
HomesteadBlock: big.NewInt(0),
@ -260,6 +221,8 @@ var (
},
},
}
// ScrollMainnetChainConfig contains the chain parameters to run a node on the Scroll mainnet.
ScrollMainnetChainConfig = &ChainConfig{
ChainID: big.NewInt(534352),
HomesteadBlock: big.NewInt(0),
@ -495,7 +458,6 @@ var NetworkNames = map[string]string{
SepoliaChainConfig.ChainID.String(): "sepolia",
HoleskyChainConfig.ChainID.String(): "holesky",
ScrollAlphaChainConfig.ChainID.String(): "scroll-alpha",
ScrollSepoliaChainConfig.ChainID.String(): "scroll-sepolia",
ScrollMainnetChainConfig.ChainID.String(): "scroll",
}