Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sei-ibc-go/modules/core/02-client/keeper/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ func (suite *KeeperTestSuite) TestCheckMisbehaviourAndUpdateState() {
altValSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{altVal})

// Create signer array and ensure it is in same order as bothValSet
_, suiteVal := suite.valSet.GetByIndex(0)
_, suiteVal, ok := suite.valSet.GetByIndex(0)
suite.Require().True(ok)
bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal)

altSigners := []tmtypes.PrivValidator{altPrivVal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func (suite *TendermintTestSuite) TestCheckMisbehaviourAndUpdateState() {
// Create alternative validator set with only altVal
altValSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{altVal})

_, suiteVal := suite.valSet.GetByIndex(0)
_, suiteVal, ok := suite.valSet.GetByIndex(0)
suite.Require().True(ok)

// Create signer array and ensure it is in same order as bothValSet
bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func (suite *TendermintTestSuite) TestMisbehaviourValidateBasic() {
signers := []tmtypes.PrivValidator{suite.privVal}

// Create signer array and ensure it is in same order as bothValSet
_, suiteVal := suite.valSet.GetByIndex(0)
_, suiteVal, ok := suite.valSet.GetByIndex(0)
suite.Require().True(ok)
bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal)

altSigners := []tmtypes.PrivValidator{altPrivVal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func getBothSigners(suite *TendermintTestSuite, altVal *tmtypes.Validator, altPr
// Create bothValSet with both suite validator and altVal. Would be valid update
bothValSet := tmtypes.NewValidatorSet(append(suite.valSet.Validators, altVal))
// Create signer array and ensure it is in same order as bothValSet
_, suiteVal := suite.valSet.GetByIndex(0)
_, suiteVal, ok := suite.valSet.GetByIndex(0)
suite.Require().True(ok)
bothSigners := ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal)
return bothValSet, bothSigners
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ func (suite *TendermintTestSuite) TestCheckHeaderAndUpdateState() {
signers = []tmtypes.PrivValidator{suite.privVal}

// Create signer array and ensure it is in same order as bothValSet
_, suiteVal := suite.valSet.GetByIndex(0)
_, suiteVal, ok := suite.valSet.GetByIndex(0)
suite.Require().True(ok)
bothSigners = ibctesting.CreateSortedSignerArray(altPrivVal, suite.privVal, altVal, suiteVal)

consStateHeight = height // must be explicitly changed
Expand Down
2 changes: 1 addition & 1 deletion sei-ibc-go/testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64,
ChainID: chainID,
Height: blockHeight,
Time: timestamp,
LastBlockID: MakeBlockID(make([]byte, tmhash.Size), 10_000, make([]byte, tmhash.Size)),
LastBlockID: MakeBlockID(make([]byte, tmhash.Size), tmtypes.MaxBlockPartsCount, make([]byte, tmhash.Size)),
LastCommitHash: chain.App.LastCommitID().Hash,
DataHash: tmhash.Sum([]byte("data_hash")),
ValidatorsHash: vsetHash,
Expand Down
12 changes: 6 additions & 6 deletions sei-tendermint/internal/consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ func validatePrevote(

address := pubKey.Address()

vote := prevotes.GetByAddress(address)
require.NotNil(t, vote, "Failed to find prevote from validator")
vote, ok := prevotes.GetByAddress(address)
require.True(t, ok, "Failed to find prevote from validator")

if blockHash == nil {
require.Nil(t, vote.BlockID.Hash, "Expected prevote to be for nil, got %X", vote.BlockID.Hash)
Expand All @@ -320,8 +320,8 @@ func validateLastPrecommit(ctx context.Context, t *testing.T, cs *State, privVal
require.NoError(t, err)
address := pv.Address()

vote := votes.GetByAddress(address)
require.NotNil(t, vote)
vote, ok := votes.GetByAddress(address)
require.True(t, ok)

require.True(t, bytes.Equal(vote.BlockID.Hash, blockHash),
"Expected precommit to be for %X, got %X", blockHash, vote.BlockID.Hash)
Expand All @@ -344,8 +344,8 @@ func validatePrecommit(
require.NoError(t, err)
address := pv.Address()

vote := precommits.GetByAddress(address)
require.NotNil(t, vote, "Failed to find precommit from validator")
vote, ok := precommits.GetByAddress(address)
require.True(t, ok, "Failed to find precommit from validator")

if votedBlockHash == nil {
require.Nil(t, vote.BlockID.Hash, "Expected precommit to be for nil")
Expand Down
148 changes: 147 additions & 1 deletion sei-tendermint/internal/consensus/invalid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

<<<<<<< HEAD

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Compile with Mock Balances

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Linux AMD64

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Run ETH Blocktests 3

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Run ETH Blocktests 0

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Run ETH Blocktests 2

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / macOS ARM64

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Run ETH Blocktests 4

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Run ETH Blocktests 1

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path

Check failure on line 13 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Test sei-chain

missing import path
"github.com/tendermint/tendermint/internal/eventbus"
"github.com/tendermint/tendermint/internal/p2p"
"github.com/tendermint/tendermint/libs/bytes"
Expand All @@ -19,8 +20,150 @@
tmcons "github.com/tendermint/tendermint/proto/tendermint/consensus"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/tendermint/tendermint/types"
=======

Check failure on line 23 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

missing import path
"github.com/sei-protocol/sei-chain/sei-tendermint/crypto"
cstypes "github.com/sei-protocol/sei-chain/sei-tendermint/internal/consensus/types"
"github.com/sei-protocol/sei-chain/sei-tendermint/internal/eventbus"
"github.com/sei-protocol/sei-chain/sei-tendermint/internal/p2p"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/bits"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/bytes"
tmrand "github.com/sei-protocol/sei-chain/sei-tendermint/libs/rand"
tmtime "github.com/sei-protocol/sei-chain/sei-tendermint/libs/time"
"github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils"
tmcons "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/consensus"
tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types"
"github.com/sei-protocol/sei-chain/sei-tendermint/types"
"github.com/sei-protocol/sei-chain/sei-tendermint/version"
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))

Check failure on line 37 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

illegal character U+0023 '#'

Check failure on line 37 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

missing import path
)

// Test checking that if peer sends a ProposalPOLMessage with a bitarray with bad length,
// the node will handle it gracefully.
func TestGossipVotesForHeightPoisonedProposalPOL(t *testing.T) {
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)
defer cancel()

Check failure on line 44 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

expected declaration, found 'defer'

cfg := configSetup(t)
states, cleanup := makeConsensusState(ctx, t, cfg, 2, "consensus_reactor_test", newMockTickerFunc(true))
t.Cleanup(cleanup)

rts := setup(ctx, t, 2, states, 1)

var nodeIDs []types.NodeID
for _, node := range rts.network.Nodes() {

Check failure on line 53 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

expected declaration, found 'for'
nodeIDs = append(nodeIDs, node.NodeID)
}
require.Len(t, nodeIDs, 2)

reactor := rts.reactors[nodeIDs[0]]
peerID := nodeIDs[1]
state := reactor.state.GetState()
reactor.SwitchToConsensus(ctx, state, false)

require.Eventually(t, func() bool {
_, ok := reactor.GetPeerState(peerID)
return ok
}, time.Hour, 50*time.Millisecond)

valSet, privVals := types.RandValidatorSet(4, 1)
proposerPubKey, err := privVals[0].GetPubKey(ctx)
require.NoError(t, err)

proposal := types.NewProposal(
1,
1,
0,
types.BlockID{
Hash: crypto.CRandBytes(crypto.HashSize),
PartSetHeader: types.PartSetHeader{
Total: 1,
Hash: crypto.CRandBytes(crypto.HashSize),
},
},
time.Now(),
nil,
types.Header{
Version: version.Consensus{Block: version.BlockProtocol},
Height: 1,
ProposerAddress: proposerPubKey.Address(),
},
&types.Commit{},
nil,
proposerPubKey.Address(),
)
proposal.Signature = makeSig("invalid-signature")

require.NoError(t, reactor.handleStateMessage(p2p.RecvMsg[*tmcons.Message]{
From: peerID,
Message: MsgToProto(&NewRoundStepMessage{
HRS: cstypes.HRS{
Height: 1,
Round: 1,
Step: cstypes.RoundStepPrevote,
},
SecondsSinceStartTime: 1,
LastCommitRound: -1,
}),
}))

require.NoError(t, reactor.handleDataMessage(ctx, p2p.RecvMsg[*tmcons.Message]{
From: peerID,
Message: MsgToProto(&ProposalMessage{
Proposal: proposal,
}),
}))

require.NoError(t, reactor.handleDataMessage(ctx, p2p.RecvMsg[*tmcons.Message]{
From: peerID,
Message: MsgToProto(&ProposalPOLMessage{
Height: 1,
ProposalPOLRound: 0,
ProposalPOL: bits.NewBitArray(1),
}),
}))

ps, ok := reactor.GetPeerState(peerID)
require.True(t, ok)
prs := ps.GetRoundState()
require.Equal(t, int64(1), prs.Height)
require.Equal(t, int32(1), prs.Round)
require.Equal(t, int32(0), prs.ProposalPOLRound)
require.Equal(t, 1, prs.ProposalPOL.Size())

voteSet := cstypes.NewHeightVoteSet("test-chain", 1, valSet)
voteSet.SetRound(1)

voter := newValidatorStub(privVals[1], 1)
voter.Height = 1
voter.Round = 0

vote := signVote(ctx, t, voter, tmproto.PrevoteType, "test-chain", types.BlockID{
Hash: crypto.CRandBytes(crypto.HashSize),
PartSetHeader: types.PartSetHeader{
Total: 1,
Hash: crypto.CRandBytes(crypto.HashSize),
},
})
added, err := voteSet.AddVote(vote, "")
require.NoError(t, err)
require.True(t, added)

rs := &cstypes.RoundState{
HRS: cstypes.HRS{
Height: 1,
Round: 1,
Step: cstypes.RoundStepPrevote,
},
Votes: voteSet,
}

// Gossip should take into consideration that PeerState might contain
// invalid length bitarrays.
for range 10 {
reactor.gossipVotesForHeight(rs, ps.GetRoundState(), ps)
}
}

func TestReactorInvalidPrecommit(t *testing.T) {
t.Skip("test doesn't check anything useful")
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)
Expand All @@ -29,7 +172,7 @@
config := configSetup(t)

const n = 4
states, cleanup := makeConsensusState(ctx, t,

Check failure on line 175 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

expected declaration, found states
config, n, "consensus_reactor_test",
newMockTickerFunc(true))
t.Cleanup(cleanup)
Expand Down Expand Up @@ -72,7 +215,7 @@
// TODO: Make this tighter by ensuring the halt happens by block 2.
var wg sync.WaitGroup

for range 10 {

Check failure on line 218 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

expected declaration, found 'for'
for _, sub := range rts.subs {
wg.Add(1)

Expand Down Expand Up @@ -127,7 +270,10 @@
require.NoError(t, err)

addr := pubKey.Address()
valIndex, _ := cs.roundState.Validators().GetByAddress(addr)
valIndex, _, ok := cs.roundState.Validators().GetByAddress(addr)
if !ok {
panic("missing validator")
}

// precommit a random block
blockHash := bytes.HexBytes(tmrand.Bytes(32))
Expand All @@ -153,7 +299,7 @@
cs.mtx.Unlock()

var ids []types.NodeID
for peers := range r.peers.RLock() {

Check failure on line 302 in sei-tendermint/internal/consensus/invalid_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

expected declaration, found 'for'
for _, ps := range peers {
ids = append(ids, ps.peerID)
}
Expand Down
10 changes: 9 additions & 1 deletion sei-tendermint/internal/consensus/memory_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

import (
"testing"
"time"

<<<<<<< HEAD

Check failure on line 6 in sei-tendermint/internal/consensus/memory_limit_test.go

View workflow job for this annotation

GitHub Actions / Go / Lint

missing import path
=======
"github.com/sei-protocol/sei-chain/sei-tendermint/crypto"
"github.com/sei-protocol/sei-chain/sei-tendermint/crypto/ed25519"
"github.com/sei-protocol/sei-chain/sei-tendermint/types"
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
Expand All @@ -25,6 +30,7 @@
{"very_large_total", 4294967295, true},
}

<<<<<<< HEAD
// Test SetHasProposal memory limits
t.Run("SetHasProposal", func(t *testing.T) {
for _, tc := range testCases {
Expand Down Expand Up @@ -59,6 +65,8 @@
}
})

=======
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
// Test InitProposalBlockParts memory limits
t.Run("InitProposalBlockParts", func(t *testing.T) {
for _, tc := range testCases {
Expand Down
2 changes: 1 addition & 1 deletion sei-tendermint/internal/consensus/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (m *ProposalMessage) String() string {
return fmt.Sprintf("[Proposal %v]", m.Proposal)
}

// ProposalPOLMessage is sent when a previous proposal is re-proposed.
// ProposalPOLMessage is sent when a node needs POL round votes.
type ProposalPOLMessage struct {
Height int64
ProposalPOLRound int32
Expand Down
4 changes: 2 additions & 2 deletions sei-tendermint/internal/consensus/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func TestMsgToProto(t *testing.T) {

proposal := types.Proposal{
Type: tmproto.ProposalType,
Height: 1,
Round: 1,
Height: 3,
Round: 2,
POLRound: 1,
BlockID: bi,
Timestamp: time.Now(),
Expand Down
8 changes: 7 additions & 1 deletion sei-tendermint/internal/consensus/peer_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@
return
}

<<<<<<< HEAD
// Check memory limits before acquiring lock or setting any state
if proposal.BlockID.PartSetHeader.Total > types.MaxBlockPartsCount {
ps.logger.Debug("PartSetHeader.Total exceeds maximum", "total", proposal.BlockID.PartSetHeader.Total, "max", types.MaxBlockPartsCount)
return
}

=======
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
ps.mtx.Lock()
defer ps.mtx.Unlock()

Expand Down Expand Up @@ -190,12 +193,15 @@
}

if index, ok := votes.BitArray().Sub(psVotes).PickRandom(); ok {
<<<<<<< HEAD
vote := votes.GetByIndex(int32(index))
if vote != nil {
return vote, true
}
=======
return votes.GetByIndex(int32(index)) //nolint:gosec // index is bounded by validator set size which fits in int32

Check warning

Code scanning / CodeQL

Unreachable statement Warning

This statement is unreachable.

Copilot Autofix

AI 19 days ago

To fix this, we should resolve the bad merge in PickVoteToSend by ensuring there is exactly one return path inside the if index, ok := ...; ok block that both matches the function’s return signature and is reachable. The simplest way that preserves existing behavior is to keep the HEAD logic (which already returns (*types.Vote, bool) and checks for nil) and delete the unreachable return votes.GetByIndex(int32(index)) line (and its conflict markers). This maintains the previous semantics: pick a random index, get the vote, return (vote, true) if non-nil, otherwise fall through and eventually return (nil, false).

Concretely, in sei-tendermint/internal/consensus/peer_state.go, within func (ps *PeerState) PickVoteToSend, replace the whole conflict-marked region (lines 195–203) with the HEAD implementation only:

  • After if index, ok := votes.BitArray().Sub(psVotes).PickRandom(); ok {, keep:
    • vote := votes.GetByIndex(int32(index))
    • if vote != nil { return vote, true }
  • Remove the merge markers <<<<<<< HEAD, =======, >>>>>>> ... and the unreachable return votes.GetByIndex(int32(index)) line.

No additional imports or helper methods are necessary.

Suggested changeset 1
sei-tendermint/internal/consensus/peer_state.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/sei-tendermint/internal/consensus/peer_state.go b/sei-tendermint/internal/consensus/peer_state.go
--- a/sei-tendermint/internal/consensus/peer_state.go
+++ b/sei-tendermint/internal/consensus/peer_state.go
@@ -193,14 +193,10 @@
 	}
 
 	if index, ok := votes.BitArray().Sub(psVotes).PickRandom(); ok {
-<<<<<<< HEAD
 		vote := votes.GetByIndex(int32(index))
 		if vote != nil {
 			return vote, true
 		}
-=======
-		return votes.GetByIndex(int32(index)) //nolint:gosec // index is bounded by validator set size which fits in int32
->>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
 	}
 	return nil, false
 }
EOF
@@ -193,14 +193,10 @@
}

if index, ok := votes.BitArray().Sub(psVotes).PickRandom(); ok {
<<<<<<< HEAD
vote := votes.GetByIndex(int32(index))
if vote != nil {
return vote, true
}
=======
return votes.GetByIndex(int32(index)) //nolint:gosec // index is bounded by validator set size which fits in int32
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
}
return nil, false
}
Copilot is powered by AI and may make mistakes. Always verify output.
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
}

return nil, false
}

Expand Down
9 changes: 9 additions & 0 deletions sei-tendermint/internal/consensus/peer_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func TestSetHasProposal(t *testing.T) {
ps.SetHasProposal(invalidProposal)
require.True(t, ps.PRS.Proposal, "Valid structure proposal should be accepted regardless of signature")

<<<<<<< HEAD
// Test PartSetHeader.Total too large - should be silently ignored
// Create a new peer state for this test
ps3 := peerStateSetup(1, 1, 1)
Expand All @@ -146,6 +147,8 @@ func TestSetHasProposal(t *testing.T) {
ps3.SetHasProposal(tooLargeTotalProposal)
require.False(t, ps3.PRS.Proposal, "Proposal with too large Total should be silently ignored")

=======
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
// Test valid proposal
validProposal := &types.Proposal{
Type: tmproto.ProposalType,
Expand Down Expand Up @@ -184,6 +187,7 @@ func TestSetHasProposal(t *testing.T) {
require.True(t, ps2.PRS.Proposal, "Proposal with matching height should be accepted")
}

<<<<<<< HEAD
func TestSetHasProposalMemoryLimit(t *testing.T) {
logger := log.NewTestingLogger(t)
peerID := types.NodeID("aa")
Expand Down Expand Up @@ -253,6 +257,8 @@ func TestSetHasProposalMemoryLimit(t *testing.T) {
}
}

=======
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
func TestInitProposalBlockPartsMemoryLimit(t *testing.T) {
logger := log.NewTestingLogger(t)
peerID := types.NodeID("test-peer")
Expand Down Expand Up @@ -331,6 +337,7 @@ func TestSetHasProposalEdgeCases(t *testing.T) {
expectPanic bool
}{
{
<<<<<<< HEAD
name: "memory limit exceeded - should silently ignore",
setupPeerState: func(ps *PeerState) {
ps.PRS.Height = 1
Expand All @@ -355,6 +362,8 @@ func TestSetHasProposalEdgeCases(t *testing.T) {
expectPanic: false,
},
{
=======
>>>>>>> d201e89 (fix to ProposalPOLMessage poisoning (CON-222) (#3129))
name: "wrong height - should ignore",
setupPeerState: func(ps *PeerState) {
ps.PRS.Height = 1
Expand Down
Loading
Loading