Skip to content

Consider adding byte packing utils #435

Open
@cam-schultz

Description

@cam-schultz

Context and scope
The Staking Manager contracts pack and upack Warp messages to/from byte strings. This involves bit manipulation which can likely be extracted into libraries.

@ARR4N 's POC here #482 is the desired approach but it needs to be extended to support our encoding schema.

It i's impossible to decode a message with more than one dynamic length field without knowing the lengths ahead of time. We encode lengths for all dynamic length fields right now in the field prior to the dynamic length field except for the blsPublicKeys which are packed straight to 48 bytes but are still dynamic bytes field on the Solidity side.

To use the approach above we need to account for both cases. One way of handling it might be to add an annotation to the blsPublicKey field that explicitly sets it's length to 48 and assume that all other dynamic length fields are directly preceeded by their encoded length.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status

    Done ✅

Relationships

None yet

Development

No branches or pull requests

Issue actions