Skip to content

runtime: import code from zeam-runtime#2

Merged
g11tech merged 2 commits intomainfrom
import-zeam-runtime
Feb 28, 2025
Merged

runtime: import code from zeam-runtime#2
g11tech merged 2 commits intomainfrom
import-zeam-runtime

Conversation

@gballet
Copy link
Copy Markdown
Contributor

@gballet gballet commented Feb 27, 2025

Import the current, committed state of zeam-runtime, so that the prover/verifier program can be built.

This does not support the full input yet since a common interface between zkvms needs to be designed (blockblaz/zeam-pm#9). The executable needs to be compiled before running the prover (which isn't implemented yet, so it's not a big deal at this point).

Fixes blockblaz/zeam-pm#5

@gballet gballet requested a review from g11tech February 27, 2025 10:08
They can't run because the target architecture is different from
the building architecture.

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Comment on lines +86 to +97
// const tests = b.addTest(.{
// .root_source_file = .{ .cwd_relative = "src/transition.zig" },
// .optimize = optimize,
// .target = target,
// });
// tests.root_module.addImport("ssz", ssz);
// tests.root_module.addImport("zeam-types", zeam_types);
// tests.root_module.addImport("zeam-transition-runtime", zeam_state_transition);

const run_tests = b.addRunArtifact(tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_tests.step);
// const run_tests = b.addRunArtifact(tests);
// const test_step = b.step("test", "Run unit tests");
// test_step.dependOn(&run_tests.step);
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.

I'm commenting this out, because these tests can never run (unless we are building this on riscv32). It might be a good idea to have the CI build them and run them in qemu, but this is an effort that is quite involved, and it can be tested another way by building the executable and running a prover instead. So I might end up removing it all, I just need to think about the best way to do this.

@@ -30,18 +33,31 @@ pub fn main() noreturn {
};
_ = witnesses;
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.

we still have not accessed inputs and witnesses here right?

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.

yes, this is coming in another PR that I'm currently working on, see blockblaz/zeam-pm#9


// Declare the -Dzkvm option, which is a choice between all supported zkvms
const zkvm = b.option(zkvm_types, "zkvm", "zkvm target") orelse .powdr;
const zkvm_module = b.addModule("zkvm", .{
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.

ok so we are inserting the target zkvm interface here that we have wrapped in each of individual folders?

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.

not quite: depending on the -Dzkvm= option we passed to zig build, it will use the files corresponding to the correct zkvm. So it's only using one subdirectory at a time.

I want to expand the whole thing so that all the binaries are built and can be released, but this is not necessary at this stage.

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.

yes, this doesn't need to be part of this build but proving manager's build can trigger these builds one by one to generate the target binaries

depending on the -Dzkvm= option we passed to zig build, it will use the files corresponding to the correct zkvm. So it's only using one subdirectory at a time

right what I meant was that one particular zk vm gets wrapped into "zkvm" module which is used by the zig main

Copy link
Copy Markdown
Member

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lfg 🚀

@g11tech g11tech merged commit 66c07fe into main Feb 28, 2025
4 checks passed
@g11tech g11tech deleted the import-zeam-runtime branch March 11, 2025 20:12
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.

Import zeam-runtime

2 participants