cmd,core,eth,params,tests: define yolov3 + enable EIP-2565 (#22213)
Removes the yolov2 definition, adds yolov3, including EIP-2565. This PR also disables some of the erroneously generated blockchain and statetests, and adds the new genesis hash + alloc for yolov3. This PR disables the CLI switches for yolo, since it's not complete until we merge support for 2930.
This commit is contained in:
@ -145,7 +145,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
||||
txContext := core.NewEVMTxContext(msg)
|
||||
|
||||
evm := vm.NewEVM(vmContext, txContext, statedb, chainConfig, vmConfig)
|
||||
if chainConfig.IsYoloV2(vmContext.BlockNumber) {
|
||||
if chainConfig.IsYoloV3(vmContext.BlockNumber) {
|
||||
statedb.AddAddressToAccessList(msg.From())
|
||||
if dst := msg.To(); dst != nil {
|
||||
statedb.AddAddressToAccessList(*dst)
|
||||
|
@ -164,7 +164,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
|
||||
utils.RinkebyFlag,
|
||||
utils.TxLookupLimitFlag,
|
||||
utils.GoerliFlag,
|
||||
utils.YoloV2Flag,
|
||||
utils.YoloV3Flag,
|
||||
utils.LegacyTestnetFlag,
|
||||
},
|
||||
Category: "BLOCKCHAIN COMMANDS",
|
||||
@ -215,7 +215,7 @@ Use "ethereum dump 0" to dump the genesis block.`,
|
||||
utils.RopstenFlag,
|
||||
utils.RinkebyFlag,
|
||||
utils.GoerliFlag,
|
||||
utils.YoloV2Flag,
|
||||
utils.YoloV3Flag,
|
||||
utils.LegacyTestnetFlag,
|
||||
utils.SyncModeFlag,
|
||||
},
|
||||
|
@ -136,8 +136,8 @@ func remoteConsole(ctx *cli.Context) error {
|
||||
path = filepath.Join(path, "rinkeby")
|
||||
} else if ctx.GlobalBool(utils.GoerliFlag.Name) {
|
||||
path = filepath.Join(path, "goerli")
|
||||
} else if ctx.GlobalBool(utils.YoloV2Flag.Name) {
|
||||
path = filepath.Join(path, "yolo-v2")
|
||||
} else if ctx.GlobalBool(utils.YoloV3Flag.Name) {
|
||||
path = filepath.Join(path, "yolo-v3")
|
||||
}
|
||||
}
|
||||
endpoint = fmt.Sprintf("%s/geth.ipc", path)
|
||||
|
@ -148,7 +148,9 @@ var (
|
||||
utils.RopstenFlag,
|
||||
utils.RinkebyFlag,
|
||||
utils.GoerliFlag,
|
||||
utils.YoloV2Flag,
|
||||
// YOLOv3 is not yet complete!
|
||||
// TODO: enable this once 2718/2930 is added
|
||||
//utils.YoloV3Flag,
|
||||
utils.VMEnableDebugFlag,
|
||||
utils.NetworkIdFlag,
|
||||
utils.EthStatsURLFlag,
|
||||
|
@ -44,7 +44,8 @@ var AppHelpFlagGroups = []flags.FlagGroup{
|
||||
utils.MainnetFlag,
|
||||
utils.GoerliFlag,
|
||||
utils.RinkebyFlag,
|
||||
utils.YoloV2Flag,
|
||||
// TODO: Re-enable this when 2718/2930 is added
|
||||
//utils.YoloV3Flag,
|
||||
utils.RopstenFlag,
|
||||
utils.SyncModeFlag,
|
||||
utils.ExitWhenSyncedFlag,
|
||||
|
@ -236,8 +236,8 @@ func (w *wizard) manageGenesis() {
|
||||
w.conf.Genesis.Config.IstanbulBlock = w.readDefaultBigInt(w.conf.Genesis.Config.IstanbulBlock)
|
||||
|
||||
fmt.Println()
|
||||
fmt.Printf("Which block should YOLOv2 come into effect? (default = %v)\n", w.conf.Genesis.Config.YoloV2Block)
|
||||
w.conf.Genesis.Config.YoloV2Block = w.readDefaultBigInt(w.conf.Genesis.Config.YoloV2Block)
|
||||
fmt.Printf("Which block should YOLOv3 come into effect? (default = %v)\n", w.conf.Genesis.Config.YoloV3Block)
|
||||
w.conf.Genesis.Config.YoloV3Block = w.readDefaultBigInt(w.conf.Genesis.Config.YoloV3Block)
|
||||
|
||||
out, _ := json.MarshalIndent(w.conf.Genesis.Config, "", " ")
|
||||
fmt.Printf("Chain configuration updated:\n\n%s\n", out)
|
||||
|
@ -147,9 +147,9 @@ var (
|
||||
Name: "goerli",
|
||||
Usage: "Görli network: pre-configured proof-of-authority test network",
|
||||
}
|
||||
YoloV2Flag = cli.BoolFlag{
|
||||
Name: "yolov2",
|
||||
Usage: "YOLOv2 network: pre-configured proof-of-authority shortlived test network.",
|
||||
YoloV3Flag = cli.BoolFlag{
|
||||
Name: "yolov3",
|
||||
Usage: "YOLOv3 network: pre-configured proof-of-authority shortlived test network.",
|
||||
}
|
||||
RinkebyFlag = cli.BoolFlag{
|
||||
Name: "rinkeby",
|
||||
@ -760,8 +760,8 @@ func MakeDataDir(ctx *cli.Context) string {
|
||||
if ctx.GlobalBool(GoerliFlag.Name) {
|
||||
return filepath.Join(path, "goerli")
|
||||
}
|
||||
if ctx.GlobalBool(YoloV2Flag.Name) {
|
||||
return filepath.Join(path, "yolo-v2")
|
||||
if ctx.GlobalBool(YoloV3Flag.Name) {
|
||||
return filepath.Join(path, "yolo-v3")
|
||||
}
|
||||
return path
|
||||
}
|
||||
@ -819,8 +819,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
|
||||
urls = params.RinkebyBootnodes
|
||||
case ctx.GlobalBool(GoerliFlag.Name):
|
||||
urls = params.GoerliBootnodes
|
||||
case ctx.GlobalBool(YoloV2Flag.Name):
|
||||
urls = params.YoloV2Bootnodes
|
||||
case ctx.GlobalBool(YoloV3Flag.Name):
|
||||
urls = params.YoloV3Bootnodes
|
||||
case cfg.BootstrapNodes != nil:
|
||||
return // already set, don't apply defaults.
|
||||
}
|
||||
@ -1280,7 +1280,7 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby")
|
||||
case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir():
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli")
|
||||
case ctx.GlobalBool(YoloV2Flag.Name) && cfg.DataDir == node.DefaultDataDir():
|
||||
case ctx.GlobalBool(YoloV3Flag.Name) && cfg.DataDir == node.DefaultDataDir():
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "yolo-v2")
|
||||
}
|
||||
}
|
||||
@ -1494,7 +1494,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node) {
|
||||
// SetEthConfig applies eth-related command line flags to the config.
|
||||
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
||||
// Avoid conflicting network flags
|
||||
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag, YoloV2Flag)
|
||||
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag, YoloV3Flag)
|
||||
CheckExclusive(ctx, LegacyLightServFlag, LightServeFlag, SyncModeFlag, "light")
|
||||
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
|
||||
CheckExclusive(ctx, GCModeFlag, "archive", TxLookupLimitFlag)
|
||||
@ -1631,11 +1631,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
|
||||
}
|
||||
cfg.Genesis = core.DefaultGoerliGenesisBlock()
|
||||
SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash)
|
||||
case ctx.GlobalBool(YoloV2Flag.Name):
|
||||
case ctx.GlobalBool(YoloV3Flag.Name):
|
||||
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
|
||||
cfg.NetworkId = 133519467574834 // "yolov2"
|
||||
cfg.NetworkId = new(big.Int).SetBytes([]byte("yolov3")).Uint64() // "yolov3"
|
||||
}
|
||||
cfg.Genesis = core.DefaultYoloV2GenesisBlock()
|
||||
cfg.Genesis = core.DefaultYoloV3GenesisBlock()
|
||||
case ctx.GlobalBool(DeveloperFlag.Name):
|
||||
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
|
||||
cfg.NetworkId = 1337
|
||||
@ -1824,8 +1824,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
|
||||
genesis = core.DefaultRinkebyGenesisBlock()
|
||||
case ctx.GlobalBool(GoerliFlag.Name):
|
||||
genesis = core.DefaultGoerliGenesisBlock()
|
||||
case ctx.GlobalBool(YoloV2Flag.Name):
|
||||
genesis = core.DefaultYoloV2GenesisBlock()
|
||||
case ctx.GlobalBool(YoloV3Flag.Name):
|
||||
genesis = core.DefaultYoloV3GenesisBlock()
|
||||
case ctx.GlobalBool(DeveloperFlag.Name):
|
||||
Fatalf("Developer chains are ephemeral")
|
||||
}
|
||||
|
Reference in New Issue
Block a user