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

WEB3-79: Refactor of Governance Example for RISC Zero zkVM 1.0 #197

Merged
merged 52 commits into from
Sep 14, 2024

Conversation

sashaaldrick
Copy link
Contributor

@sashaaldrick sashaaldrick commented Aug 18, 2024

This is a refactor of the original governance example located in release-0.20 here. This has been rewritten to match the foundry template layout, amongst many other features.

At a high level, this PR:

  • upgrades governance example guest to zkVM 1.0
  • deprecates Relay workflow and contracts
  • updates publisher to handle deprecated relay workflows
  • simplifies test logic for readability
  • creates gas benchmarks from these tests

For a high level walkthrough, please see README.md, and to run tests locally with benchmarking, see instructions.md.

@sashaaldrick sashaaldrick self-assigned this Aug 18, 2024
@sashaaldrick sashaaldrick requested a review from a team as a code owner August 18, 2024 18:57
@sashaaldrick sashaaldrick requested a review from nategraf August 18, 2024 18:57
@github-actions github-actions bot changed the title Refactor of Governance Example for RISC Zero zkVM 1.0 WEB3-79: Refactor of Governance Example for RISC Zero zkVM 1.0 Aug 18, 2024
@sashaaldrick
Copy link
Contributor Author

Lots of CI issues, I will take a look at a stab at fixing these later today/early this coming week

Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

Looking pretty good. Some things don't quite make sense to me.

I've also opened a PR with some minor suggestions. Feel free to merge it if it looks good to you. #226


In typical applications, an off-chain app is needed to do two main actions:

* Produce a proof (see [proving options]).
Copy link
Contributor

Choose a reason for hiding this comment

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

This link reference is broken. It'd recommend using a linter that can check for this. I use markdownlint in my editor. I'm interested in integrating markdown linting into CI, but haven't found the right approach (markdownlint itself is too noisy to enforce), so if you have any suggestions!

Suggested change
* Produce a proof (see [proving options]).
* Produce a proof (see [proving options][proving-options]).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah now I understand, thanks for that. I know Nuke had some discussions with Frank about lychee and that's now used in the main risc0 monorepo CI iirc, perhaps for consistency, it would make sense to use it in this repo as well

examples/governance/apps/README.md Outdated Show resolved Hide resolved
examples/governance/apps/README.md Outdated Show resolved Hide resolved
examples/governance/contracts/utils/ImageID.sol Outdated Show resolved Hide resolved
examples/governance/methods/guest/Cargo.toml Show resolved Hide resolved
examples/governance/methods/guest/Cargo.toml Outdated Show resolved Hide resolved
examples/governance/script/GenerateVoteData.s.sol Outdated Show resolved Hide resolved
examples/governance/tests/BaselineGovernorTest.sol Outdated Show resolved Hide resolved
examples/governance/tests/RiscZeroGovernorTest.sol Outdated Show resolved Hide resolved
examples/governance/tests/benchmarks/BenchmarkTestBase.sol Outdated Show resolved Hide resolved
@sashaaldrick sashaaldrick enabled auto-merge (squash) September 11, 2024 07:20
examples/governance/Cargo.toml Outdated Show resolved Hide resolved
examples/governance/apps/src/bin/publisher.rs Outdated Show resolved Hide resolved
examples/governance/apps/src/bin/publisher.rs Outdated Show resolved Hide resolved
examples/governance/contracts/test/Elf.sol Outdated Show resolved Hide resolved
examples/governance/methods/Cargo.toml Outdated Show resolved Hide resolved
examples/governance/methods/guest/Cargo.toml Outdated Show resolved Hide resolved
examples/governance/methods/guest/Cargo.toml Outdated Show resolved Hide resolved
examples/governance/methods/guest/Cargo.toml Outdated Show resolved Hide resolved
examples/governance/methods/guest/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for continuing to chip away at this one!

@sashaaldrick sashaaldrick merged commit 6132e94 into main Sep 14, 2024
11 checks passed
@sashaaldrick sashaaldrick deleted the sasha/governance-example branch September 14, 2024 17:50
sashaaldrick added a commit that referenced this pull request Sep 17, 2024
This is a refactor of the original governance example located in
release-0.20
[here](https://github.com/risc0/risc0/tree/release-0.20/bonsai/examples/governance).
This has been rewritten to match the foundry template layout, amongst
many other features.

At a high level, this PR:
- upgrades governance example guest to zkVM 1.0
- deprecates Relay workflow and contracts
- updates publisher to handle deprecated relay workflows
- simplifies test logic for readability
- creates gas benchmarks from these tests

For a high level walkthrough, please see
[README.md](https://github.com/risc0/risc0-ethereum/blob/a5ccf7872c3d8dfe86d42816b2388da4e27af4c3/examples/governance/README.md),
and to run tests locally with benchmarking, see
[instructions.md](https://github.com/risc0/risc0-ethereum/blob/a5ccf7872c3d8dfe86d42816b2388da4e27af4c3/examples/governance/instructions.md).

---------

Co-authored-by: Angelo Capossele <[email protected]>
Co-authored-by: Victor Graf <[email protected]>
sashaaldrick added a commit that referenced this pull request Sep 17, 2024
This is a refactor of the original governance example located in
release-0.20
[here](https://github.com/risc0/risc0/tree/release-0.20/bonsai/examples/governance).
This has been rewritten to match the foundry template layout, amongst
many other features.

At a high level, this PR:
- upgrades governance example guest to zkVM 1.0
- deprecates Relay workflow and contracts
- updates publisher to handle deprecated relay workflows
- simplifies test logic for readability
- creates gas benchmarks from these tests

For a high level walkthrough, please see
[README.md](https://github.com/risc0/risc0-ethereum/blob/a5ccf7872c3d8dfe86d42816b2388da4e27af4c3/examples/governance/README.md),
and to run tests locally with benchmarking, see
[instructions.md](https://github.com/risc0/risc0-ethereum/blob/a5ccf7872c3d8dfe86d42816b2388da4e27af4c3/examples/governance/instructions.md).

---------

Co-authored-by: Angelo Capossele <[email protected]>
Co-authored-by: Victor Graf <[email protected]>
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.

3 participants