Skip to content

Commit

Permalink
update: eccpow and lve
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Sep 13, 2022
1 parent 66ba067 commit db5b5c9
Show file tree
Hide file tree
Showing 16 changed files with 498 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/clef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GLOBAL OPTIONS:
--loglevel value log level to emit to the screen (default: 4)
--keystore value Directory for the keystore (default: "$HOME/.ethereum/keystore")
--configdir value Directory for Clef configuration (default: "$HOME/.clef")
--chainid value Chain id to use for signing (1=mainnet, 3=Ropsten, 4=Rinkeby, 5=Goerli) (default: 1)
--chainid value Chain id to use for signing (1=mainnet, 3=Ropsten, 4=Rinkeby, 5=Goerli, 12345=Lve, 12346=Lvetest)" (default: 1)
--lightkdf Reduce key-derivation RAM & CPU usage at some expense of KDF strength
--nousb Disables monitoring for and managing USB hardware wallets
--pcscdpath value Path to the smartcard daemon (pcscd) socket file (default: "/run/pcscd/pcscd.comm")
Expand Down
2 changes: 1 addition & 1 deletion cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var (
chainIdFlag = &cli.Int64Flag{
Name: "chainid",
Value: params.MainnetChainConfig.ChainID.Int64(),
Usage: "Chain id to use for signing (1=mainnet, 3=Ropsten, 4=Rinkeby, 5=Goerli)",
Usage: "Chain id to use for signing (1=mainnet, 3=Ropsten, 4=Rinkeby, 5=Goerli, 12345=Lve, 12346=Lvetest)",
}
rpcPortFlag = &cli.IntFlag{
Name: "http.port",
Expand Down
2 changes: 1 addition & 1 deletion cmd/devp2p/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set to standard output. The following filters are supported:
- `-limit <N>` limits the output set to N entries, taking the top N nodes by score
- `-ip <CIDR>` filters nodes by IP subnet
- `-min-age <duration>` filters nodes by 'first seen' time
- `-eth-network <mainnet/rinkeby/goerli/ropsten>` filters nodes by "eth" ENR entry
- `-eth-network <mainnet/rinkeby/goerli/ropsten/lve/lvetest>` filters nodes by "eth" ENR entry
- `-les-server` filters nodes by LES server support
- `-snap` filters nodes by snap protocol support

Expand Down
4 changes: 4 additions & 0 deletions cmd/devp2p/nodesetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ func ethFilter(args []string) (nodeFilter, error) {
filter = forkid.NewStaticFilter(params.RopstenChainConfig, params.RopstenGenesisHash)
case "sepolia":
filter = forkid.NewStaticFilter(params.SepoliaChainConfig, params.SepoliaGenesisHash)
case "lve":
filter = forkid.NewStaticFilter(params.LveChainConfig, params.LveGenesisHash)
case "lvetest":
filter = forkid.NewStaticFilter(params.LvetestChainConfig, params.LvetestGenesisHash)
default:
return nil, fmt.Errorf("unknown network %q", args[0])
}
Expand Down
1 change: 1 addition & 0 deletions cmd/evm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ var blockBuilderCommand = &cli.Command{
t8ntool.InputOmmersFlag,
t8ntool.InputTxsRlpFlag,
t8ntool.SealCliqueFlag,
t8ntool.SealEccpowFlag,
t8ntool.SealEthashFlag,
t8ntool.SealEthashDirFlag,
t8ntool.SealEthashModeFlag,
Expand Down
2 changes: 2 additions & 0 deletions cmd/evm/testdata/21/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ $ go run . b11r --input.header=testdata/21/header.json --input.txs=testdata/21/t
"hash": "0x71c59102cc805dbe8741e1210ebe229a321eff144ac7276006fefe39e8357dc7"
}
```

## Eccpow(working...)
3 changes: 3 additions & 0 deletions cmd/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ var (
goerliFlag = flag.Bool("goerli", false, "Initializes the faucet with Görli network config")
rinkebyFlag = flag.Bool("rinkeby", false, "Initializes the faucet with Rinkeby network config")
sepoliaFlag = flag.Bool("sepolia", false, "Initializes the faucet with Sepolia network config")

//lveFlag = flag.Bool("lve", false, "Initializes the faucet with Lve network config")
//lvetestFlag = flag.Bool("lvetest", false, "Initializes the faucet with Lvetest network config")
)

var (
Expand Down
8 changes: 8 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ func prepare(ctx *cli.Context) {
case ctx.IsSet(utils.KilnFlag.Name):
log.Info("Starting Geth on Kiln testnet...")

case ctx.IsSet(utils.LveFlag.Name):
log.Info("Starting Geth on Lve ...")

case ctx.IsSet(utils.LvetestFlag.Name):
log.Info("Starting Geth on Lve testnet...")

case ctx.IsSet(utils.DeveloperFlag.Name):
log.Info("Starting Geth in ephemeral dev mode...")
log.Warn(`You are running Geth in --dev mode. Please note the following:
Expand Down Expand Up @@ -319,6 +325,8 @@ func prepare(ctx *cli.Context) {
!ctx.IsSet(utils.RinkebyFlag.Name) &&
!ctx.IsSet(utils.GoerliFlag.Name) &&
!ctx.IsSet(utils.KilnFlag.Name) &&
!ctx.IsSet(utils.LveFlag.Name) &&
!ctx.IsSet(utils.LvetestFlag.Name) &&
!ctx.IsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.Int(utils.CacheFlag.Name), "updated", 4096)
Expand Down
34 changes: 33 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,12 @@ var (
GoerliFlag,
SepoliaFlag,
KilnFlag,
LvetestFlag,
}
// NetworkFlags is the flag group of all built-in supported networks.
NetworkFlags = append([]cli.Flag{
MainnetFlag,
LveFlag,
}, TestnetFlags...)

// DatabasePathFlags is the flag group of all database path flags.
Expand Down Expand Up @@ -1033,6 +1035,12 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.Bool(KilnFlag.Name) {
return filepath.Join(path, "kiln")
}
if ctx.Bool(LveFlag.Name) {
return filepath.Join(path, "lve")
}
if ctx.Bool(LvetestFlag.Name) {
return filepath.Join(path, "lvetest")
}
return path
}
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
Expand Down Expand Up @@ -1089,6 +1097,10 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.GoerliBootnodes
case ctx.Bool(KilnFlag.Name):
urls = params.KilnBootnodes
case ctx.Bool(LveFlag.Name):
urls = params.LveBootnodes
case ctx.Bool(LvetestFlag.Name):
urls = params.LvetestBootnodes
}

