-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix RLP encoding for types recursively calling RlpStream::append
#4362
Conversation
@@ -194,7 +194,7 @@ impl Encodable for ConsensusMessage { | |||
|
|||
pub fn message_info_rlp(vote_step: &VoteStep, block_hash: Option<BlockHash>) -> Bytes { | |||
// TODO: figure out whats wrong with nested list encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this resolve this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arkpar yap, will remove it
the changes made seem a little subtle - is there any reason these mistakes won't be repeated in the future? |
@gavofyork there is more insight into it in #4356. In short - there are use cases when calling The long term solution is to refactor how RlpStream works. I'd suggest that we only ever implement |
This will be easier said than done as items in RLP lists often have different types. For instance, how would you write a block header as a |
Can use macros to generate generic impl for all tuple sizes up to some limit (20? 32?), such as: impl<A, B, C, D...> Encodable for (A, B, C, D...) where
A: Encodable,
B: Encodable,
C: Encodable,
D: Encodable,
...
{ ... } |
Fixes #4356.