mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Penalize peers for bad rpc data in range sync (#15149)
* Penalize peers for bad rpc data in range sync * gofmt --------- Co-authored-by: Kasey <kasey@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package blockchain
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/OffchainLabs/prysm/v6/beacon-chain/verification"
|
||||
"github.com/OffchainLabs/prysm/v6/testing/require"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@@ -42,3 +43,8 @@ func TestInvalidRoots(t *testing.T) {
|
||||
require.Equal(t, [32]byte{'a'}, InvalidBlockRoot(newErr))
|
||||
require.DeepEqual(t, roots, InvalidAncestorRoots(newErr))
|
||||
}
|
||||
|
||||
func TestInvalidRecognition(t *testing.T) {
|
||||
err := invalidBlock{error: errors.New("test"), root: [32]byte{}}
|
||||
require.Equal(t, true, errors.Is(err, verification.ErrInvalid))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user