evidence: improve amnesia evidence handling (#5003)

fix bug so that PotentialAmnesiaEvidence is being gossiped

handle inbound amnesia evidence correctly

add method to check if potential amnesia evidence is on trial

fix a bug with the height when we upgrade to amnesia evidence

change evidence to using just pointers.

More logging in the evidence module

Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
Callum Waters
2020-06-23 17:09:14 +02:00
committed by GitHub
parent 44b306b38e
commit 65d7ce9c9c
15 changed files with 833 additions and 544 deletions

View File

@@ -710,13 +710,12 @@ func TestStateLockPOLUnlock(t *testing.T) {
// polc should be in the evpool for round 1
polc, err := evpool.RetrievePOLC(height, round)
assert.NoError(t, err)
assert.NotNil(t, polc)
assert.False(t, polc.IsAbsent())
t.Log(polc.Address())
// but not for round 0
polc, err = evpool.RetrievePOLC(height, round-1)
assert.Error(t, err)
assert.True(t, polc.IsAbsent())
assert.NoError(t, err)
assert.Nil(t, polc)
}
// 4 vals, v1 locks on proposed block in the first round but the other validators only prevote
@@ -820,6 +819,7 @@ func TestStateLockPOLUnlockOnUnknownBlock(t *testing.T) {
// polc should be in the evpool for round 1
polc, err := evpool.RetrievePOLC(height, round)
assert.NoError(t, err)
assert.NotNil(t, polc)
assert.False(t, polc.IsAbsent())
incrementRound(vs2, vs3, vs4)