Skip to content
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

Embedded elf guests for forks #1495

Merged
merged 51 commits into from
Dec 2, 2024
Merged

Embedded elf guests for forks #1495

merged 51 commits into from
Dec 2, 2024

Conversation

rakanalh
Copy link
Contributor

@rakanalh rakanalh commented Nov 20, 2024

Description

make build now builds the ELF guest codes separately using make build-risc0 and make build-sp1.

This basically removes the fact that we build the guest code along with the binary. Now, the guest code is loaded from resources/guests based on what we want to load.

That being said, each fork should add the ELF to the designated directory with 1.elf, 2.elf .. etc for each fork we end up introducing. The names can change of course but that's how it goes for now.

Development workflow

Previously, we used to have the guest code already built within the binary. If you run:

  • make build
  • make test

Both will act the same way by building the guest code and provide a binary that has the guest codes needed.

If you are running testing a specific build for the guest code, you can use:

  • make -C guests/risc0 batch-proof-bitcoin
  • make -C guests/risc0 batch-proof-mock
  • make -C guests/risc0 light-client-bitcoin
  • make -C guests/risc0 light-client-mock

TODO

  • Prevent build.rs for risc0 from running.
  • Every time a fork activates, we should upload the newly activated guest code to Bonsai
  • Override network if --testnet is used.
  • Pass Network argument

Linked Issues

@rakanalh rakanalh force-pushed the rakanalh/elf-compilation branch from bc84b7f to cbaaa8e Compare November 20, 2024 12:01
@rakanalh rakanalh force-pushed the rakanalh/elf-compilation branch from cbaaa8e to 1faef96 Compare November 20, 2024 12:02
@eyusufatik
Copy link
Member

Every time a fork activates, we should upload the newly activated guest code to Bonsai

btw just pass down elf from runner > prover service > zkvm host

I think bonsai doesnt upload all the time since it checks if elf exists on remote

@rakanalh rakanalh marked this pull request as ready for review November 22, 2024 10:40
@rakanalh rakanalh requested a review from eyusufatik November 29, 2024 11:56
@rakanalh rakanalh changed the title Embedded elf codes for forks Embedded elf guests for forks Nov 29, 2024
@rakanalh rakanalh force-pushed the rakanalh/elf-compilation branch from ef82dd3 to 8db236d Compare November 30, 2024 11:13
Copy link

codecov bot commented Nov 30, 2024

Codecov Report

Attention: Patch coverage is 28.77193% with 203 lines in your changes missing coverage. Please review.

Project coverage is 76.0%. Comparing base (4ac3098) to head (11c4f78).
Report is 1 commits behind head on nightly.

Files with missing lines Patch % Lines
bin/citrea/src/rollup/bitcoin.rs 0.0% 74 Missing ⚠️
bin/citrea/src/rollup/mock.rs 32.8% 47 Missing ⚠️
crates/light-client-prover/src/da_block_handler.rs 0.0% 46 Missing ⚠️
bin/citrea/src/main.rs 0.0% 15 Missing ⚠️
bin/citrea/src/rollup/mod.rs 52.9% 8 Missing ⚠️
bin/citrea/src/lib.rs 0.0% 5 Missing ⚠️
crates/light-client-prover/src/runner.rs 0.0% 4 Missing ⚠️
crates/batch-prover/src/da_block_handler.rs 84.6% 2 Missing ⚠️
crates/prover-services/src/parallel/mod.rs 88.8% 1 Missing ⚠️
...ule-system/sov-modules-rollup-blueprint/src/lib.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
crates/batch-prover/src/proving.rs 88.8% <100.0%> (+0.4%) ⬆️
crates/batch-prover/src/rpc.rs 48.8% <100.0%> (+0.3%) ⬆️
crates/batch-prover/src/runner.rs 86.9% <100.0%> (+0.1%) ⬆️
crates/fullnode/src/da_block_handler.rs 76.1% <100.0%> (ø)
crates/risc0/src/host.rs 70.5% <100.0%> (-1.1%) ⬇️
crates/sovereign-sdk/adapters/mock-zkvm/src/lib.rs 57.6% <100.0%> (+1.0%) ⬆️
...full-node/sov-stf-runner/src/prover_service/mod.rs 66.6% <ø> (ø)
...n-sdk/rollup-interface/src/state_machine/zk/mod.rs 88.8% <ø> (ø)
crates/prover-services/src/parallel/mod.rs 73.5% <88.8%> (+0.1%) ⬆️
...ule-system/sov-modules-rollup-blueprint/src/lib.rs 95.8% <0.0%> (-4.2%) ⬇️
... and 8 more

... and 2 files with indirect coverage changes

Copy link
Contributor

@yaziciahmet yaziciahmet left a comment

Choose a reason for hiding this comment

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

LGTM! not blocking the pr, just have 1 comment.

@rakanalh rakanalh merged commit e645f33 into nightly Dec 2, 2024
14 of 15 checks passed
@rakanalh rakanalh deleted the rakanalh/elf-compilation branch December 2, 2024 12:10
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.

New compilation and read ELF from files system
4 participants