Skip to content

Commit

Permalink
Revert "eth/68: always announce tx sizes with envelopes (#8502)"
Browse files Browse the repository at this point in the history
This reverts commit def6067.
  • Loading branch information
yperbasis authored Oct 19, 2023
1 parent 12d33d5 commit 6da5a7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 1 addition & 7 deletions erigon-lib/types/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type TxSlot struct {
Traced bool // Whether transaction needs to be traced throughout transaction pool code and generate debug printing
Creation bool // Set to true if "To" field of the transaction is not set
Type byte // Transaction type
Size uint32 // Size of the payload, always including the envelope for typed transactions
Size uint32 // Size of the payload

// EIP-4844: Shard Blob Transactions
BlobFeeCap uint256.Int // max_fee_per_blob_gas
Expand Down Expand Up @@ -287,12 +287,6 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo
}

slot.Size = uint32(p - pos)
if !legacy && !hasEnvelope {
// Normalize the size so that it accounts for the envelope bytes
// See https://github.com/ledgerwatch/erigon/issues/8456
slot.Size = uint32(rlp.ListPrefixLen(int(slot.Size))) + slot.Size
}

return p, err
}

Expand Down
4 changes: 1 addition & 3 deletions erigon-lib/types/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (

"github.com/ledgerwatch/erigon-lib/common/fixedgas"
"github.com/ledgerwatch/erigon-lib/common/hexutility"
"github.com/ledgerwatch/erigon-lib/rlp"
)

func TestParseTransactionRLP(t *testing.T) {
Expand Down Expand Up @@ -262,8 +261,7 @@ func TestBlobTxParsing(t *testing.T) {
p, err = ctx.ParseTransaction(wrapperRlp, 0, &fatTx, nil, hasEnvelope, wrappedWithBlobs, nil)
require.NoError(t, err)
assert.Equal(t, len(wrapperRlp), p)
wrapperLenWithEnvelope := rlp.ListPrefixLen(len(wrapperRlp)) + len(wrapperRlp)
assert.Equal(t, wrapperLenWithEnvelope, int(fatTx.Size))
assert.Equal(t, len(wrapperRlp), int(fatTx.Size))
assert.Equal(t, wrapperRlp, fatTx.Rlp)
assert.Equal(t, BlobTxType, fatTx.Type)

Expand Down

0 comments on commit 6da5a7b

Please sign in to comment.