Mainnet debug (#655)

* intro new timeout (#651)

* intro new timeout

* correct comment

* disable ProcessForensics

* disable ProcessForensics

* change version

* enable periodicProfilingFlag

* fix: ignore old timeout msg

* fix: ignore old timeout msg including equal to the current round

* udpate version file
This commit is contained in:
Liam 2024-09-30 20:05:14 -07:00 committed by GitHub
parent 3fb1a015e0
commit 9751e41dd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 18 additions and 3 deletions

View file

@ -654,6 +654,10 @@ func (x *XDPoS_v2) VoteHandler(chain consensus.ChainReader, voteMsg *types.Vote)
3. Broadcast(Not part of consensus)
*/
func (x *XDPoS_v2) VerifyTimeoutMessage(chain consensus.ChainReader, timeoutMsg *types.Timeout) (bool, error) {
if timeoutMsg.Round <= x.currentRound {
log.Debug("[VerifyTimeoutMessage] Disqualified timeout message as the proposed round does not match currentRound", "timeoutHash", timeoutMsg.Hash(), "timeoutRound", timeoutMsg.Round, "currentRound", x.currentRound)
return false, nil
}
snap, err := x.getSnapshot(chain, timeoutMsg.GapNumber, true)
if err != nil || snap == nil {
log.Error("[VerifyTimeoutMessage] Fail to get snapshot when verifying timeout message!", "messageGapNumber", timeoutMsg.GapNumber, "err", err)

View file

@ -86,6 +86,7 @@ Forensics runs in a seperate go routine as its no system critical
Link to the flow diagram: https://hashlabs.atlassian.net/wiki/spaces/HASHLABS/pages/97878029/Forensics+Diagram+flow
*/
func (f *Forensics) ProcessForensics(chain consensus.ChainReader, engine *XDPoS_v2, incomingQC types.QuorumCert) error {
return nil
log.Debug("Received a QC in forensics", "QC", incomingQC)
// Clone the values to a temporary variable
highestCommittedQCs := f.HighestCommittedQCs
@ -393,6 +394,7 @@ Forensics runs in a seperate go routine as its no system critical
Link to the flow diagram: https://hashlabs.atlassian.net/wiki/spaces/HASHLABS/pages/99516417/Vote+Equivocation+detection+specification
*/
func (f *Forensics) ProcessVoteEquivocation(chain consensus.ChainReader, engine *XDPoS_v2, incomingVote *types.Vote) error {
return nil
log.Debug("Received a vote in forensics", "vote", incomingVote)
// Clone the values to a temporary variable
highestCommittedQCs := f.HighestCommittedQCs
@ -483,6 +485,7 @@ func (f *Forensics) isVoteBlamed(chain consensus.ChainReader, highestCommittedQC
}
func (f *Forensics) DetectEquivocationInVotePool(vote *types.Vote, votePool *utils.Pool) {
return
poolKey := vote.PoolKey()
votePoolKeys := votePool.PoolObjKeysList()
signer, err := GetVoteSignerAddresses(vote)

View file

@ -77,7 +77,7 @@ type peer struct {
knownVote mapset.Set // Set of BFT Vote known to be known by this peer
knownTimeout mapset.Set // Set of BFT timeout known to be known by this peer
knownSyncInfo mapset.Set // Set of BFT Sync Info known to be known by this peer`
knownSyncInfo mapset.Set // Set of BFT Sync Info known to be known by this peer
}
func newPeer(version int, p *p2p.Peer, rw p2p.MsgReadWriter) *peer {

View file

@ -106,7 +106,7 @@ var Flags = []cli.Flag{
//blockprofilerateFlag,
cpuprofileFlag,
//traceFlag,
//periodicProfilingFlag,
periodicProfilingFlag,
debugDataDirFlag,
}

View file

@ -48,6 +48,14 @@ var (
TimeoutPeriod: 30,
MinePeriod: 2,
},
2000: {
MaxMasternodes: 108,
SwitchRound: 2000,
CertThreshold: 0.667,
TimeoutSyncThreshold: 2,
TimeoutPeriod: 600,
MinePeriod: 2,
},
}
TestnetV2Configs = map[uint64]*V2Config{

View file

@ -22,7 +22,7 @@ import (
const (
VersionMajor = 2 // Major version component of the current release
VersionMinor = 0 // Minor version component of the current release
VersionMinor = 2 // Minor version component of the current release
VersionPatch = 0 // Patch version component of the current release
VersionMeta = "stable" // Version metadata to append to the version string
)