reth icon indicating copy to clipboard operation
reth copied to clipboard

fix: mandatory `to` for EIP-4844

Open klkvr opened this issue 1 year ago • 4 comments

Closes #7273

Changes TransactionKind to Address

Currently EthApi::send_transaction will throw ConflictingFeeFieldsInRequest not only in case of conflicting fee fields but also when blob transaction is missing blob fields or to, perhaps this error should be more specific?

klkvr avatar Mar 21 '24 16:03 klkvr

As it is, it does. At the moment main will only read 20 bytes to decompress an address if TransactionKind is Call.

However, we could replicate this behaviour by manually implementing Compact for Address and replicating the same behaviour. Only read 20 bytes if the address is not 0x0

joshieDo avatar Mar 21 '24 17:03 joshieDo

As it is, it does. At the moment main will only read 20 bytes to decompress an address if TransactionKind is Call.

However, we could replicate this behaviour by manually implementing Compact for Address and replicating the same behaviour. Only read 20 bytes if the address is not 0x0

sorry, not following yet, Address is already Compact.

all blob txs have Kind::Call

mattsse avatar Mar 21 '24 18:03 mattsse

friendly bump @joshieDo

mattsse avatar Mar 22 '24 17:03 mattsse

context:

Compact encodes to <bitflags><buffer>.

TransactionKind occupies 1 bit on the bitflag header of this transaction type.

On decoding, if the bit is set: we read 20 bytes, otherwise we don't.

issue:

If we replace this type by only Address, old transactions will still have that bit. I'm not sure how big is the bitflags header, it may have no impact.

But if in the future we add a new field to this type that uses some bitflag, then old transactions would read that bit even though it's unrelated.

joshieDo avatar Apr 02 '24 18:04 joshieDo

superseded by #8291

mattsse avatar May 17 '24 07:05 mattsse