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

feat: add saya service #1495

Merged
merged 10 commits into from
Feb 1, 2024
Merged

feat: add saya service #1495

merged 10 commits into from
Feb 1, 2024

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Jan 31, 2024

This PR aims at adding the basis for Saya service.
Saya service is responsible of the settlement of a Katana instance.

Here's a recap for Saya's needs:

  • Data availability: to publish the state update. Currently only celestia is supported.
  • Trace generation: using SNOS in rust, Saya must generate the trace corresponding to the state transition. This is the next step that should be covered.
  • Facts registry: Once the trace is generated, we can compute the fact for the state transition, which can be optimistically registered on the settlement layer.
  • Proof generation: The trace and the facts are then sent to a prover in order to generate the proof related to them. Once generated, the proof is sent to the settlement layer verifier with the facts.

This PR adds the skeleton of Saya, where the DA part is first implemented.
Example of usage:

cargo run --bin saya -- --rpc-url http://localhost:5050 --da-chain celestia --celestia-node-url http://127.0.0.1:26658 --celestia-namespace glihm --celestia-node-auth-token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.....

For the other steps, we still depend on external dependencies. Once they are all updated, we will be able to update Saya to support them.

I will open some issues to keep improving Saya's service, like:

  1. Add a all-in-one toml file to configure all Saya service (DA, prover, etc...).
  2. Improve options CLI.
  3. Add a RPC server to query data from Saya and current progress.
  4. Add some parallelism when it's possible, as Saya will inevitably be lagging due to the settlement layer being slower than Katana.
  5. Add testing on args and CLI side of things.

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 585 lines in your changes are missing coverage. Please review.

Comparison is base (374f2bf) 70.06% compared to head (c2b6f11) 69.81%.
Report is 14 commits behind head on main.

Files Patch % Lines
bin/katana/src/main.rs 0.00% 94 Missing ⚠️
crates/katana/runner/src/logs.rs 10.00% 72 Missing ⚠️
bin/saya/src/main.rs 0.00% 56 Missing ⚠️
crates/saya/core/src/lib.rs 0.00% 50 Missing ⚠️
bin/saya/src/args/mod.rs 0.00% 33 Missing ⚠️
crates/katana/primitives/src/genesis/mod.rs 92.71% 33 Missing ⚠️
...es/saya/core/src/data_availability/celestia/mod.rs 0.00% 33 Missing ⚠️
crates/katana/runner/src/prefunded.rs 0.00% 31 Missing ⚠️
bin/saya/src/args/data_availability.rs 0.00% 24 Missing ⚠️
bin/sozo/src/ops/migration/mod.rs 30.30% 23 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1495      +/-   ##
==========================================
- Coverage   70.06%   69.81%   -0.25%     
==========================================
  Files         236      257      +21     
  Lines       22531    24453    +1922     
==========================================
+ Hits        15786    17073    +1287     
- Misses       6745     7380     +635     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glihm glihm marked this pull request as ready for review January 31, 2024 03:08
@kariy
Copy link
Member

kariy commented Jan 31, 2024

Awesome work @glihm!

Looks good so far nothing out of the ordinary from what I've seen. I'm keen on merging this straight away as it's just meant to set the foundation of Saya.

Do you mind listing out blockers/stuff from external dependencies that we may have to wait for in the Saya's README ? Would be helpful in understanding the high level overview of external dependencies that Saya's relies on.

Also we may want to exclude building saya binary from the release ci considering it's only the basic implementation atm.

crates/saya/core/Cargo.toml Outdated Show resolved Hide resolved
@glihm
Copy link
Collaborator Author

glihm commented Jan 31, 2024

Also we may want to exclude building saya binary from the release ci considering it's only the basic implementation atm.

As discussed, it is not included in the archive, but only in the build. Thanks for pointing this out anyway @kariy. 🙏

@glihm glihm mentioned this pull request Feb 1, 2024
@glihm glihm merged commit 11bbf57 into dojoengine:main Feb 1, 2024
11 of 12 checks passed
@glihm glihm deleted the feat/saya-intro branch February 17, 2024 20:51
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