aboutsummaryrefslogtreecommitdiffstats
path: root/core/agreement.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-11 16:45:54 +0800
committerGitHub <noreply@github.com>2019-04-11 16:45:54 +0800
commit464e79e66f18679b8afb821f622ed1358100832d (patch)
tree4ae9c67625369c238e751186629b391cfdf8b4cc /core/agreement.go
parent5b0aad05d7ccc1dabedfd1f3bfc0d584db849e63 (diff)
downloaddexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.tar
dexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.tar.gz
dexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.tar.bz2
dexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.tar.lz
dexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.tar.xz
dexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.tar.zst
dexon-consensus-464e79e66f18679b8afb821f622ed1358100832d.zip
core: fix false alarm (#564)
* ignore test simple * core: update voteFilter to filter old er round * circleci: save logs * core: move check notarySet to agrmgr * fixup
Diffstat (limited to 'core/agreement.go')
-rw-r--r--core/agreement.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/agreement.go b/core/agreement.go
index a6fb074..cb46771 100644
--- a/core/agreement.go
+++ b/core/agreement.go
@@ -361,9 +361,6 @@ func (a *agreement) sanityCheck(vote *types.Vote) error {
if vote.Type >= types.MaxVoteType {
return ErrInvalidVote
}
- if _, exist := a.notarySet[vote.ProposerID]; !exist {
- return ErrNotInNotarySet
- }
ok, err := utils.VerifyVoteSignature(vote)
if err != nil {
return err
@@ -371,6 +368,10 @@ func (a *agreement) sanityCheck(vote *types.Vote) error {
if !ok {
return ErrIncorrectVoteSignature
}
+ if vote.Position.Round != a.agreementID().Round {
+ // TODO(jimmy): maybe we can verify partial signature at agreement-mgr.
+ return nil
+ }
if !a.data.recv.VerifyPartialSignature(vote) {
return ErrIncorrectVotePartialSignature
}
@@ -412,7 +413,7 @@ func (a *agreement) updateFilter(filter *utils.VoteFilter) {
filter.Confirm = a.hasOutput
filter.LockIter = a.data.lockIter
filter.Period = a.data.period
- filter.Height = a.agreementID().Height
+ filter.Position.Height = a.agreementID().Height
}
// processVote is the entry point for processing Vote.
@@ -426,8 +427,8 @@ func (a *agreement) processVote(vote *types.Vote) error {
// Agreement module has stopped.
if isStop(aID) {
- // Hacky way to not drop first votes for genesis height.
- if vote.Position.Height == types.GenesisHeight {
+ // Hacky way to not drop first votes when round just begins.
+ if vote.Position.Round == aID.Round {
a.pendingVote = append(a.pendingVote, pendingVote{
vote: vote,
receivedTime: time.Now().UTC(),