-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consensus epoch number fix #1832
consensus epoch number fix #1832
Conversation
# Conflicts: # process/peer/export_test.go
# Conflicts: # process/peer/export_test.go
…m/ElrondNetwork/elrond-go into EN-6511-consensus-epoch-incorrect
…t' into EN-6511-consensus-epoch-incorrect
} | ||
|
||
// DecreaseLeaderSuccessRate - | ||
func (p *PeerAccountHandlerMock) DecreaseLeaderSuccessRate(val uint32) { | ||
if p.DecreaseLeaderSuccessRateCalled != nil { | ||
p.DecreaseLeaderSuccessRateCalled(val) | ||
} | ||
p.DecreaseLeaderSuccessRateValue += val | ||
} | ||
|
||
// IncreaseValidatorSuccessRate - | ||
func (p *PeerAccountHandlerMock) IncreaseValidatorSuccessRate(val uint32) { | ||
if p.IncreaseValidatorSuccessRateCalled != nil { | ||
p.IncreaseValidatorSuccessRateCalled(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be added return ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, no need for the += afterwards
} | ||
p.IncreaseLeaderSuccessRateValue += val | ||
} | ||
|
||
// DecreaseLeaderSuccessRate - | ||
func (p *PeerAccountHandlerMock) DecreaseLeaderSuccessRate(val uint32) { | ||
if p.DecreaseLeaderSuccessRateCalled != nil { | ||
p.DecreaseLeaderSuccessRateCalled(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be added return ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
|
||
// IncreaseValidatorSuccessRate - | ||
func (p *PeerAccountHandlerMock) IncreaseValidatorSuccessRate(val uint32) { | ||
if p.IncreaseValidatorSuccessRateCalled != nil { | ||
p.IncreaseValidatorSuccessRateCalled(val) | ||
} | ||
p.IncreaseValidatorSuccessRateValue += val | ||
} | ||
|
||
// DecreaseValidatorSuccessRate - | ||
func (p *PeerAccountHandlerMock) DecreaseValidatorSuccessRate(val uint32) { | ||
if p.DecreaseValidatorSuccessRateCalled != nil { | ||
p.DecreaseValidatorSuccessRateCalled(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be added return ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
process/peer/process.go
Outdated
// TODO: change if start of epoch block needs to be validated by the new epoch nodes | ||
// previous block was proposed by the consensus group of the previous epoch | ||
epoch := header.GetEpoch() | ||
if (header.IsStartOfEpochBlock()) && epoch > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for open-close ()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
process/peer/process.go
Outdated
if !ok { | ||
return fmt.Errorf("%w - updateShardDataPeerState header from cache - hash: %s, round: %v, nonce: %v", | ||
process.ErrMissingHeader, | ||
hex.EncodeToString(h.GetPrevHash()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h.HeaderHash ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -596,6 +598,535 @@ func TestValidatorStatisticsProcessor_UpdatePeerStateCallsIncrease(t *testing.T) | |||
assert.True(t, increaseValidatorCalled) | |||
} | |||
|
|||
func TestValidatorStatisticsProcessor_UpdatePeerState_IncreasesConsensusPreviousMetaBlock_SameEpoch(t *testing.T) { | |||
t.Parallel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty line after each t.Parallel() in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
The base branch was changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.
computation of the consensus group for the start of epoch block was computed with the current epoch not the previous epoch