Skip to content

Commit 671ed7f

Browse files
core: eth: fix transaction propagation
1 parent f23dacd commit 671ed7f

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

core/types/tx_blob_with_blob.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ type innerType struct {
3535
}
3636

3737
func (tx *BlobTxWithBlobs) DecodeRLP(s *rlp.Stream) error {
38-
b, err := s.Bytes()
39-
if err != nil {
38+
kind, _, err := s.Kind()
39+
switch {
40+
case err != nil:
4041
return err
42+
case kind == rlp.List:
43+
tx.Transaction = new(Transaction)
44+
return tx.Transaction.DecodeRLP(s)
45+
default:
46+
b, err := s.Bytes()
47+
if err != nil {
48+
return err
49+
}
50+
return tx.UnmarshalBinary(b)
4151
}
42-
return tx.UnmarshalBinary(b)
4352
}
4453

4554
func (tx *BlobTxWithBlobs) EncodeRLP(w io.Writer) error {

eth/handler_eth_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,6 @@ func testTransactionPropagation(t *testing.T, protocol uint) {
463463
}
464464
}
465465

466-
func TestBlobTransactionPropagation66(t *testing.T) { testBlobTransactionPropagation(t, eth.ETH66) }
467-
func TestBlobTransactionPropagation67(t *testing.T) { testBlobTransactionPropagation(t, eth.ETH67) }
468466
func TestBlobTransactionPropagation68(t *testing.T) { testBlobTransactionPropagation(t, eth.ETH68) }
469467

470468
func testBlobTransactionPropagation(t *testing.T, protocol uint) {

eth/protocols/eth/handlers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ func handlePooledTransactions66(backend Backend, msg Decoder, peer *Peer) error
542542
// Transactions can be processed, parse all of them and deliver to the pool
543543
var txs PooledTransactionsPacket66
544544
if err := msg.Decode(&txs); err != nil {
545+
fmt.Println(err)
545546
return fmt.Errorf("%w: message %v: %v", errDecode, msg, err)
546547
}
547548
for i, tx := range txs.PooledTransactionsPacket {

0 commit comments

Comments
 (0)