diff --git a/consensus/XDPoS/engines/engine_v2/timeout.go b/consensus/XDPoS/engines/engine_v2/timeout.go index 61f8e52ca0..15f030cdd9 100644 --- a/consensus/XDPoS/engines/engine_v2/timeout.go +++ b/consensus/XDPoS/engines/engine_v2/timeout.go @@ -108,11 +108,11 @@ func (x *XDPoS_v2) onTimeoutPoolThresholdReached(blockChainReader consensus.Chai // Process TC err := x.processTC(blockChainReader, timeoutCert) 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 } - 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 } diff --git a/consensus/XDPoS/engines/engine_v2/verifyHeader.go b/consensus/XDPoS/engines/engine_v2/verifyHeader.go index adbefd3b28..12799c56e9 100644 --- a/consensus/XDPoS/engines/engine_v2/verifyHeader.go +++ b/consensus/XDPoS/engines/engine_v2/verifyHeader.go @@ -104,7 +104,7 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade if header.MixDigest != (common.Hash{}) { 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 { return utils.ErrInvalidUncleHash } diff --git a/consensus/XDPoS/utils/pool.go b/consensus/XDPoS/utils/pool.go index 2e3ea31b4f..57f6b93a0f 100644 --- a/consensus/XDPoS/utils/pool.go +++ b/consensus/XDPoS/utils/pool.go @@ -39,6 +39,8 @@ func (p *Pool) Get() map[string]map[common.Hash]PoolObj { 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) { p.lock.Lock() defer p.lock.Unlock() diff --git a/params/protocol_params.go b/params/protocol_params.go index b119c98a08..364b6efd33 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -19,8 +19,8 @@ package params import "math/big" var ( - TargetGasLimit uint64 = XDCGenesisGasLimit // The artificial target - V2TestsGasLimit uint64 = 1200000000 // The gas limit used in the v2 consensus tests + TargetGasLimit uint64 = XDCGenesisGasLimit // The artificial target + V2TestsGasLimit uint64 = 1200000000 // The gas limit used in the v2 consensus tests ) const ( @@ -39,7 +39,7 @@ const ( 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. 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. 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. 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. - 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. CallGas uint64 = 40 // Once per CALL operation & message call transaction. CreateDataGas uint64 = 200 //