Conversation
…ereum#29514) Cherry-pick of `69f815f6f5791e0e48160bdad284773d0ffb1ba9`.
core/types/block.go
Outdated
There was a problem hiding this comment.
note this change is compulsory since there are more fields present in the struct than these 3.
edebe13 to
e7193b7
Compare
e7193b7 to
7f6afca
Compare
|
|
||
| // EncodeRLP implements the [rlp.Encoder] interface. | ||
| func (b *Body) EncodeRLP(w io.Writer) error { | ||
| return b.hooks().EncodeRLP(b, w) |
There was a problem hiding this comment.
Completely overriding RLP {en,de}coding is a blunt tool that we used for Header only because of the complexity of the modifications to that type (with the view to hopefully changing it in the future). I think it's possible to achieve this for Body without a hook, using just the rules of RLP optional, but I need to tinker a bit to confirm.
My greatest concern with a complete override is that the user still has to implement a lot of the upstream functionality, reducing the benefit of libevm.
There was a problem hiding this comment.
Progress on #109 suggests that this should be possible, with a hook that only needs to write fields to an rlp.EncoderBuffer. I'll confirm tomorrow.
Body RLP codec hooksBody RLP codec hooks
18383c7 to
def07f8
Compare
Body RLP codec hooksBody RLP codec hooks
|
Closed in favor of #109 |
Why this should be merged
How this works
How this was tested
BlockandBodyfrom libevm (6) coreth#760