Skip to content

fix(sozo): fix pre-confirmed finality status migrations#3375

Closed
glihm wants to merge 3 commits intomainfrom
fix/sozo-pre-confirmed
Closed

fix(sozo): fix pre-confirmed finality status migrations#3375
glihm wants to merge 3 commits intomainfrom
fix/sozo-pre-confirmed

Conversation

@glihm
Copy link
Collaborator

@glihm glihm commented Nov 6, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Fixed potential crash during external contract migration when block number information is unavailable.
  • New Features

    • Added Sepolia network support for the spawn-and-move example with new configuration file.
  • Updates

    • Transaction finality status options modified; ACCEPTED_ON_L1 is no longer supported.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Ohayo, sensei! 👋

Walkthrough

This PR removes the ACCEPTED_ON_L1 finality status option, updates external contract migration logic to handle missing block numbers gracefully, and introduces Sepolia network configuration for the spawn-and-move example.

Changes

Cohort / File(s) Summary
Transaction finality status updates
bin/sozo/src/commands/options/transaction.rs
Renamed PRE-CONFIRMED to PRE_CONFIRMED, removed ACCEPTED_ON_L1 variant from finality status options (now only PRE_CONFIRMED and ACCEPTED_ON_L2), updated parser to default to ACCEPTED_ON_L2 instead of recognizing three options.
Migration external contract handling
crates/sozo/ops/src/migrate/mod.rs
Changed block number handling to use default value 0 instead of panicking when unavailable; updated deployment decision logic to treat missing deploy calls as already deployed rather than returning an error.
Example network configuration
examples/spawn-and-move/Scarb.toml, examples/spawn-and-move/dojo_sepolia.toml
Added new [profile.sepolia] section to Scarb.toml; introduced new dojo_sepolia.toml configuration file defining world metadata, models, events, contracts, external contract integrations (ERC20, ERC721, ERC1155, Bank, Saloon), and environment settings for Sepolia deployment.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • bin/sozo/src/commands/options/transaction.rs: Verify that removing ACCEPTED_ON_L1 doesn't break existing client code or documentation that references this variant; confirm parser logic correctly defaults to ACCEPTED_ON_L2 across all call sites.
  • crates/sozo/ops/src/migrate/mod.rs: Validate that defaulting block number to 0 is semantically safe for external contracts; ensure the deployment-skipping logic doesn't inadvertently bypass necessary deployment steps in edge cases.
  • Configuration files: Confirm dojo_sepolia.toml external contract definitions and constructor_data align with actual on-chain contract expectations.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title specifically references 'pre-confirmed finality status migrations', which aligns with the primary change in transaction.rs where the finality status string was updated from PRE-CONFIRMED to PRE_CONFIRMED and ACCEPTED_ON_L1 was removed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sozo-pre-confirmed

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1970e and c27eb11.

📒 Files selected for processing (4)
  • bin/sozo/src/commands/options/transaction.rs (1 hunks)
  • crates/sozo/ops/src/migrate/mod.rs (2 hunks)
  • examples/spawn-and-move/Scarb.toml (1 hunks)
  • examples/spawn-and-move/dojo_sepolia.toml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-11-07T13:57:57.616Z
Learnt from: glihm
Repo: dojoengine/dojo PR: 2650
File: bin/sozo/src/commands/migrate.rs:64-65
Timestamp: 2024-11-07T13:57:57.616Z
Learning: In the codebase, the use of `into()` and `try_into()` for converting `TransactionOptions` is intentional. Conversions that may fail use `try_into()`, while those that cannot fail use `into()`. This approach is appropriate and should be preserved.

Examples:
- `try_into()` is used in `bin/sozo/src/commands/migrate.rs` and `bin/sozo/src/commands/execute.rs` where conversions can fail.
- `into()` is used in `bin/sozo/src/commands/register.rs` and `bin/sozo/src/commands/auth.rs` where conversions are infallible.

Applied to files:

  • bin/sozo/src/commands/options/transaction.rs
  • crates/sozo/ops/src/migrate/mod.rs

Comment @coderabbitai help to get the list of available commands and usage tips.

@glihm
Copy link
Collaborator Author

glihm commented Nov 20, 2025

Included in #3377.

@glihm glihm closed this Nov 20, 2025
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.

1 participant