-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: parse PVM program blob #43
Conversation
4b57e7f
to
aadb98b
Compare
aadb98b
to
24fc849
Compare
a69a248
to
967f457
Compare
The overall comment - maybe we should introduce a division into Polka Host - so something that's reading the blob, preparing all the data and structures, and runs the second part - so the PVM itself. |
e6bd29b
to
5ad5d0c
Compare
5ad5d0c
to
b04ff15
Compare
Most of this all looks okay to me from what I can tell. But something that does stand out is the number of panics? Do we want to instead return errors rather than panic in this code? I realise you've marked a few of these as unreachable but just wanted to raise it and discuss it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instructions.go
seems to be not tied with parsing program blob but let's merge it and go on with the instruction decoder.
@aranw , the panics are there for cases that should never happen, this is why I put panics as we expect those code parts to be "unreachable" and if we get there something went terribly wrong, in rust they use assert and unreachable macro for this I think |
Parse the program binary.
This initial iteration adds the program parsing component, it takes in a bytes reader and decodes each section of the program into jump table, a set of instructions, import and export functions.
The logic is based on https://github.com/koute/polkavm