From 2611f1dd9a980c1bdb287b219e003bd3651e67e3 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Sat, 28 Feb 2026 22:00:55 +0800 Subject: [PATCH] fix(all): fix typo foudation (#2063) --- cicd/devnet/genesis.json | 2 +- cicd/mainnet/genesis.json | 4 +- cicd/testnet/genesis.json | 2 +- cmd/puppeth/wizard_genesis.go | 12 ++-- common/types.go | 2 +- common/types_test.go | 2 +- .../tests/engine_v2_tests/reward_test.go | 18 ++--- contracts/validator/validator_test.go | 10 +-- docs/xdc/XDPoS/XDPoS.md | 2 +- docs/xdc/admin/admin_nodeInfo_response.json | 2 +- eth/api_backend.go | 2 +- eth/hooks/engine_v1_hooks.go | 2 +- eth/hooks/engine_v2_hooks.go | 2 +- genesis/XDCxnet.json | 2 +- genesis/devnet.json | 2 +- genesis/mainnet.json | 4 +- genesis/testnet.json | 2 +- params/config.go | 70 +++++++++---------- 18 files changed, 71 insertions(+), 71 deletions(-) diff --git a/cicd/devnet/genesis.json b/cicd/devnet/genesis.json index 792b58c951..34ddeaf972 100644 --- a/cicd/devnet/genesis.json +++ b/cicd/devnet/genesis.json @@ -14,7 +14,7 @@ "reward": 10, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82", + "foundationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82", "SkipV1Validation": false, "v2": { "switchBlock": 0, diff --git a/cicd/mainnet/genesis.json b/cicd/mainnet/genesis.json index e7540bd00b..a77d4def96 100644 --- a/cicd/mainnet/genesis.json +++ b/cicd/mainnet/genesis.json @@ -13,7 +13,7 @@ "reward": 5000, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65" + "foundationWalletAddr": "xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65" } }, "nonce": "0x0", @@ -110,4 +110,4 @@ "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} \ No newline at end of file +} diff --git a/cicd/testnet/genesis.json b/cicd/testnet/genesis.json index 6f643f78e9..d55ec18e59 100644 --- a/cicd/testnet/genesis.json +++ b/cicd/testnet/genesis.json @@ -14,7 +14,7 @@ "reward": 5000, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c" + "foundationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c" } }, "nonce": "0x0", diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index c5da9626ae..e833213bed 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -75,7 +75,7 @@ func NewGenesisInput() *GenesisInput { CertThreshold: 0.667, StakingThreshold: 10_000_000, // 10M RewardYield: 10, - FoundationWalletAddress: common.FoudationAddrBinary, + FoundationWalletAddress: common.FoundationAddrBinary, } } @@ -324,9 +324,9 @@ func (w *wizard) makeGenesis() { fmt.Println() fmt.Println("What is foundation wallet address (collect 10% of all rewards)? (default = xdc0000000000000000000000000000000000000068)") if input != nil { - genesis.Config.XDPoS.FoudationWalletAddr = input.FoundationWalletAddress + genesis.Config.XDPoS.FoundationWalletAddr = input.FoundationWalletAddress } else { - genesis.Config.XDPoS.FoudationWalletAddr = w.readDefaultAddress(common.FoudationAddrBinary) + genesis.Config.XDPoS.FoundationWalletAddr = w.readDefaultAddress(common.FoundationAddrBinary) } // Validator Smart Contract Code @@ -370,7 +370,7 @@ func (w *wizard) makeGenesis() { } fmt.Println() - fmt.Println("Which accounts are allowed to confirm in Foudation MultiSignWallet?") + fmt.Println("Which accounts are allowed to confirm in Foundation MultiSignWallet?") var owners []common.Address if input != nil { owners = append(owners, input.MasternodesOwner) @@ -387,7 +387,7 @@ func (w *wizard) makeGenesis() { } fmt.Println() - fmt.Println("How many require for confirm tx in Foudation MultiSignWallet? (default = 1)") + fmt.Println("How many require for confirm tx in Foundation MultiSignWallet? (default = 1)") var required uint64 if input != nil { required = 1 @@ -407,7 +407,7 @@ func (w *wizard) makeGenesis() { fBalance := big.NewInt(0) // 16m fBalance.Add(fBalance, big.NewInt(16*1000*1000)) fBalance.Mul(fBalance, big.NewInt(1000000000000000000)) - genesis.Alloc[common.FoudationAddrBinary] = types.Account{ + genesis.Alloc[common.FoundationAddrBinary] = types.Account{ Balance: fBalance, Code: code, Storage: storage, diff --git a/common/types.go b/common/types.go index 6323780dc2..a4f736f45a 100644 --- a/common/types.go +++ b/common/types.go @@ -52,7 +52,7 @@ var ( BlockSignersBinary = HexToAddress("0x0000000000000000000000000000000000000089") MasternodeVotingSMCBinary = HexToAddress("0x0000000000000000000000000000000000000088") RandomizeSMCBinary = HexToAddress("0x0000000000000000000000000000000000000090") - FoudationAddrBinary = HexToAddress("0x0000000000000000000000000000000000000068") + FoundationAddrBinary = HexToAddress("0x0000000000000000000000000000000000000068") TeamAddrBinary = HexToAddress("0x0000000000000000000000000000000000000099") XDCXAddrBinary = HexToAddress("0x0000000000000000000000000000000000000091") TradingStateAddrBinary = HexToAddress("0x0000000000000000000000000000000000000092") diff --git a/common/types_test.go b/common/types_test.go index adf35cc797..d7f4b9097f 100644 --- a/common/types_test.go +++ b/common/types_test.go @@ -343,7 +343,7 @@ var testCases = []struct { {BlockSignersBinary, "xdc0000000000000000000000000000000000000089"}, {MasternodeVotingSMCBinary, "xdc0000000000000000000000000000000000000088"}, {RandomizeSMCBinary, "xdc0000000000000000000000000000000000000090"}, - {FoudationAddrBinary, "xdc0000000000000000000000000000000000000068"}, + {FoundationAddrBinary, "xdc0000000000000000000000000000000000000068"}, {TeamAddrBinary, "xdc0000000000000000000000000000000000000099"}, {XDCXAddrBinary, "xdc0000000000000000000000000000000000000091"}, {TradingStateAddrBinary, "xdc0000000000000000000000000000000000000092"}, diff --git a/consensus/tests/engine_v2_tests/reward_test.go b/consensus/tests/engine_v2_tests/reward_test.go index ceb7913720..4e03cd3581 100644 --- a/consensus/tests/engine_v2_tests/reward_test.go +++ b/consensus/tests/engine_v2_tests/reward_test.go @@ -59,7 +59,7 @@ func TestHookRewardV2(t *testing.T) { a, _ := big.NewInt(0).SetString("225000000000000000000", 10) assert.Zero(t, a.Cmp(r[owner])) b, _ := big.NewInt(0).SetString("25000000000000000000", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr])) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr])) } header2685 := blockchain.GetHeaderByNumber(config.XDPoS.Epoch*2 + 885) header2716 := blockchain.GetHeaderByNumber(config.XDPoS.Epoch*3 + 16) @@ -81,7 +81,7 @@ func TestHookRewardV2(t *testing.T) { a, _ := big.NewInt(0).SetString("225000000000000000000", 10) assert.Zero(t, a.Cmp(r[owner])) b, _ := big.NewInt(0).SetString("25000000000000000000", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr])) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr])) } // if no signing tx, then reward will be 0 header4499 := blockchain.GetHeaderByNumber(config.XDPoS.Epoch*5 - 1) @@ -151,14 +151,14 @@ func TestHookRewardV2SplitReward(t *testing.T) { a, _ := big.NewInt(0).SetString("149999999999999999999", 10) assert.Zero(t, a.Cmp(r[owner])) b, _ := big.NewInt(0).SetString("16666666666666666666", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr])) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr])) case signer: r := x.(map[common.Address]*big.Int) owner := parentState.GetCandidateOwner(addr) a, _ := big.NewInt(0).SetString("74999999999999999999", 10) assert.Zero(t, a.Cmp(r[owner])) b, _ := big.NewInt(0).SetString("8333333333333333333", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr])) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr])) default: assert.Fail(t, "wrong reward") } @@ -234,14 +234,14 @@ func TestHookRewardAfterUpgrade(t *testing.T) { a, _ := big.NewInt(0).SetString("450000000000000000000", 10) assert.Zero(t, a.Cmp(r[owner]), "real reward is", r[owner]) b, _ := big.NewInt(0).SetString("50000000000000000000", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr]), "real reward is", r[config.XDPoS.FoudationWalletAddr]) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr]), "real reward is", r[config.XDPoS.FoundationWalletAddr]) case signer: r := x.(map[common.Address]*big.Int) owner := parentState.GetCandidateOwner(addr) a, _ := big.NewInt(0).SetString("450000000000000000000", 10) assert.Zero(t, a.Cmp(r[owner]), "real reward is", r[owner]) b, _ := big.NewInt(0).SetString("50000000000000000000", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr]), "real reward is", r[config.XDPoS.FoudationWalletAddr]) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr]), "real reward is", r[config.XDPoS.FoundationWalletAddr]) default: assert.Fail(t, "wrong reward") } @@ -274,14 +274,14 @@ func TestHookRewardAfterUpgrade(t *testing.T) { a, _ := big.NewInt(0).SetString("360000000000000000000", 10) assert.Zero(t, a.Cmp(r[owner]), "real reward is", r[owner]) b, _ := big.NewInt(0).SetString("40000000000000000000", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr]), "real reward is", r[config.XDPoS.FoudationWalletAddr]) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr]), "real reward is", r[config.XDPoS.FoundationWalletAddr]) case protector2Addr: r := x.(map[common.Address]*big.Int) owner := parentState.GetCandidateOwner(addr) a, _ := big.NewInt(0).SetString("360000000000000000000", 10) assert.Zero(t, a.Cmp(r[owner]), "real reward is", r[owner]) b, _ := big.NewInt(0).SetString("40000000000000000000", 10) - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr]), "real reward is", r[config.XDPoS.FoudationWalletAddr]) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr]), "real reward is", r[config.XDPoS.FoundationWalletAddr]) default: assert.Fail(t, "wrong reward") } @@ -296,7 +296,7 @@ func TestHookRewardAfterUpgrade(t *testing.T) { a, _ := big.NewInt(0).SetString("270112500000000000000", 10) // this value tests the float64 reward assert.Zero(t, a.Cmp(r[owner]), "real reward is", r[owner]) b, _ := big.NewInt(0).SetString("30012500000000000000", 10) // this value tests the float64 reward - assert.Zero(t, b.Cmp(r[config.XDPoS.FoudationWalletAddr]), "real reward is", r[config.XDPoS.FoudationWalletAddr]) + assert.Zero(t, b.Cmp(r[config.XDPoS.FoundationWalletAddr]), "real reward is", r[config.XDPoS.FoundationWalletAddr]) } epochNum := uint64(3) totalMinted := statedb.GetPostMinted(epochNum).Big() diff --git a/contracts/validator/validator_test.go b/contracts/validator/validator_test.go index 4a48400e08..3bf9aee364 100644 --- a/contracts/validator/validator_test.go +++ b/contracts/validator/validator_test.go @@ -146,7 +146,7 @@ func TestRewardBalance(t *testing.T) { logCaps[i] = &logCap{accounts[randIndex].From.String(), randCap} } - foundationAddr := common.FoudationAddrBinary + foundationAddr := common.FoundationAddrBinary totalReward := new(big.Int).SetInt64(15 * 1000) rewards, err := GetRewardBalancesRate(foundationAddr, acc3Addr, totalReward, baseValidator) if err != nil { @@ -179,7 +179,7 @@ func TestRewardBalance(t *testing.T) { } } -func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common.Address, totalReward *big.Int, validator *contractValidator.XDCValidator) (map[common.Address]*big.Int, error) { +func GetRewardBalancesRate(foundationWalletAddr common.Address, masterAddr common.Address, totalReward *big.Int, validator *contractValidator.XDCValidator) (map[common.Address]*big.Int, error) { owner := GetCandidatesOwnerBySigner(validator, masterAddr) balances := make(map[common.Address]*big.Int) rewardMaster := new(big.Int).Mul(totalReward, new(big.Int).SetInt64(common.RewardMasterPercent)) @@ -226,9 +226,9 @@ func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common } } - foudationReward := new(big.Int).Mul(totalReward, new(big.Int).SetInt64(common.RewardFoundationPercent)) - foudationReward = new(big.Int).Div(foudationReward, new(big.Int).SetInt64(100)) - balances[foudationWalletAddr] = foudationReward + foundationReward := new(big.Int).Mul(totalReward, new(big.Int).SetInt64(common.RewardFoundationPercent)) + foundationReward = new(big.Int).Div(foundationReward, new(big.Int).SetInt64(100)) + balances[foundationWalletAddr] = foundationReward jsonHolders, err := json.Marshal(balances) if err != nil { diff --git a/docs/xdc/XDPoS/XDPoS.md b/docs/xdc/XDPoS/XDPoS.md index defeb98a7b..f9fbbfd520 100644 --- a/docs/xdc/XDPoS/XDPoS.md +++ b/docs/xdc/XDPoS/XDPoS.md @@ -535,7 +535,7 @@ Response: "reward": 5000, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65", + "foundationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65", "SkipV1Validation": false, "v2": { "switchBlock": 80370000, diff --git a/docs/xdc/admin/admin_nodeInfo_response.json b/docs/xdc/admin/admin_nodeInfo_response.json index 7393f75eb5..99a3e497e5 100644 --- a/docs/xdc/admin/admin_nodeInfo_response.json +++ b/docs/xdc/admin/admin_nodeInfo_response.json @@ -29,7 +29,7 @@ "reward": 5000, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65", + "foundationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65", "SkipV1Validation": false, "v2": { "SwitchEpoch": 89300, diff --git a/eth/api_backend.go b/eth/api_backend.go index d1de45afee..695091f9db 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -478,7 +478,7 @@ func (b *EthAPIBackend) GetVotersRewards(masternodeAddr common.Address) map[comm header := chain.CurrentBlock() number := header.Number.Uint64() engine := b.Engine().(*XDPoS.XDPoS) - foundationWalletAddr := chain.Config().XDPoS.FoudationWalletAddr + foundationWalletAddr := chain.Config().XDPoS.FoundationWalletAddr // calculate for 2 epochs ago currentCheckpointNumber, _, err := engine.GetCurrentEpochSwitchBlock(chain, header.Number) diff --git a/eth/hooks/engine_v1_hooks.go b/eth/hooks/engine_v1_hooks.go index e0ebf5a83d..c33e2eeec3 100644 --- a/eth/hooks/engine_v1_hooks.go +++ b/eth/hooks/engine_v1_hooks.go @@ -259,7 +259,7 @@ func AttachConsensusV1Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf adaptor.EngineV1.HookReward = func(chain consensus.ChainReader, stateBlock vm.StateDB, parentState *state.StateDB, header *types.Header) (map[string]interface{}, error) { number := header.Number.Uint64() rCheckpoint := chain.Config().XDPoS.RewardCheckpoint - foundationWalletAddr := chain.Config().XDPoS.FoudationWalletAddr + foundationWalletAddr := chain.Config().XDPoS.FoundationWalletAddr if foundationWalletAddr == (common.Address{}) { log.Error("Foundation Wallet Address is empty", "error", foundationWalletAddr) return nil, errors.New("foundation Wallet Address is empty") diff --git a/eth/hooks/engine_v2_hooks.go b/eth/hooks/engine_v2_hooks.go index c3003ccf8d..41a771ba60 100644 --- a/eth/hooks/engine_v2_hooks.go +++ b/eth/hooks/engine_v2_hooks.go @@ -268,7 +268,7 @@ func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf // Hook calculates reward for masternodes adaptor.EngineV2.HookReward = func(chain consensus.ChainReader, stateBlock vm.StateDB, parentState *state.StateDB, header *types.Header) (map[string]interface{}, error) { number := header.Number.Uint64() - foundationWalletAddr := chain.Config().XDPoS.FoudationWalletAddr + foundationWalletAddr := chain.Config().XDPoS.FoundationWalletAddr if foundationWalletAddr == (common.Address{}) { log.Error("Foundation Wallet Address is empty", "error", foundationWalletAddr) return nil, errors.New("foundation wallet address is empty") diff --git a/genesis/XDCxnet.json b/genesis/XDCxnet.json index 0589ae198b..961a049e46 100644 --- a/genesis/XDCxnet.json +++ b/genesis/XDCxnet.json @@ -13,7 +13,7 @@ "reward": 250, "rewardCheckpoint": 30, "gap": 10, - "foudationWalletAddr": "0x0000000000000000000000000000000000000068" + "foundationWalletAddr": "0x0000000000000000000000000000000000000068" } }, "nonce": "0x0", diff --git a/genesis/devnet.json b/genesis/devnet.json index 792b58c951..34ddeaf972 100644 --- a/genesis/devnet.json +++ b/genesis/devnet.json @@ -14,7 +14,7 @@ "reward": 10, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82", + "foundationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82", "SkipV1Validation": false, "v2": { "switchBlock": 0, diff --git a/genesis/mainnet.json b/genesis/mainnet.json index e7540bd00b..a77d4def96 100644 --- a/genesis/mainnet.json +++ b/genesis/mainnet.json @@ -13,7 +13,7 @@ "reward": 5000, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65" + "foundationWalletAddr": "xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65" } }, "nonce": "0x0", @@ -110,4 +110,4 @@ "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} \ No newline at end of file +} diff --git a/genesis/testnet.json b/genesis/testnet.json index 6f643f78e9..d55ec18e59 100644 --- a/genesis/testnet.json +++ b/genesis/testnet.json @@ -14,7 +14,7 @@ "reward": 5000, "rewardCheckpoint": 900, "gap": 450, - "foudationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c" + "foundationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c" } }, "nonce": "0x0", diff --git a/params/config.go b/params/config.go index 249efd895c..0ff0b1a346 100644 --- a/params/config.go +++ b/params/config.go @@ -234,12 +234,12 @@ var ( EIP158Block: big.NewInt(3), ByzantiumBlock: big.NewInt(4), XDPoS: &XDPoSConfig{ - Period: 2, - Epoch: 900, - Reward: 5000, - RewardCheckpoint: 900, - Gap: 450, - FoudationWalletAddr: common.HexToAddress("xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65"), + Period: 2, + Epoch: 900, + Reward: 5000, + RewardCheckpoint: 900, + Gap: 450, + FoundationWalletAddr: common.HexToAddress("xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65"), V2: &V2{ SwitchEpoch: common.MainnetConstant.TIPV2SwitchBlock.Uint64() / 900, SwitchBlock: common.MainnetConstant.TIPV2SwitchBlock, @@ -275,12 +275,12 @@ var ( ByzantiumBlock: big.NewInt(4), ConstantinopleBlock: nil, XDPoS: &XDPoSConfig{ - Period: 2, - Epoch: 900, - Reward: 5000, - RewardCheckpoint: 900, - Gap: 450, - FoudationWalletAddr: common.HexToAddress("xdc746249c61f5832c5eed53172776b460491bdcd5c"), + Period: 2, + Epoch: 900, + Reward: 5000, + RewardCheckpoint: 900, + Gap: 450, + FoundationWalletAddr: common.HexToAddress("xdc746249c61f5832c5eed53172776b460491bdcd5c"), V2: &V2{ SwitchEpoch: common.TestnetConstant.TIPV2SwitchBlock.Uint64() / 900, SwitchBlock: common.TestnetConstant.TIPV2SwitchBlock, @@ -299,12 +299,12 @@ var ( EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(0), XDPoS: &XDPoSConfig{ - Period: 2, - Epoch: 900, - Reward: 10, - RewardCheckpoint: 900, - Gap: 450, - FoudationWalletAddr: common.HexToAddress("0xde5b54e8e7b585153add32f472e8d545e5d42a82"), + Period: 2, + Epoch: 900, + Reward: 10, + RewardCheckpoint: 900, + Gap: 450, + FoundationWalletAddr: common.HexToAddress("0xde5b54e8e7b585153add32f472e8d545e5d42a82"), V2: &V2{ SwitchEpoch: common.DevnetConstant.TIPV2SwitchBlock.Uint64() / 900, SwitchBlock: common.DevnetConstant.TIPV2SwitchBlock, @@ -409,11 +409,11 @@ var ( Ethash: new(EthashConfig), Clique: nil, XDPoS: &XDPoSConfig{ - Epoch: 900, - Gap: 450, - SkipV1Validation: true, - FoudationWalletAddr: common.HexToAddress("0x0000000000000000000000000000000000000068"), - Reward: 250, + Epoch: 900, + Gap: 450, + SkipV1Validation: true, + FoundationWalletAddr: common.HexToAddress("0x0000000000000000000000000000000000000068"), + Reward: 250, V2: &V2{ SwitchEpoch: 1, SwitchBlock: big.NewInt(900), @@ -538,14 +538,14 @@ func (c *CliqueConfig) String() string { // XDPoSConfig is the consensus engine configs for delegated-proof-of-stake based sealing. type XDPoSConfig struct { - Period uint64 `json:"period"` // Number of seconds between blocks to enforce - Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint - Reward uint64 `json:"reward"` // Block reward - unit Ether - RewardCheckpoint uint64 `json:"rewardCheckpoint"` // Checkpoint block for calculate rewards. - Gap uint64 `json:"gap"` // Gap time preparing for the next epoch - FoudationWalletAddr common.Address `json:"foudationWalletAddr"` // Foundation Address Wallet - SkipV1Validation bool //Skip Block Validation for testing purpose, V1 consensus only - V2 *V2 `json:"v2"` + Period uint64 `json:"period"` // Number of seconds between blocks to enforce + Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint + Reward uint64 `json:"reward"` // Block reward - unit Ether + RewardCheckpoint uint64 `json:"rewardCheckpoint"` // Checkpoint block for calculate rewards. + Gap uint64 `json:"gap"` // Gap time preparing for the next epoch + FoundationWalletAddr common.Address `json:"foundationWalletAddr"` // Foundation Address Wallet + SkipV1Validation bool //Skip Block Validation for testing purpose, V1 consensus only + V2 *V2 `json:"v2"` } type V2 struct { @@ -612,8 +612,8 @@ func XDPoSConfigEqual(a, b *XDPoSConfig) bool { log.Warn("[XDPoSConfigEqual] Gap mismatch", "a.Gap", a.Gap, "b.Gap", b.Gap) return false } - if a.FoudationWalletAddr != b.FoudationWalletAddr { - log.Warn("[XDPoSConfigEqual] FoudationWalletAddr mismatch", "a.FoudationWalletAddr", a.FoudationWalletAddr.Hex(), "b.FoudationWalletAddr", b.FoudationWalletAddr.Hex()) + if a.FoundationWalletAddr != b.FoundationWalletAddr { + log.Warn("[XDPoSConfigEqual] FoundationWalletAddr mismatch", "a.FoundationWalletAddr", a.FoundationWalletAddr.Hex(), "b.FoundationWalletAddr", b.FoundationWalletAddr.Hex()) return false } if a.SkipV1Validation != b.SkipV1Validation { @@ -674,7 +674,7 @@ func (c *XDPoSConfig) String() string { return "XDPoSConfig: " } - return fmt.Sprintf("XDPoSConfig{Period: %v, Epoch: %v, Reward: %v, RewardCheckpoint: %v, Gap: %v, FoudationWalletAddr: %v, SkipV1Validation: %v, V2: %s}", c.Period, c.Epoch, c.Reward, c.RewardCheckpoint, c.Gap, c.FoudationWalletAddr.String0x(), c.SkipV1Validation, c.V2.String()) + return fmt.Sprintf("XDPoSConfig{Period: %v, Epoch: %v, Reward: %v, RewardCheckpoint: %v, Gap: %v, FoundationWalletAddr: %v, SkipV1Validation: %v, V2: %s}", c.Period, c.Epoch, c.Reward, c.RewardCheckpoint, c.Gap, c.FoundationWalletAddr.String0x(), c.SkipV1Validation, c.V2.String()) } // Description returns a human-readable description of XDPoSConfig @@ -691,7 +691,7 @@ func (c *XDPoSConfig) Description(indent int) string { banner += fmt.Sprintf("%s- Reward: %v\n", prefix, c.Reward) banner += fmt.Sprintf("%s- RewardCheckpoint: %v\n", prefix, c.RewardCheckpoint) banner += fmt.Sprintf("%s- Gap: %v\n", prefix, c.Gap) - banner += fmt.Sprintf("%s- FoudationWalletAddr: %v\n", prefix, c.FoudationWalletAddr.Hex()) + banner += fmt.Sprintf("%s- FoundationWalletAddr: %v\n", prefix, c.FoundationWalletAddr.Hex()) banner += fmt.Sprintf("%s- SkipV1Validation: %v\n", prefix, c.SkipV1Validation) banner += fmt.Sprintf("%s- %s", prefix, c.V2.Description(indent+2)) return banner