mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
consensus/XDPoS, params: fix some comments, close XFN-125 (#1733)
This commit is contained in:
parent
f24e68b015
commit
650047c81e
4 changed files with 9 additions and 7 deletions
|
|
@ -108,11 +108,11 @@ func (x *XDPoS_v2) onTimeoutPoolThresholdReached(blockChainReader consensus.Chai
|
||||||
// Process TC
|
// Process TC
|
||||||
err := x.processTC(blockChainReader, timeoutCert)
|
err := x.processTC(blockChainReader, timeoutCert)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("[onTimeoutPoolThresholdReached] Error while processing TC in the Timeout handler after reaching pool threshold", "TcRound", timeoutCert.Round, "NumberOfTcSig", len(timeoutCert.Signatures), "GapNumber", gapNumber, "Error", err)
|
log.Error("[onTimeoutPoolThresholdReached] Fail to process TC", "TcRound", timeoutCert.Round, "NumberOfTcSig", len(timeoutCert.Signatures), "GapNumber", gapNumber, "Error", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("[onTimeoutPoolThresholdReached] Successfully processed the timeout message and produced TC!", "TcRound", timeoutCert.Round, "NumberOfTcSig", len(timeoutCert.Signatures))
|
log.Info("[onTimeoutPoolThresholdReached] process TC successfully", "TcRound", timeoutCert.Round, "NumberOfTcSig", len(timeoutCert.Signatures))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
|
||||||
if header.MixDigest != (common.Hash{}) {
|
if header.MixDigest != (common.Hash{}) {
|
||||||
return utils.ErrInvalidMixDigest
|
return utils.ErrInvalidMixDigest
|
||||||
}
|
}
|
||||||
// Ensure that the block doesn't contain any uncles which are meaningless in XDPoS_v1
|
// Ensure that the block doesn't contain any uncles which are meaningless in XDPoS_v2.
|
||||||
if header.UncleHash != utils.UncleHash {
|
if header.UncleHash != utils.UncleHash {
|
||||||
return utils.ErrInvalidUncleHash
|
return utils.ErrInvalidUncleHash
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ func (p *Pool) Get() map[string]map[common.Hash]PoolObj {
|
||||||
return dataCopy
|
return dataCopy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add adds the object to the pool, returns the number of items
|
||||||
|
// and the map of objects under the same pool key
|
||||||
func (p *Pool) Add(obj PoolObj) (int, map[common.Hash]PoolObj) {
|
func (p *Pool) Add(obj PoolObj) (int, map[common.Hash]PoolObj) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
defer p.lock.Unlock()
|
defer p.lock.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ package params
|
||||||
import "math/big"
|
import "math/big"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
TargetGasLimit uint64 = XDCGenesisGasLimit // The artificial target
|
TargetGasLimit uint64 = XDCGenesisGasLimit // The artificial target
|
||||||
V2TestsGasLimit uint64 = 1200000000 // The gas limit used in the v2 consensus tests
|
V2TestsGasLimit uint64 = 1200000000 // The gas limit used in the v2 consensus tests
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -39,7 +39,7 @@ const (
|
||||||
TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
|
TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
|
||||||
TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
|
TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
|
||||||
QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation.
|
QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation.
|
||||||
SstoreSetGas uint64 = 20000 // Once per SLOAD operation.
|
SstoreSetGas uint64 = 20000 // Once per SSTORE operation.
|
||||||
LogDataGas uint64 = 8 // Per byte in a LOG* operation's data.
|
LogDataGas uint64 = 8 // Per byte in a LOG* operation's data.
|
||||||
CallStipend uint64 = 2300 // Free gas given at beginning of call.
|
CallStipend uint64 = 2300 // Free gas given at beginning of call.
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ const (
|
||||||
SstoreResetGas uint64 = 5000 // Once per SSTORE operation if the zeroness changes from zero.
|
SstoreResetGas uint64 = 5000 // Once per SSTORE operation if the zeroness changes from zero.
|
||||||
SstoreClearGas uint64 = 5000 // Once per SSTORE operation if the zeroness doesn't change.
|
SstoreClearGas uint64 = 5000 // Once per SSTORE operation if the zeroness doesn't change.
|
||||||
SstoreRefundGas uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.
|
SstoreRefundGas uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.
|
||||||
JumpdestGas uint64 = 1 // Refunded gas, once per SSTORE operation if the zeroness changes to zero.
|
JumpdestGas uint64 = 1 // Once per JUMPDEST operation.
|
||||||
EpochDuration uint64 = 30000 // Duration between proof-of-work epochs.
|
EpochDuration uint64 = 30000 // Duration between proof-of-work epochs.
|
||||||
CallGas uint64 = 40 // Once per CALL operation & message call transaction.
|
CallGas uint64 = 40 // Once per CALL operation & message call transaction.
|
||||||
CreateDataGas uint64 = 200 //
|
CreateDataGas uint64 = 200 //
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue