diff --git a/cmd/devp2p/internal/ethtest/suite.go b/cmd/devp2p/internal/ethtest/suite.go index e4f8a223c2..ab65a87d37 100644 --- a/cmd/devp2p/internal/ethtest/suite.go +++ b/cmd/devp2p/internal/ethtest/suite.go @@ -462,8 +462,8 @@ func (s *Suite) TestGetReceipts(t *utesting.T) { // Create block bodies request. req := ð.GetReceiptsPacket70{ RequestId: 66, - GetReceiptsRequest: (eth.GetReceiptsRequest)(hashes), FirstBlockReceiptIndex: 0, + GetReceiptsRequest: (eth.GetReceiptsRequest)(hashes), } if err := conn.Write(ethProto, eth.GetReceiptsMsg, req); err != nil { t.Fatalf("could not write to connection: %v", err) @@ -519,8 +519,8 @@ func (s *Suite) TestGetLargeReceipts(t *utesting.T) { // Create get receipt request. req := ð.GetReceiptsPacket70{ RequestId: 66, - GetReceiptsRequest: blocks[lastBlock:], FirstBlockReceiptIndex: uint64(receipts[lastBlock].Len()), + GetReceiptsRequest: blocks[lastBlock:], } if err := conn.Write(ethProto, eth.GetReceiptsMsg, req); err != nil { t.Fatalf("could not write to connection: %v", err) diff --git a/eth/protocols/eth/handler_test.go b/eth/protocols/eth/handler_test.go index f934d394ff..9a1f746f8e 100644 --- a/eth/protocols/eth/handler_test.go +++ b/eth/protocols/eth/handler_test.go @@ -615,13 +615,13 @@ func testGetBlockPartialReceipts(t *testing.T, protocol int) { p2p.Send(peer.app, GetReceiptsMsg, &GetReceiptsPacket70{ RequestId: 123, - GetReceiptsRequest: hashes, FirstBlockReceiptIndex: 0, + GetReceiptsRequest: hashes, }) if err := p2p.ExpectMsg(peer.app, ReceiptsMsg, &ReceiptsPacket70{ RequestId: 123, - List: partialReceipt, LastBlockIncomplete: true, + List: partialReceipt, }); err != nil { t.Errorf("receipts mismatch: %v", err) } @@ -631,14 +631,14 @@ func testGetBlockPartialReceipts(t *testing.T, protocol int) { p2p.Send(peer.app, GetReceiptsMsg, &GetReceiptsPacket70{ RequestId: 123, - GetReceiptsRequest: []common.Hash{hashes[blockCutoff]}, FirstBlockReceiptIndex: uint64(receiptCutoff), + GetReceiptsRequest: []common.Hash{hashes[blockCutoff]}, }) if err := p2p.ExpectMsg(peer.app, ReceiptsMsg, &ReceiptsPacket70{ RequestId: 123, - List: partialReceipt, LastBlockIncomplete: false, + List: partialReceipt, }); err != nil { t.Errorf("receipts mismatch: %v", err) } diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 12328bd16a..dd543ff0f8 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -356,8 +356,8 @@ func (p *Peer) RequestReceipts(hashes []common.Hash, sink chan *Response) (*Requ want: ReceiptsMsg, data: &GetReceiptsPacket70{ RequestId: id, - GetReceiptsRequest: hashes, FirstBlockReceiptIndex: 0, + GetReceiptsRequest: hashes, }, } p.receiptBufferLock.Lock() @@ -401,8 +401,8 @@ func (p *Peer) requestPartialReceipts(id uint64) error { want: ReceiptsMsg, data: &GetReceiptsPacket70{ RequestId: id, - GetReceiptsRequest: p.receiptBuffer[id].request[lastBlock:], FirstBlockReceiptIndex: uint64(lastReceipt), + GetReceiptsRequest: p.receiptBuffer[id].request[lastBlock:], }, } return p.dispatchRequest(req) diff --git a/eth/protocols/eth/protocol.go b/eth/protocols/eth/protocol.go index cab7f32b81..80874a8edd 100644 --- a/eth/protocols/eth/protocol.go +++ b/eth/protocols/eth/protocol.go @@ -268,9 +268,9 @@ type GetReceiptsPacket69 struct { // GetReceiptsPacket70 represents a block receipts query with request ID and // FirstBlockReceiptIndex wrapping. type GetReceiptsPacket70 struct { - RequestId uint64 - GetReceiptsRequest + RequestId uint64 FirstBlockReceiptIndex uint64 + GetReceiptsRequest } // ReceiptsResponse is the network packet for block receipts distribution. @@ -293,8 +293,8 @@ type ReceiptsPacket[L ReceiptsList] struct { type ReceiptsPacket70 struct { RequestId uint64 - List []*ReceiptList69 LastBlockIncomplete bool + List []*ReceiptList69 } // ReceiptsRLPResponse is used for receipts, when we already have it encoded @@ -309,9 +309,9 @@ type ReceiptsRLPPacket69 struct { // ReceiptsRLPPacket70 is ReceiptsRLPResponse with request ID and // LastBlockIncomplete wrapping. type ReceiptsRLPPacket70 struct { - RequestId uint64 - ReceiptsRLPResponse + RequestId uint64 LastBlockIncomplete bool + ReceiptsRLPResponse } // NewPooledTransactionHashesPacket represents a transaction announcement packet on eth/68 and newer.