Skip to content
Open
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
15 changes: 11 additions & 4 deletions cmd/devp2p/internal/ethtest/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/ethereum/go-ethereum/internal/utesting"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/params"
"github.com/holiman/uint256"
)

Expand Down Expand Up @@ -188,8 +189,8 @@ to check if the node disconnects after receiving multiple invalid requests.`)

// Check if peer disconnects at the end.
code, _, err := conn.Read()
if err == errDisc || code == discMsg {
Copy link
Contributor Author

@flcl42 flcl42 Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fjl It seems like the test fails when we do disconnect, or I'm missing something obvious

Copy link
Contributor Author

@flcl42 flcl42 Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looks like geth sends back empty BlockHeadersMsgs, which kinda ok, but not handled by the test, imho. Does it disconnect then? Not sure if it sends disconnect message or just disconnects.
Nethermind just sends disconnect message on the very first package, which seems correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm probably the difference is also in how we handle ^uint64(0) as Origin of GetBlockHeadersRequest. And test does not test what's intended in case of Nethermind (we can't handle max uint64 and immediately disconnect)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check the differences

t.Fatal("peer improperly disconnected")
if err != errDisc && code != discMsg {
t.Fatal("peer improperly disconnected", err, errDisc, code, discMsg)
}
}

Expand Down Expand Up @@ -912,8 +913,8 @@ func (s *Suite) makeBlobTxs(count, blobs int, discriminator byte) (txs types.Tra
inner := &types.BlobTx{
ChainID: uint256.MustFromBig(s.chain.config.ChainID),
Nonce: nonce + uint64(i),
GasTipCap: uint256.NewInt(1),
GasFeeCap: uint256.MustFromBig(s.chain.Head().BaseFee()),
GasTipCap: uint256.NewInt(params.GWei),
GasFeeCap: new(uint256.Int).Add(uint256.MustFromBig(s.chain.Head().BaseFee()), uint256.NewInt(+params.GWei)),
Gas: 100000,
BlobFeeCap: uint256.MustFromBig(eip4844.CalcBlobFee(s.chain.config, s.chain.Head().Header())),
BlobHashes: makeSidecar(blobdata...).BlobHashes(),
Expand Down Expand Up @@ -990,6 +991,12 @@ func (s *Suite) TestBlobViolations(t *utesting.T) {
t.Fatalf("expected disconnect on blob violation, got err on second read: %v", err)
}
}
if code == protoOffset(ethProto)+eth.GetPooledTransactionsMsg {
// due to maxTxPacketSize limit there can be two requests for pooled transactions
if code, _, err = conn.Read(); err != nil {
t.Fatalf("expected disconnect on blob violation, got err on second read: %v", err)
}
}
if code != discMsg {
t.Fatalf("expected disconnect on blob violation, got msg code: %d", code)
}
Expand Down
Loading