-
Notifications
You must be signed in to change notification settings - Fork 336
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
[BUG] [risc0/tinygo] Compiling and Running fib_go.go
with risc0/tinygo
Result Error
#1222
Comments
I was able to get it working however, this has bit-rotted a little bit.
So the issue that you're facing is the second point: there's something that's trying to read from address 0x0-0x3ff we disabled this so the memory for the generated code must range between 0x400 - 0xC000000. You might be able to make some modifications to the build commands within tinygo to get this to work? |
I apologize for the delayed response as I was away on vacation and missed your message. I deeply appreciate your insights regarding the memory requirements for risc0 zkvm compatibility. It seems that my issue stems from memory addressing that does not conform to the zkvm's current specifications. I will attempt to adjust the compile-time parameters for tinygo to align with the memory range of 0x400 to 0xC000000 as you've outlined. If I manage to make it work, I'll be sure to share my solution here for others who might encounter the same challenge. Furthermore, I'm particularly intrigued by the third point you mentioned regarding Thanks again for your support, and I'm looking forward to making progress with the help of your valuable input. |
@jax-cn have you had any luck getting this to work? |
In case you missed it, this issue is referencing https://github.com/risc0/tinygo . I do not think that there is presently work towards updating that repo and support for go at this time, but it is something that is increasingly asked about. Come join our discord to chat with others about that: Join here & support forum post most relevant at this time |
There is some work being done intermittently for tinygo support, but more in an experimental capacity. The current status is that it can prove basic go programs (with support for reading and committing data to the journal), but there are some unresolved issues when running some more complex programs (currently memory alignment issues). The work being done is on this branch https://github.com/risc0/tinygo/tree/go21 but it's not yet setup such that I would recommend it. I will do an update to it to simplify the code needed and possibly create a template (I have a stale one locally) and when I do, I can update this thread! But just to reiterate, very experimental, and I would generally not recommend this, but if anyone is interested in contributing to this, I can expedite putting the code in a state conducive to that :) |
Apology for Off-Topic Issue Post
I apologize for raising this issue in the
risc0
project tracker. I've noticed that thetinygo
project does not have issues enabled, which leaves me with no direct avenue to raise this concern there. I hope you understand the necessity of reaching out through this channel and appreciate any guidance you can provide.Bug Report
I successfully compiled an ELF binary using
risc0/tinygo
with the commandtinygo build -target zkvm fib_go.go
. However, when attempting to run the resulting binary withr0vm --elf fib_go
, I encountered the following runtime error:This suggests that the ELF binary does not conform to the expected ELF specification required by
zkvm
for guest programs.Steps to Reproduce
tinygo build -target zkvm fib_go.go
r0vm --elf fib_go
Expected behavior
use r0vm running fib_go and get proof
Your Environment
Additional context
I've reviewed the previously closed issue and noted that there was mention of partial success with
tinygo
. However, it seems that there have been no recent updates to thetinygo
project, which leads me to suspect that there might have been changes tozkvm
that affect the compatibility of the binaries produced bytinygo
.Would it be possible for you to share the results from your experimentation with
tinygo
? Any insights or progress made could be incredibly helpful for others encountering similar issues.Additionally, I wanted to inquire if there have been any recent changes to the
zkvm
that might require updates to the guest program specifications or the waytinygo
compiles binaries forzkvm
.fib_go.go
The text was updated successfully, but these errors were encountered: