-
Notifications
You must be signed in to change notification settings - Fork 8
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
Flat instructions encoding #18
Comments
Something that could complicate this flat encoding is the |
Implemented this in the Typescript version: ethereumjs/merkle-patricia-tree@cb63d56 Each opcode takes one byte, values for const instructions = [
{ kind: Opcode.Leaf },
{ kind: Opcode.Add, value: 5 },
{ kind: Opcode.Extension, value: [3, 3, 3, 3] },
{ kind: Opcode.Branch, value: 6 }
] |
Currently instructions are RLP-encoded like other data structures. That's not strictly necessary as after reading each opcode (1 byte) we'd know how many bytes of data to read for that opcode. So it could be a simple flat encoding of the opcodes and their operands without any metadata. This would eliminate the need for decoding them first on the verifier's side. This is also what @cdetrio is doing in turbo-mpas.
I could start working on a PR if you think this makes sense.
The text was updated successfully, but these errors were encountered: