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:
kasey
2025-04-10 16:19:08 -05:00
committed by GitHub
parent ac0ea13dbe
commit e47a4e1d56
10 changed files with 161 additions and 121 deletions

View File

@@ -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))
}