Skip to content

feat(sozo): add voyager contract verification - #3288

Merged
glihm merged 17 commits into
dojoengine:release-1.6.0from
ametel01:voyager-verify-support-1.6.0
Jul 26, 2025
Merged

feat(sozo): add voyager contract verification#3288
glihm merged 17 commits into
dojoengine:release-1.6.0from
ametel01:voyager-verify-support-1.6.0

Conversation

@ametel01

Copy link
Copy Markdown
Contributor

Description

Full PR description in #3287

Tests

  • Yes
  • No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed

Checklist

  • I've formatted my code (scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

@glihm glihm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Amazing work there @ametel01 and thank you for taking the time on that.

I've made some rust comments and design comments.
Very happy to discuss those and if you don't have the bandwidth, we could keep that for a future refactor. But it shouldn't affect that much your current work, only on the config and option. 👍

Comment thread bin/sozo/src/commands/options/verify.rs Outdated
Comment thread bin/sozo/src/commands/options/verify.rs Outdated
Comment thread bin/sozo/src/commands/options/verify.rs Outdated
Comment thread bin/sozo/src/commands/migrate.rs Outdated
Comment thread bin/sozo/src/commands/migrate.rs Outdated
Comment thread crates/sozo/ops/src/migrate/mod.rs Outdated
Comment thread crates/sozo/ops/src/migrate/mod.rs Outdated
Comment thread crates/sozo/ops/src/migrate/error.rs Outdated
Comment thread crates/sozo/voyager/src/analyzer.rs Outdated
ametel01 added 7 commits July 24, 2025 17:04
Changes the verification option to use an enum for specifying the service.
This allows for better type safety and clarity when selecting a verification
service, replacing the previous string-based approach.
Also introduces dedicated structs for better organization.
Simplifies contract verification by removing the optional `verification_config` and introducing a `VerificationConfig` enum to handle different verification service options (Voyager, Custom, None).

This change streamlines the migration process and improves code clarity.
Decouples verification config creation from migration initialization, allowing for a more flexible and fluent builder pattern.

This change provides an easier way to configure and apply verification to migrations by using builder pattern.
Renames the `with_verification_config` function to `with_verification` for better clarity and consistency.

This change simplifies the API by providing a more intuitive name that directly reflects the function's purpose of enabling verification for a migration.
Migrates contract verification process to utilize `WorldLocal` instead of directly parsing the manifest file.

This change ensures that contract verification leverages the local world state, providing a more accurate and reliable verification process. It also adds the `dojo-world` dependency to the voyager crate. A target directory is now configurable, allowing for flexible artifact loading during migration.
@ametel01
ametel01 requested a review from glihm July 24, 2025 10:42

@glihm glihm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great iteration on the review, some additional comments to ensure extensibility and we should be almost good to go.

Does Voyager have an API for testing where we could eventually add an integration test calling the API, or not at the moment?

Will run some tests with some dojo projects and we should be good to move forward for this first iteration.

Comment thread crates/sozo/voyager/src/analyzer.rs Outdated
Comment thread crates/sozo/ops/src/migrate/mod.rs
Comment thread crates/sozo/voyager/src/verifier.rs Outdated
Comment thread crates/sozo/voyager/src/config.rs Outdated
Comment thread crates/sozo/voyager/src/utils.rs Outdated
ametel01 added 4 commits July 25, 2025 12:30
  1. Removed the deprecated method: The discover_contract_artifacts method that was reading from manifest
  files has been completely removed from analyzer.rs:108-176.
  2. Updated the test: The test test_discover_contract_artifacts_from_world now uses the new
  discover_contract_artifacts_from_world method that relies on WorldLocal instead of the deprecated
  manifest-based approach.
  3. Cleaned up unused code: Removed the unused extract_contract_name_from_tag method and its associated
  test, as well as the unused find_manifest_file helper method.
  4. Removed unused imports: Cleaned up the Manifest import and starknet_crypto::Felt import that were no
  longer needed.
  5. Fixed clippy warnings: Removed the problematic assert!(true) that was flagged by clippy.

  The codebase now uses the modern discover_contract_artifacts_from_world method that works with WorldLocal
   instances, which is more robust and doesn't rely on the deprecated manifest file parsing approach. All
  tests are updated and passing.
@ametel01
ametel01 requested a review from glihm July 25, 2025 05:04
Adds support for non-watch contract verification mode, which submits all contracts for verification in parallel without waiting for each one to complete.

Provides a summary URL for tracking verification status in non-watch mode.
Also includes job status URLs in the verification result messages.
@ametel01

Copy link
Copy Markdown
Contributor Author

Does Voyager have an API for testing where we could eventually add an integration test calling the API, or not at the moment?

Will run some tests with some dojo projects and we should be good to move forward for this first iteration.

Sadly we don't have a testing api, i'm running tests locally with docker but voyager is closed source so it will not work for you. You can use --verifiy voyager-dev which is our development deployment, you should be able to verify any class declared on mainnet already.

@glihm glihm mentioned this pull request Jul 25, 2025
10 tasks
@glihm glihm changed the title Applied voyager support to realease-1.6.0 feat(sozo): add voyager contract verification Jul 25, 2025

@glihm glihm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the great work here @ametel01! Let's move forward for a first version.

Maybe some logic you have used in the voyager crate could be re-use and refactored for other services in the future. :thus

@glihm

glihm commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

Sadly we don't have a testing api, i'm running tests locally with docker but voyager is closed source so it will not work for you. You can use --verifiy voyager-dev which is our development deployment, you should be able to verify any class declared on mainnet already.

Related to that, we could add some integration test with the spawn and move example. We could have this example being deployed on mainnet, and after that check it on the voyager-dev. Will see if I can add that later on. 🫡

@glihm
glihm merged commit 94205d6 into dojoengine:release-1.6.0 Jul 26, 2025
9 of 10 checks passed
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