You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've been looking into the Header RLP enc/dec.
My understanding is that RLP encoding is code generated and located here, and the as far as decoder goes, there is no special logic (ie. since every field of the Header struct is RLP decodable so is the whole struct).
This is to say if eg. BlobGas "exists", and even if BaseFee and WithdrawalHash are nil this header will be properly Encoded, but per my tests, it won't be decoded.
"WithWithdrawalHash" fails because header.BaseFee is initially nil but it is decoded as 0, and while it might sound like bikeshedding, but 0 != nil
"WithBlobGasFields" will fail with the following error Failed to decode header: rlp: input string too short for common.Hash, decoding into (types.Header).WithdrawalsHash
Questions
My questions are:
Are my test correct (I think they are, I don't see any obvious bugs)
Assuming they are, is this expected behaviour?
If yes, how come/why? I would assume that if header was managed to be encoded successfully that it can be decoded as well
The text was updated successfully, but these errors were encountered:
Hello, I've been looking into the Header RLP enc/dec.
My understanding is that RLP encoding is code generated and located here, and the as far as decoder goes, there is no special logic (ie. since every field of the Header struct is RLP decodable so is the whole struct).
Encoding logic
Per encoding logic, we have this
This is to say if eg.
BlobGas
"exists", and even ifBaseFee
andWithdrawalHash
arenil
this header will be properlyEncoded
, but per my tests, it won't be decoded.Tests
Here both test cases will fail:
header.BaseFee
is initiallynil
but it is decoded as0
, and while it might sound like bikeshedding, but0 != nil
Failed to decode header: rlp: input string too short for common.Hash, decoding into (types.Header).WithdrawalsHash
Questions
My questions are:
The text was updated successfully, but these errors were encountered: