Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not marshall bits in little-endian encoding #132

Open
dr-orlovsky opened this issue Feb 2, 2025 · 0 comments
Open

Do not marshall bits in little-endian encoding #132

dr-orlovsky opened this issue Feb 2, 2025 · 0 comments
Assignees
Labels
*consensus* Issues affecting distributed concensus *portability* Issues affecting VM portability
Milestone

Comments

@dr-orlovsky
Copy link
Member

Little-endian encoding used in bit marshaling leads to situations where lately encoded arguments go before first ones.

Assume we have an instruction Instr { arg1: u4, arg2: u4 }, where arg1 = 0b_0110; arg2 = 0b_1001. These arguments will be marshaled as 0b_10010110 byte, which is quite contrary to intuition of 0b_01101001.

A negative side-effect of this is the fact when multiple instructions share the same op-code byte and use several bits to further clarify the instruction, these bits are marshaled after argument bits.

@dr-orlovsky dr-orlovsky added *consensus* Issues affecting distributed concensus *portability* Issues affecting VM portability labels Feb 2, 2025
@dr-orlovsky dr-orlovsky added this to the v0.12.0 milestone Feb 2, 2025
@dr-orlovsky dr-orlovsky self-assigned this Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*consensus* Issues affecting distributed concensus *portability* Issues affecting VM portability
Projects
None yet
Development

No branches or pull requests

1 participant