mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
all: fix typos, close XFN-23 (#1725)
This commit is contained in:
parent
891a386a58
commit
782a7ff5cb
10 changed files with 42 additions and 42 deletions
|
|
@ -75,40 +75,40 @@ type constant struct {
|
||||||
blacklist map[Address]struct{}
|
blacklist map[Address]struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// variables for specific networks, copy values from maintnet constant to pass tests
|
// variables for specific networks, copy values from mainnet constant to pass tests
|
||||||
var (
|
var (
|
||||||
BlackListHFNumber = MaintnetConstant.blackListHFNumber
|
BlackListHFNumber = MainnetConstant.blackListHFNumber
|
||||||
MaxMasternodesV2 = MaintnetConstant.maxMasternodesV2 // Last v1 masternodes
|
MaxMasternodesV2 = MainnetConstant.maxMasternodesV2 // Last v1 masternodes
|
||||||
|
|
||||||
TIP2019Block = MaintnetConstant.tip2019Block
|
TIP2019Block = MainnetConstant.tip2019Block
|
||||||
TIPSigning = MaintnetConstant.tipSigning
|
TIPSigning = MainnetConstant.tipSigning
|
||||||
TIPRandomize = MaintnetConstant.tipRandomize
|
TIPRandomize = MainnetConstant.tipRandomize
|
||||||
TIPNoHalvingMNReward = MaintnetConstant.tipNoHalvingMNReward
|
TIPNoHalvingMNReward = MainnetConstant.tipNoHalvingMNReward
|
||||||
TIPXDCX = MaintnetConstant.tipXDCX
|
TIPXDCX = MainnetConstant.tipXDCX
|
||||||
TIPXDCXLending = MaintnetConstant.tipXDCXLending
|
TIPXDCXLending = MainnetConstant.tipXDCXLending
|
||||||
TIPXDCXCancellationFee = MaintnetConstant.tipXDCXCancellationFee
|
TIPXDCXCancellationFee = MainnetConstant.tipXDCXCancellationFee
|
||||||
TIPTRC21Fee = MaintnetConstant.tipTRC21Fee
|
TIPTRC21Fee = MainnetConstant.tipTRC21Fee
|
||||||
TIPIncreaseMasternodes = MaintnetConstant.tipIncreaseMasternodes
|
TIPIncreaseMasternodes = MainnetConstant.tipIncreaseMasternodes
|
||||||
BerlinBlock = MaintnetConstant.berlinBlock
|
BerlinBlock = MainnetConstant.berlinBlock
|
||||||
LondonBlock = MaintnetConstant.londonBlock
|
LondonBlock = MainnetConstant.londonBlock
|
||||||
MergeBlock = MaintnetConstant.mergeBlock
|
MergeBlock = MainnetConstant.mergeBlock
|
||||||
ShanghaiBlock = MaintnetConstant.shanghaiBlock
|
ShanghaiBlock = MainnetConstant.shanghaiBlock
|
||||||
BlockNumberGas50x = MaintnetConstant.blockNumberGas50x
|
BlockNumberGas50x = MainnetConstant.blockNumberGas50x
|
||||||
TIPXDCXMinerDisable = MaintnetConstant.tipXDCXMinerDisable
|
TIPXDCXMinerDisable = MainnetConstant.tipXDCXMinerDisable
|
||||||
TIPXDCXReceiverDisable = MaintnetConstant.tipXDCXReceiverDisable
|
TIPXDCXReceiverDisable = MainnetConstant.tipXDCXReceiverDisable
|
||||||
Eip1559Block = MaintnetConstant.eip1559Block
|
Eip1559Block = MainnetConstant.eip1559Block
|
||||||
CancunBlock = MaintnetConstant.cancunBlock
|
CancunBlock = MainnetConstant.cancunBlock
|
||||||
TIPUpgradeReward = MaintnetConstant.tipUpgradeReward
|
TIPUpgradeReward = MainnetConstant.tipUpgradeReward
|
||||||
TipUpgradePenalty = MaintnetConstant.tipUpgradePenalty
|
TipUpgradePenalty = MainnetConstant.tipUpgradePenalty
|
||||||
TIPEpochHalving = MaintnetConstant.tipEpochHalving
|
TIPEpochHalving = MainnetConstant.tipEpochHalving
|
||||||
|
|
||||||
TRC21IssuerSMC = MaintnetConstant.trc21IssuerSMC
|
TRC21IssuerSMC = MainnetConstant.trc21IssuerSMC
|
||||||
XDCXListingSMC = MaintnetConstant.xdcxListingSMC
|
XDCXListingSMC = MainnetConstant.xdcxListingSMC
|
||||||
RelayerRegistrationSMC = MaintnetConstant.relayerRegistrationSMC
|
RelayerRegistrationSMC = MainnetConstant.relayerRegistrationSMC
|
||||||
LendingRegistrationSMC = MaintnetConstant.lendingRegistrationSMC
|
LendingRegistrationSMC = MainnetConstant.lendingRegistrationSMC
|
||||||
|
|
||||||
ignoreSignerCheckBlockArray = MaintnetConstant.ignoreSignerCheckBlockArray
|
ignoreSignerCheckBlockArray = MainnetConstant.ignoreSignerCheckBlockArray
|
||||||
blacklist = MaintnetConstant.blacklist
|
blacklist = MainnetConstant.blacklist
|
||||||
)
|
)
|
||||||
|
|
||||||
func IsIgnoreSignerCheckBlock(blockNumber uint64) bool {
|
func IsIgnoreSignerCheckBlock(blockNumber uint64) bool {
|
||||||
|
|
@ -129,7 +129,7 @@ func IsInBlacklist(address *Address) bool {
|
||||||
func CopyConstants(chainID uint64) {
|
func CopyConstants(chainID uint64) {
|
||||||
var c *constant
|
var c *constant
|
||||||
switch chainID {
|
switch chainID {
|
||||||
case MaintnetConstant.chainID:
|
case MainnetConstant.chainID:
|
||||||
return
|
return
|
||||||
case TestnetConstant.chainID:
|
case TestnetConstant.chainID:
|
||||||
c = &TestnetConstant
|
c = &TestnetConstant
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
)
|
)
|
||||||
|
|
||||||
var MaintnetConstant = constant{
|
var MainnetConstant = constant{
|
||||||
chainID: 50,
|
chainID: 50,
|
||||||
blackListHFNumber: 38383838,
|
blackListHFNumber: 38383838,
|
||||||
maxMasternodesV2: 108,
|
maxMasternodesV2: 108,
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,7 @@ func (x *XDPoS_v2) hygieneVotePool() {
|
||||||
}
|
}
|
||||||
// Clean up any votes round that is 10 rounds older
|
// Clean up any votes round that is 10 rounds older
|
||||||
if keyedRound < int64(round)-utils.PoolHygieneRound {
|
if keyedRound < int64(round)-utils.PoolHygieneRound {
|
||||||
log.Debug("[hygieneVotePool] Cleaned vote poll at round", "Round", keyedRound, "currentRound", round, "Key", k)
|
log.Debug("[hygieneVotePool] Cleaned vote pool at round", "Round", keyedRound, "currentRound", round, "Key", k)
|
||||||
x.votePool.ClearByPoolKey(k)
|
x.votePool.ClearByPoolKey(k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// ErrBadProDAOExtra is returned if a header doens't support the DAO fork on a
|
// ErrBadProDAOExtra is returned if a header doesn't support the DAO fork on a
|
||||||
// pro-fork client.
|
// pro-fork client.
|
||||||
ErrBadProDAOExtra = errors.New("bad DAO pro-fork extra-data")
|
ErrBadProDAOExtra = errors.New("bad DAO pro-fork extra-data")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ func newTxJournal(path string) *journal {
|
||||||
// load parses a transaction journal dump from disk, loading its contents into
|
// load parses a transaction journal dump from disk, loading its contents into
|
||||||
// the specified pool.
|
// the specified pool.
|
||||||
func (journal *journal) load(add func([]*types.Transaction) []error) error {
|
func (journal *journal) load(add func([]*types.Transaction) []error) error {
|
||||||
// Skip the parsing if the journal file doens't exist at all
|
// Skip the parsing if the journal file doesn't exist at all
|
||||||
if !common.FileExist(journal.path) {
|
if !common.FileExist(journal.path) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ func newLendingTxJournal(path string) *lendingtxJournal {
|
||||||
// load parses a transaction journal dump from disk, loading its contents into
|
// load parses a transaction journal dump from disk, loading its contents into
|
||||||
// the specified pool.
|
// the specified pool.
|
||||||
func (journal *lendingtxJournal) load(add func(*types.LendingTransaction) error) error {
|
func (journal *lendingtxJournal) load(add func(*types.LendingTransaction) error) error {
|
||||||
// Skip the parsing if the journal file doens't exist at all
|
// Skip the parsing if the journal file doesn't exist at all
|
||||||
if !common.FileExist(journal.path) {
|
if !common.FileExist(journal.path) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -495,7 +495,7 @@ func (h *priceHeap) Pop() interface{} {
|
||||||
}
|
}
|
||||||
|
|
||||||
// pricedList is a price-sorted heap to allow operating on transactions pool
|
// pricedList is a price-sorted heap to allow operating on transactions pool
|
||||||
// contents in a price-incrementing way. It's built opon the all transactions
|
// contents in a price-incrementing way. It's built upon all transactions
|
||||||
// in txpool but only interested in the remote part. It means only remote transactions
|
// in txpool but only interested in the remote part. It means only remote transactions
|
||||||
// will be considered for tracking, sorting, eviction, etc.
|
// will be considered for tracking, sorting, eviction, etc.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ func newOrderTxJournal(path string) *ordertxJournal {
|
||||||
// load parses a transaction journal dump from disk, loading its contents into
|
// load parses a transaction journal dump from disk, loading its contents into
|
||||||
// the specified pool.
|
// the specified pool.
|
||||||
func (journal *ordertxJournal) load(add func(*types.OrderTransaction) error) error {
|
func (journal *ordertxJournal) load(add func(*types.OrderTransaction) error) error {
|
||||||
// Skip the parsing if the journal file doens't exist at all
|
// Skip the parsing if the journal file doesn't exist at all
|
||||||
if !common.FileExist(journal.path) {
|
if !common.FileExist(journal.path) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -469,13 +469,13 @@ func recoverPlain(sighash common.Hash, R, S, Vb *big.Int, homestead bool) (commo
|
||||||
if !crypto.ValidateSignatureValues(V, R, S, homestead) {
|
if !crypto.ValidateSignatureValues(V, R, S, homestead) {
|
||||||
return common.Address{}, ErrInvalidSig
|
return common.Address{}, ErrInvalidSig
|
||||||
}
|
}
|
||||||
// encode the snature in uncompressed format
|
// encode the signature in uncompressed format
|
||||||
r, s := R.Bytes(), S.Bytes()
|
r, s := R.Bytes(), S.Bytes()
|
||||||
sig := make([]byte, crypto.SignatureLength)
|
sig := make([]byte, crypto.SignatureLength)
|
||||||
copy(sig[32-len(r):32], r)
|
copy(sig[32-len(r):32], r)
|
||||||
copy(sig[64-len(s):64], s)
|
copy(sig[64-len(s):64], s)
|
||||||
sig[64] = V
|
sig[64] = V
|
||||||
// recover the public key from the snature
|
// recover the public key from the signature
|
||||||
pub, err := crypto.Ecrecover(sighash[:], sig)
|
pub, err := crypto.Ecrecover(sighash[:], sig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return common.Address{}, err
|
return common.Address{}, err
|
||||||
|
|
|
||||||
|
|
@ -240,8 +240,8 @@ var (
|
||||||
Gap: 450,
|
Gap: 450,
|
||||||
FoudationWalletAddr: common.HexToAddress("xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65"),
|
FoudationWalletAddr: common.HexToAddress("xdc92a289fe95a85c53b8d0d113cbaef0c1ec98ac65"),
|
||||||
V2: &V2{
|
V2: &V2{
|
||||||
SwitchEpoch: common.MaintnetConstant.TIPV2SwitchBlock.Uint64() / 900,
|
SwitchEpoch: common.MainnetConstant.TIPV2SwitchBlock.Uint64() / 900,
|
||||||
SwitchBlock: common.MaintnetConstant.TIPV2SwitchBlock,
|
SwitchBlock: common.MainnetConstant.TIPV2SwitchBlock,
|
||||||
CurrentConfig: MainnetV2Configs[0],
|
CurrentConfig: MainnetV2Configs[0],
|
||||||
AllConfigs: MainnetV2Configs,
|
AllConfigs: MainnetV2Configs,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue