alloy-rs / alloy

Transports, Middleware, and Networks for the Alloy project
https://alloy.rs
Apache License 2.0
652 stars 234 forks source link

chore: change requests to flat encoding #1378

Closed onbjerg closed 1 month ago

onbjerg commented 1 month ago

Motivation

In devnet 4, the current request encoding scheme is replaced with a flat encoding scheme, i.e. no rlp involved.

The request payloads (i.e. bytes following the request type byte) are now encoded as follows:

Solution

I decided to simply implement Encodable7685 and Decodable7685 for each request type, and for the Request enum wrapper in alloy-consensus, I defer to these implementations.

Closes https://github.com/alloy-rs/alloy/issues/1338

PR Checklist

onbjerg commented 1 month ago

Please do not merge this upon approval, I'd like to merge the devnet 4 PRs in one go when necessary.

onbjerg commented 1 month ago

Putting this back in draft since the encoding changed yet again (and pretty significantly).