mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
fix(all): fix typo foudation (#2063)
This commit is contained in:
parent
5b8c6ef8fd
commit
2611f1dd9a
18 changed files with 71 additions and 71 deletions
|
|
@ -14,7 +14,7 @@
|
|||
"reward": 10,
|
||||
"rewardCheckpoint": 900,
|
||||
"gap": 450,
|
||||
"foudationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82",
|
||||
"foundationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82",
|
||||
"SkipV1Validation": false,
|
||||
"v2": {
|
||||
"switchBlock": 0,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"reward": 5000,
|
||||
"rewardCheckpoint": 900,
|
||||
"gap": 450,
|
||||
"foudationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c"
|
||||
"foundationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c"
|
||||
}
|
||||
},
|
||||
"nonce": "0x0",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ var testCases = []struct {
|
|||
{BlockSignersBinary, "xdc0000000000000000000000000000000000000089"},
|
||||
{MasternodeVotingSMCBinary, "xdc0000000000000000000000000000000000000088"},
|
||||
{RandomizeSMCBinary, "xdc0000000000000000000000000000000000000090"},
|
||||
{FoudationAddrBinary, "xdc0000000000000000000000000000000000000068"},
|
||||
{FoundationAddrBinary, "xdc0000000000000000000000000000000000000068"},
|
||||
{TeamAddrBinary, "xdc0000000000000000000000000000000000000099"},
|
||||
{XDCXAddrBinary, "xdc0000000000000000000000000000000000000091"},
|
||||
{TradingStateAddrBinary, "xdc0000000000000000000000000000000000000092"},
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ Response:
|
|||
"reward": 5000,
|
||||
"rewardCheckpoint": 900,
|
||||
"gap": 450,
|
||||
"foudationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65",
|
||||
"foundationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65",
|
||||
"SkipV1Validation": false,
|
||||
"v2": {
|
||||
"switchBlock": 80370000,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
"reward": 5000,
|
||||
"rewardCheckpoint": 900,
|
||||
"gap": 450,
|
||||
"foudationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65",
|
||||
"foundationWalletAddr": "0x92a289fe95a85c53b8d0d113cbaef0c1ec98ac65",
|
||||
"SkipV1Validation": false,
|
||||
"v2": {
|
||||
"SwitchEpoch": 89300,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
"reward": 250,
|
||||
"rewardCheckpoint": 30,
|
||||
"gap": 10,
|
||||
"foudationWalletAddr": "0x0000000000000000000000000000000000000068"
|
||||
"foundationWalletAddr": "0x0000000000000000000000000000000000000068"
|
||||
}
|
||||
},
|
||||
"nonce": "0x0",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"reward": 10,
|
||||
"rewardCheckpoint": 900,
|
||||
"gap": 450,
|
||||
"foudationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82",
|
||||
"foundationWalletAddr": "0xde5b54e8e7b585153add32f472e8d545e5d42a82",
|
||||
"SkipV1Validation": false,
|
||||
"v2": {
|
||||
"switchBlock": 0,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"reward": 5000,
|
||||
"rewardCheckpoint": 900,
|
||||
"gap": 450,
|
||||
"foudationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c"
|
||||
"foundationWalletAddr": "xdc746249c61f5832c5eed53172776b460491bdcd5c"
|
||||
}
|
||||
},
|
||||
"nonce": "0x0",
|
||||
|
|
|
|||
|
|
@ -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: <nil>"
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue