diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index a9ddfb7e76..c16e04c179 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1103,7 +1103,7 @@ func (p *Parlia) assembleVoteAttestation(chain consensus.ChainHeaderReader, head // Validate vote data consistency for _, vote := range votes { if vote.Data.Hash() != attestation.Data.Hash() { - return fmt.Errorf("vote check error, expected: %v, real: %v", attestation.Data, vote) + return fmt.Errorf("vote check error, expected: %v, real: %v", attestation.Data, vote.Data) } } // Prepare aggregated vote signature @@ -1754,7 +1754,7 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res if err != nil { /* If the vote attestation can't be assembled successfully, the blockchain won't get fast finalized, but it can be tolerated, so just report this error here. */ - log.Error("Assemble vote attestation failed when sealing", "err", err) + log.Debug("Assemble vote attestation failed when sealing", "err", err) } // Sign all the things! diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index 587116f2e2..ecabc62a56 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -207,14 +207,16 @@ func (s *Snapshot) updateAttestation(header *types.Header, chainConfig *params.C } // Headers with bad attestation are accepted before Plato upgrade, - // but Attestation of snapshot is only updated when the target block is direct parent of the header - targetNumber := attestation.Data.TargetNumber - targetHash := attestation.Data.TargetHash - if targetHash != header.ParentHash || targetNumber+1 != header.Number.Uint64() { - log.Warn("updateAttestation failed", "error", fmt.Errorf("invalid attestation, target mismatch, expected block: %d, hash: %s; real block: %d, hash: %s", - header.Number.Uint64()-1, header.ParentHash, targetNumber, targetHash)) - updateAttestationErrorCounter.Inc(1) - return + // but Attestation of snapshot is only updated when the target block is direct parent of the header before Fermi upgrade + if !chainConfig.IsFermi(header.Number, header.Time) { + targetNumber := attestation.Data.TargetNumber + targetHash := attestation.Data.TargetHash + if targetHash != header.ParentHash || targetNumber+1 != header.Number.Uint64() { + log.Warn("updateAttestation failed", "error", fmt.Errorf("invalid attestation, target mismatch, expected block: %d, hash: %s; real block: %d, hash: %s", + header.Number.Uint64()-1, header.ParentHash, targetNumber, targetHash)) + updateAttestationErrorCounter.Inc(1) + return + } } // Update attestation