// don't apply defaults if BootstrapNodes is already set
Expand Down Expand Up @@ -1547,6 +1559,10 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia")
case ctx.Bool(KilnFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "kiln")
case ctx.Bool(LveFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "lve")
case ctx.Bool(LvetestFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "lvetest")
}
}

Expand Down Expand Up @@ -1737,7 +1753,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, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag)
CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag, LveFlag, LvetestFlag)
CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
if ctx.String(GCModeFlag.Name) == "archive" && ctx.Uint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1918,6 +1934,18 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
cfg.Genesis = core.DefaultKilnGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.KilnGenesisHash)
case ctx.Bool(LveFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 12345
}
cfg.Genesis = core.DefaultLveGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.LveGenesisHash)
case ctx.Bool(LvetestFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 12346
}
cfg.Genesis = core.DefaultLvetestGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.LvetestGenesisHash)
case ctx.Bool(DeveloperFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
Expand Down Expand Up @@ -2169,6 +2197,10 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultGoerliGenesisBlock()
case ctx.Bool(KilnFlag.Name):
genesis = core.DefaultKilnGenesisBlock()
case ctx.Bool(LveFlag.Name):
genesis = core.DefaultLveGenesisBlock()
case ctx.Bool(LvetestFlag.Name):
genesis = core.DefaultLvetestGenesisBlock()
case ctx.Bool(DeveloperFlag.Name):
Fatalf("Developer chains are ephemeral")
}
Expand Down
Loading

0 comments on commit db5b5c9

Please sign in to comment.