Skip to content

Commit 5b2caa9

Browse files
committed
Add 1gwei tip; handle two pooled tx requests; fix disconnection detection
1 parent 55a5320 commit 5b2caa9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cmd/devp2p/internal/ethtest/suite.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
"github.com/ethereum/go-ethereum/internal/utesting"
3535
"github.com/ethereum/go-ethereum/p2p"
3636
"github.com/ethereum/go-ethereum/p2p/enode"
37+
"github.com/ethereum/go-ethereum/params"
3738
"github.com/holiman/uint256"
3839
)
3940

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

189190
// Check if peer disconnects at the end.
190191
code, _, err := conn.Read()
191-
if err == errDisc || code == discMsg {
192-
t.Fatal("peer improperly disconnected")
192+
if err != errDisc && code != discMsg {
193+
t.Fatal("peer improperly disconnected", err, errDisc, code, discMsg)
193194
}
194195
}
195196

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

0 commit comments

Comments
 (0)