Skip to content

Commit

Permalink
switch galena to lighthouse
Browse files Browse the repository at this point in the history
  • Loading branch information
hubchub committed Aug 16, 2023
1 parent 5465054 commit d670a02
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion cmd/go-quai/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ It expects the genesis file as argument.`,
utils.ColosseumFlag,
utils.GardenFlag,
utils.OrchardFlag,
utils.GalenaFlag,
utils.LighthouseFlag,
utils.LocalFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Expand Down
8 changes: 4 additions & 4 deletions cmd/go-quai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var (
utils.ExternalSignerFlag,
utils.FakePoWFlag,
utils.GCModeFlag,
utils.GalenaFlag,
utils.LighthouseFlag,
utils.GardenFlag,
utils.GenesisNonceFlag,
utils.GpoBlocksFlag,
Expand Down Expand Up @@ -227,8 +227,8 @@ func prepare(ctx *cli.Context) {
netname = utils.OrchardFlag.Name + " testnet"
case ctx.GlobalIsSet(utils.LocalFlag.Name):
netname = utils.LocalFlag.Name + " testnet"
case ctx.GlobalIsSet(utils.GalenaFlag.Name):
netname = utils.GalenaFlag.Name + " testnet"
case ctx.GlobalIsSet(utils.LighthouseFlag.Name):
netname = utils.LighthouseFlag.Name + " testnet"
case ctx.GlobalIsSet(utils.DeveloperFlag.Name):
netname = utils.DeveloperFlag.Name + " ephemeral dev network"
case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name):
Expand All @@ -240,7 +240,7 @@ func prepare(ctx *cli.Context) {
// If we're a full node on colosseum without --cache specified, bump default cache allowance
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.GlobalIsSet(utils.GardenFlag.Name) && !ctx.GlobalIsSet(utils.OrchardFlag.Name) && !ctx.GlobalIsSet(utils.GalenaFlag.Name) && !ctx.GlobalIsSet(utils.LocalFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
if !ctx.GlobalIsSet(utils.GardenFlag.Name) && !ctx.GlobalIsSet(utils.OrchardFlag.Name) && !ctx.GlobalIsSet(utils.LighthouseFlag.Name) && !ctx.GlobalIsSet(utils.LocalFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on colosseum. Bump that cache up!
log.Info("Bumping default cache on colosseum", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))
Expand Down
2 changes: 1 addition & 1 deletion cmd/go-quai/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.ColosseumFlag,
utils.GardenFlag,
utils.OrchardFlag,
utils.GalenaFlag,
utils.LighthouseFlag,
utils.LocalFlag,
utils.GenesisNonceFlag,
utils.SyncModeFlag,
Expand Down
44 changes: 22 additions & 22 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ var (
Name: "orchard",
Usage: "Orchard network: pre-configured proof-of-work test network",
}
GalenaFlag = cli.BoolFlag{
Name: "galena",
Usage: "Galena network: pre-configured proof-of-work test network",
LighthouseFlag = cli.BoolFlag{
Name: "lighthouse",
Usage: "Lighthouse network: pre-configured proof-of-work test network",
}
LocalFlag = cli.BoolFlag{
Name: "local",
Expand Down Expand Up @@ -690,8 +690,8 @@ func MakeDataDir(ctx *cli.Context) string {
// Local database in `local` instead of `testnet`.
path = filepath.Join(path, "local")
}
if ctx.GlobalBool(GalenaFlag.Name) {
path = filepath.Join(path, "galena")
if ctx.GlobalBool(LighthouseFlag.Name) {
path = filepath.Join(path, "lighthouse")
}
// Set specific directory for node location within the hierarchy
switch common.NodeLocation.Context() {
Expand Down Expand Up @@ -755,8 +755,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.GardenBootnodes
case ctx.GlobalBool(OrchardFlag.Name):
urls = params.OrchardBootnodes
case ctx.GlobalBool(GalenaFlag.Name):
urls = params.GalenaBootnodes
case ctx.GlobalBool(LighthouseFlag.Name):
urls = params.LighthouseBootnodes
case ctx.GlobalBool(LocalFlag.Name):
urls = []string{}
case cfg.BootstrapNodes != nil:
Expand Down Expand Up @@ -967,8 +967,8 @@ func setGasLimitCeil(ctx *cli.Context, cfg *ethconfig.Config) {
cfg.Miner.GasCeil = params.GardenGasCeil
case ctx.GlobalBool(OrchardFlag.Name):
cfg.Miner.GasCeil = params.OrchardGasCeil
case ctx.GlobalBool(GalenaFlag.Name):
cfg.Miner.GasCeil = params.GalenaGasCeil
case ctx.GlobalBool(LighthouseFlag.Name):
cfg.Miner.GasCeil = params.LighthouseGasCeil
case ctx.GlobalBool(LocalFlag.Name):
cfg.Miner.GasCeil = params.LocalGasCeil
case ctx.GlobalBool(DeveloperFlag.Name):
Expand Down Expand Up @@ -1154,8 +1154,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "garden")
case ctx.GlobalBool(OrchardFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "orchard")
case ctx.GlobalBool(GalenaFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "galena")
case ctx.GlobalBool(LighthouseFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "lighthouse")
case ctx.GlobalBool(LocalFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "local")
}
Expand Down Expand Up @@ -1250,8 +1250,8 @@ func setDurationLimit(ctx *cli.Context, cfg *ethconfig.Config) {
cfg.Blake3Pow.DurationLimit = params.GardenDurationLimit
case ctx.GlobalBool(OrchardFlag.Name):
cfg.Blake3Pow.DurationLimit = params.OrchardDurationLimit
case ctx.GlobalBool(GalenaFlag.Name):
cfg.Blake3Pow.DurationLimit = params.GalenaDurationLimit
case ctx.GlobalBool(LighthouseFlag.Name):
cfg.Blake3Pow.DurationLimit = params.LighthouseDurationLimit
case ctx.GlobalBool(LocalFlag.Name):
cfg.Blake3Pow.DurationLimit = params.LocalDurationLimit
case ctx.GlobalBool(DeveloperFlag.Name):
Expand All @@ -1269,8 +1269,8 @@ func setDurationLimit(ctx *cli.Context, cfg *ethconfig.Config) {
cfg.Progpow.DurationLimit = params.GardenDurationLimit
case ctx.GlobalBool(OrchardFlag.Name):
cfg.Progpow.DurationLimit = params.OrchardDurationLimit
case ctx.GlobalBool(GalenaFlag.Name):
cfg.Progpow.DurationLimit = params.GalenaDurationLimit
case ctx.GlobalBool(LighthouseFlag.Name):
cfg.Progpow.DurationLimit = params.LighthouseDurationLimit
case ctx.GlobalBool(LocalFlag.Name):
cfg.Progpow.DurationLimit = params.LocalDurationLimit
case ctx.GlobalBool(DeveloperFlag.Name):
Expand Down Expand Up @@ -1404,7 +1404,7 @@ func EnablePprof() {
// 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, ColosseumFlag, DeveloperFlag, GardenFlag, OrchardFlag, LocalFlag, GalenaFlag)
CheckExclusive(ctx, ColosseumFlag, DeveloperFlag, GardenFlag, OrchardFlag, LocalFlag, LighthouseFlag)
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer

if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1588,15 +1588,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
} else {
SetDNSDiscoveryDefaults(cfg, params.ProgpowLocalGenesisHash)
}
case ctx.GlobalBool(GalenaFlag.Name):
case ctx.GlobalBool(LighthouseFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 5
}
cfg.Genesis = core.DefaultGalenaGenesisBlock(cfg.ConsensusEngine)
cfg.Genesis = core.DefaultLighthouseGenesisBlock(cfg.ConsensusEngine)
if cfg.ConsensusEngine == "blake3" {
SetDNSDiscoveryDefaults(cfg, params.Blake3PowGalenaGenesisHash)
SetDNSDiscoveryDefaults(cfg, params.Blake3PowLighthouseGenesisHash)
} else {
SetDNSDiscoveryDefaults(cfg, params.ProgpowGalenaGenesisHash)
SetDNSDiscoveryDefaults(cfg, params.ProgpowLighthouseGenesisHash)
}
case ctx.GlobalBool(DeveloperFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
Expand Down Expand Up @@ -1729,8 +1729,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultGardenGenesisBlock(ctx.GlobalString(ConsensusEngineFlag.Name))
case ctx.GlobalBool(OrchardFlag.Name):
genesis = core.DefaultOrchardGenesisBlock(ctx.GlobalString(ConsensusEngineFlag.Name))
case ctx.GlobalBool(GalenaFlag.Name):
genesis = core.DefaultGalenaGenesisBlock(ctx.GlobalString(ConsensusEngineFlag.Name))
case ctx.GlobalBool(LighthouseFlag.Name):
genesis = core.DefaultLighthouseGenesisBlock(ctx.GlobalString(ConsensusEngineFlag.Name))
case ctx.GlobalBool(LocalFlag.Name):
genesis = core.DefaultLocalGenesisBlock(ctx.GlobalString(ConsensusEngineFlag.Name))
case ctx.GlobalBool(DeveloperFlag.Name):
Expand Down
16 changes: 8 additions & 8 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.ProgpowGardenChainConfig
case ghash == params.ProgpowOrchardGenesisHash:
return params.ProgpowOrchardChainConfig
case ghash == params.ProgpowGalenaGenesisHash:
return params.ProgpowGalenaChainConfig
case ghash == params.ProgpowLighthouseGenesisHash:
return params.ProgpowLighthouseChainConfig
case ghash == params.ProgpowLocalGenesisHash:
return params.ProgpowLocalChainConfig
// Blake3 chain configs
Expand All @@ -248,8 +248,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.Blake3PowGardenChainConfig
case ghash == params.Blake3PowOrchardGenesisHash:
return params.Blake3PowOrchardChainConfig
case ghash == params.Blake3PowGalenaGenesisHash:
return params.Blake3PowGalenaChainConfig
case ghash == params.Blake3PowLighthouseGenesisHash:
return params.Blake3PowLighthouseChainConfig
case ghash == params.Blake3PowLocalGenesisHash:
return params.Blake3PowLocalChainConfig

Expand Down Expand Up @@ -386,19 +386,19 @@ func DefaultOrchardGenesisBlock(consensusEngine string) *Genesis {
}
}

// DefaultGalenaGenesisBlock returns the Galena testnet genesis block.
func DefaultGalenaGenesisBlock(consensusEngine string) *Genesis {
// DefaultLighthouseGenesisBlock returns the Lighthouse testnet genesis block.
func DefaultLighthouseGenesisBlock(consensusEngine string) *Genesis {
if consensusEngine == "blake3" {
return &Genesis{
Config: params.Blake3PowGalenaChainConfig,
Config: params.Blake3PowLighthouseChainConfig,
Nonce: 66,
ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fb"),
GasLimit: 5000000,
Difficulty: big.NewInt(4000000),
}
}
return &Genesis{
Config: params.ProgpowGalenaChainConfig,
Config: params.ProgpowLighthouseChainConfig,
Nonce: 0,
ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353537"),
GasLimit: 5000000,
Expand Down
2 changes: 1 addition & 1 deletion core/genesis_alloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ package core
const colosseumAllocData = "\xc0"
const gardenAllocData = "\xc0"
const orchardAllocData = "\xc0"
const galenaAllocData = "\xc0"
const lighthouseAllocData = "\xc0"
const localAllocData = "\xc0"
2 changes: 1 addition & 1 deletion eth/protocols/eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func MakeProtocols(backend Backend, network uint64, dnsdisc enode.Iterator) []p2
// NodeInfo represents a short summary of the `quai` sub-protocol metadata
// known about the host peer.
type NodeInfo struct {
Network uint64 `json:"network"` // Quai network ID (1=Colosseum, Garden=2, Orchard=3, Galena=4)
Network uint64 `json:"network"` // Quai network ID (1=Colosseum, Garden=2, Orchard=3, Lighthouse=4)
Entropy *big.Int `json:"entropy"` // Total entropy of the host's blockchain
Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules
Expand Down
14 changes: 7 additions & 7 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ var OrchardBootnodes = []string{
"enode://d6d27b273682f8abc7ffff04dc9006bd40f0a079a8ba24da351b714506bb82c1f106ff073fa04983345aef15c876c602209b48b37d8ee10dad581fd1d9db9263@34.23.150.43", // us-east1-c
}

// GalenaBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Galena test network
var GalenaBootnodes = []string{
// LighthouseBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Lighthouse test network
var LighthouseBootnodes = []string{
"enode://ee89c22bff79d040fcf3dbaea3bcbe429e68b0ca9e32671027554e96aea3f132f6abed8cf5be514c50b76cf2cab96c7d9064a93f0bbd0903f26df4be01ce0e6a@35.196.124.28", // europe-southwest1-a
"enode://b39cf3080c8c9165bf0b50a7f6c8ff5a3568649b0c57ae786f630a054722fccfec7e3232594eb37a62a04e7c310a4d4e899ea42c0bd5a5043a248510715e2af9@35.187.55.110", // southamerica-east1-b
"enode://ce3daf05c462b36bc1a6261b8edb0cd72bf041c1f8fb59100d6a09dc3415d1f136cc8768b12129db73c48085c8e01d7a606be447d3f681f405ab427641599235@34.92.50.205", // asia-northeast3-a
Expand All @@ -66,16 +66,16 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string {
net = "garden"
case ProgpowOrchardGenesisHash:
net = "orchard"
case ProgpowGalenaGenesisHash:
net = "galena"
case ProgpowLighthouseGenesisHash:
net = "lighthouse"
case Blake3PowColosseumGenesisHash:
net = "colosseum"
case Blake3PowGardenGenesisHash:
net = "garden"
case Blake3PowOrchardGenesisHash:
net = "orchard"
case Blake3PowGalenaGenesisHash:
net = "galena"
case Blake3PowLighthouseGenesisHash:
net = "lighthouse"
default:
return ""
}
Expand Down
30 changes: 15 additions & 15 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ import (
// Genesis hashes to enforce below configs on.
var (
// Progpow GenesisHashes
ProgpowColosseumGenesisHash = common.HexToHash("0x3d2c4cc684a7b2c7764031058b457cdf09b946a62c7f3d6628f64386e7692d24")
ProgpowGardenGenesisHash = common.HexToHash("0x8975f8760d317524559986d595058d4d66c05d62e0eda1d740cdee56a25788a5")
ProgpowOrchardGenesisHash = common.HexToHash("0x5627aca8194b46ed071f92746ecf975542b12ce406905d715b4be8f044749956")
ProgpowLocalGenesisHash = common.HexToHash("0x7f594e88d6c93a00680840a855b7c9349218751cc344562dacb43a63eec02d93")
ProgpowGalenaGenesisHash = common.HexToHash("0xe0a395a3fcd7ecbb28dd66eeceab2fb40db01a2bfbf9e5fbc5b93269104df19a")
ProgpowColosseumGenesisHash = common.HexToHash("0x3d2c4cc684a7b2c7764031058b457cdf09b946a62c7f3d6628f64386e7692d24")
ProgpowGardenGenesisHash = common.HexToHash("0x8975f8760d317524559986d595058d4d66c05d62e0eda1d740cdee56a25788a5")
ProgpowOrchardGenesisHash = common.HexToHash("0x5627aca8194b46ed071f92746ecf975542b12ce406905d715b4be8f044749956")
ProgpowLocalGenesisHash = common.HexToHash("0x7f594e88d6c93a00680840a855b7c9349218751cc344562dacb43a63eec02d93")
ProgpowLighthouseGenesisHash = common.HexToHash("0xe0a395a3fcd7ecbb28dd66eeceab2fb40db01a2bfbf9e5fbc5b93269104df19a")

// Blake3GenesisHashes
Blake3PowColosseumGenesisHash = common.HexToHash("0xe6e0ff26dafbb1ff849b965fc300ebc9eee2708686943030d958dc4cc4b6c0ea")
Blake3PowGardenGenesisHash = common.HexToHash("0xdee75a7b24237d07f15392d7d5319a9421f838d84b9a6e6a8d1a4d74365ff2de")
Blake3PowOrchardGenesisHash = common.HexToHash("0x418ea8cd5f17277e4bb94cba7170a494fc53df23b915ed42a8fe9f6052a4327b")
Blake3PowLocalGenesisHash = common.HexToHash("0x6181f4781316452abf66aaafa44568a4e9f56bb10c276c9d7b3964efea4fbc56")
Blake3PowGalenaGenesisHash = common.HexToHash("0xdee75a7b24237d07f15392d7d5319a9421f838d84b9a6e6a8d1a4d74365ff2de")
Blake3PowColosseumGenesisHash = common.HexToHash("0xe6e0ff26dafbb1ff849b965fc300ebc9eee2708686943030d958dc4cc4b6c0ea")
Blake3PowGardenGenesisHash = common.HexToHash("0xdee75a7b24237d07f15392d7d5319a9421f838d84b9a6e6a8d1a4d74365ff2de")
Blake3PowOrchardGenesisHash = common.HexToHash("0x418ea8cd5f17277e4bb94cba7170a494fc53df23b915ed42a8fe9f6052a4327b")
Blake3PowLocalGenesisHash = common.HexToHash("0x6181f4781316452abf66aaafa44568a4e9f56bb10c276c9d7b3964efea4fbc56")
Blake3PowLighthouseGenesisHash = common.HexToHash("0xdee75a7b24237d07f15392d7d5319a9421f838d84b9a6e6a8d1a4d74365ff2de")
)

var (
Expand Down Expand Up @@ -80,18 +80,18 @@ var (
GenesisHash: Blake3PowOrchardGenesisHash,
}

// GalenaChainConfig contains the chain parameters to run a node on the Galena test network.
ProgpowGalenaChainConfig = &ChainConfig{
// LighthouseChainConfig contains the chain parameters to run a node on the Lighthouse test network.
ProgpowLighthouseChainConfig = &ChainConfig{
ChainID: big.NewInt(17000),
Blake3Pow: new(Blake3powConfig),
Progpow: new(ProgpowConfig),
GenesisHash: ProgpowGalenaGenesisHash,
GenesisHash: ProgpowLighthouseGenesisHash,
}

Blake3PowGalenaChainConfig = &ChainConfig{
Blake3PowLighthouseChainConfig = &ChainConfig{
ChainID: big.NewInt(17000),
Blake3Pow: new(Blake3powConfig),
GenesisHash: Blake3PowGalenaGenesisHash,
GenesisHash: Blake3PowLighthouseGenesisHash,
}

// LocalChainConfig contains the chain parameters to run a node on the Local test network.
Expand Down
4 changes: 2 additions & 2 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var (
ColosseumGasCeil uint64 = 50000000
GardenGasCeil uint64 = 17000000
OrchardGasCeil uint64 = 50000000
GalenaGasCeil uint64 = 160000000
LighthouseGasCeil uint64 = 160000000
LocalGasCeil uint64 = 20000000
DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations.
ZoneMinDifficulty = big.NewInt(1000) // The minimum difficulty in a zone. Prime & regions should be multiples of this value
Expand All @@ -150,7 +150,7 @@ var (
DurationLimit = big.NewInt(10) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
GardenDurationLimit = big.NewInt(3) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
OrchardDurationLimit = big.NewInt(12) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
GalenaDurationLimit = big.NewInt(12) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
LighthouseDurationLimit = big.NewInt(12) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
LocalDurationLimit = big.NewInt(2) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
TimeFactor = big.NewInt(7)
)

0 comments on commit d670a02

Please sign in to comment.