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
If all values should be rlp(bytes) where bytes itself can be rlp(forkid), should add_value then insert self.add_value_rlp(key, alloy_rlp::encode(&out)) ?
In principle, it should work for any object that is RLP encodable. In your test could you not just put the fork_id into add_value() and it will be encoded as every other type that is rlp encodeable and stored in the ENR.
Your suggestion would be to double rlp-encode objects right?
Currently we are just rlp-encoding the types and storing the bytes of the rlp-encoded object, which seems sensible to me.
Unless the .build() fails on normal types, it should be the case that all rlp-bytes can be decoded as bytes right?
This states:
enr/src/builder.rs
Lines 18 to 20 in 83cd989
This will add any encodable value encoded as rlp to the map:
enr/src/builder.rs
Lines 45 to 56 in 83cd989
on
build
this check ensures that all values arerlp(bytes)
:enr/src/builder.rs
Lines 159 to 162 in 83cd989
on reth, this test currently fails because the value is
rlp(forkId)
https://github.com/paradigmxyz/reth/blob/bc2634981e2fdca2d968b1dc63d3ca9a716c93e4/crates/net/discv4/src/proto.rs#L660-L664
If all values should be rlp(bytes) where bytes itself can be rlp(forkid), should
add_value
then insertself.add_value_rlp(key, alloy_rlp::encode(&out))
?enr/src/builder.rs
Lines 45 to 50 in 83cd989
The text was updated successfully, but these errors were encountered: