Closed fgimenez closed 3 weeks ago
this is most likely not sound. TxKind
occupies one bit inside the bitflag struct. If set, it will decode an address, otherwise it wont. This bitflag struct more or less dictates what to decode or how many bytes to decode from.
Changing this to Address
, will make it not backwards compatible since, this bit will now be part of the next field which is not right.
Note the cargo expansion below B1
.
main
:
#[allow(clippy::identity_op)]
pub struct TxEip4844Flags {
bytes: [::core::primitive::u8; {
((({
0usize + <B4 as ::modular_bitfield::Specifier>::BITS
+ <B4 as ::modular_bitfield::Specifier>::BITS
+ <B4 as ::modular_bitfield::Specifier>::BITS
+ <B5 as ::modular_bitfield::Specifier>::BITS
+ <B5 as ::modular_bitfield::Specifier>::BITS
+ <B1 as ::modular_bitfield::Specifier>::BITS
+ <B6 as ::modular_bitfield::Specifier>::BITS
+ <B5 as ::modular_bitfield::Specifier>::BITS
+ <B6 as ::modular_bitfield::Specifier>::BITS
} - 1) / 8) + 1) * 8
} / 8usize],
this branch:
#[allow(clippy::identity_op)]
pub struct TxEip4844Flags {
bytes: [::core::primitive::u8; {
((({
0usize + <B4 as ::modular_bitfield::Specifier>::BITS
+ <B4 as ::modular_bitfield::Specifier>::BITS
+ <B4 as ::modular_bitfield::Specifier>::BITS
+ <B5 as ::modular_bitfield::Specifier>::BITS
+ <B5 as ::modular_bitfield::Specifier>::BITS
+ <B6 as ::modular_bitfield::Specifier>::BITS
+ <B5 as ::modular_bitfield::Specifier>::BITS
+ <B7 as ::modular_bitfield::Specifier>::BITS
} - 1) / 8) + 1) * 8
} / 8usize],
Note the missing bit on this branch macro expansion.
EIP-4844 transactions have a restriction that they should not allow CREATE transactions.
In this PR the
to
field inTxEip4844
is changed fromTxKind
toAddress
, so that it can't be decoded intoTxKind::Create
.