dojo
dojo copied to clipboard
Persistent mode for saya using mock of SNOS
Description
I added a Cairo 1 program simulating SNOS, committing to piltover.
Related issue
Tests
The full development flow is in this script: bin/saya/saya.sh.
- [x] Yes
- [ ] No, because they aren't needed
- [ ] No, because I need help
Added to documentation?
- [x] README.md
- [ ] Dojo Book
- [ ] No documentation needed
Checklist
- [x] I've formatted my code (
scripts/prettier.sh,scripts/rust_fmt.sh,scripts/cairo_fmt.sh) - [x] I've linted my code (
scripts/clippy.sh,scripts/docs.sh) - [x] I've commented my code
- [x] I've requested a review after addressing the comments
Summary by CodeRabbit
-
New Features
- Introduced flexible dependency management for improved maintenance and future updates.
- Enhanced command-line interface with new and modified flags for better clarity and usability.
- Implemented structured options for operational modes and contract addresses.
- Added batch processing capabilities and improved transaction handling for StarkNet interactions.
- Introduced new configuration parameters for block processing and proof generation.
- Streamlined deployment process with a new setup script for blockchain environments.
- Added support for new proving programs and enhanced handling of Cairo versions.
- Introduced a new error handling structure for better reporting and debugging.
- Added a new method for publishing checkpoints to the data availability layer.
-
Bug Fixes
- Resolved previous workaround regarding
world_address, enhancing deployment instructions.
- Resolved previous workaround regarding
-
Documentation
- Updated README with expanded deployment instructions and command-line options.
- Revised configuration files to reflect new operational parameters and batch processing settings.
-
Chores
- Cleaned up unused imports and improved code readability across various modules.
Codecov Report
Attention: Patch coverage is 19.20821% with 551 lines in your changes missing coverage. Please review.
Project coverage is 68.54%. Comparing base (
e591364) to head (e47f0d1). Report is 6 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2253 +/- ##
==========================================
+ Coverage 67.73% 68.54% +0.80%
==========================================
Files 388 387 -1
Lines 50421 49902 -519
==========================================
+ Hits 34153 34203 +50
+ Misses 16268 15699 -569
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Walkthrough
Ohayo, sensei! The changes involve updates to dependency specifications in Cargo.toml, modifications to method signatures for enhanced flexibility, and significant enhancements within the Saya framework. Key updates include reintroducing the starknet dependency, updating versions for celestia-rpc, celestia-types, and several other dependencies, along with the addition of new dependencies like cairo1-playground and herodotus_sharp_playground. The SayaArgs structure has been updated to include new fields for block processing and settlement options. Overall, these changes reflect a comprehensive restructuring aimed at improving the framework's maintainability and functionality.
Changes
| Files | Change Summary |
|---|---|
Cargo.toml |
Reintroduced starknet as a workspace dependency, updated versions for celestia-rpc, celestia-types, and several other dependencies, added new dependencies like cairo1-playground, herodotus_sharp_playground, and reqwest. |
bin/saya/README.md |
Restructured and updated documentation for Saya, emphasizing its role as a CLI service and detailing setup instructions, usage examples, and workflows for deploying contracts and running transactions. |
bin/saya/src/args/mod.rs |
Modified SayaArgs structure to include end_block and settlement fields, updated try_from implementation for SayaConfig to accommodate new fields. |
bin/saya/src/args/proof.rs |
Updated import for Felt type from katana_primitives to starknet::core::types, affecting ProofOptions struct fields. |
bin/saya/src/args/settlement.rs |
Introduced SettlementOptions struct for handling settlement options in CLI, including saya_mode and settlement_contract. |
crates/saya/core/src/lib.rs |
Enhanced SayaConfig and Saya struct to support new fields and refined block processing logic based on operational modes. |
crates/saya/core/src/prover/client.rs |
Updated http_prove function to accept Vec<Felt> and introduced a new sharp_prove function for proof generation using SharpSdk. |
crates/saya/core/src/prover/loader.rs |
Updated input handling by replacing Cairo0ProverInput with CairoProverInput, and modified return types for load_program and prepare_input_cairo functions for improved error handling. |
crates/saya/core/src/verifier/starknet.rs |
Updated starknet_verify function to streamline transaction handling and enhance proof data chunking. |
crates/saya/core/src/verifier/utils.rs |
Introduced wait_for_sent_transaction function for monitoring transaction status until confirmation or timeout. |
Possibly related PRs
- #2433: This PR involves renaming
FieldElementtoFelt, which is relevant as the main PR updates dependencies that includeFelttypes, indicating a shift in type usage across the codebase. - #2482: This PR focuses on renaming contract interface methods for consistency, which may relate to the overall restructuring and updates in the main PR that enhance the functionality and integration of the
saya-corepackage.
Suggested reviewers
- glihm
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.