Skip to content

zkvm: display stf logs in zkvm context#20

Merged
g11tech merged 1 commit intomainfrom
log-zkvm-errors
May 1, 2025
Merged

zkvm: display stf logs in zkvm context#20
g11tech merged 1 commit intomainfrom
log-zkvm-errors

Conversation

@gballet
Copy link
Copy Markdown
Contributor

@gballet gballet commented Apr 20, 2025

std.debut.print will not work in a zkvm context, as there is no unix support in these environments. I have created a log function that behaves like it, and uses either zkvm.io.print_str or std.debug.print depending on the context it's run in.

Note that it will only be able to print a maximum of 512 characters at a time, but that is good enough for our current use case.

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
@gballet gballet requested a review from g11tech April 20, 2025 08:46

// add state transition, create a new module for each zkvm since
// that module depends on the zkvm module.
const zeam_state_transition = b.addModule("@zeam/state-transition", .{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we only add the zkvm addImport to this module inside the loop and else keep it outside the loop?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no because the module itself is different for each zkvm binary, the import is a reference to the module so we can't do that afaik.

@g11tech g11tech merged commit fbb53ce into main May 1, 2025
6 checks passed
@g11tech g11tech deleted the log-zkvm-errors branch May 10, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants