Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.

feat: registering to aztec registry on deployment - #102

Closed
wei3erHase wants to merge 3 commits into
devfrom
feat/contract-registry
Closed

feat: registering to aztec registry on deployment#102
wei3erHase wants to merge 3 commits into
devfrom
feat/contract-registry

Merge branch 'dev' of https://github.com/defi-wonderland/aztec-boiler…

b2fd1e3
Select commit
Loading
Failed to load commit list.
LinearB / lb/linearb_ai_review succeeded Feb 18, 2026 in 6s

code-review@v1

code-review@v1: add code-review comment:

✨ PR Review

The PR adds artifact registry upload functionality during contract deployment. The implementation includes appropriate environment variable configuration and best-effort upload by default. However, there are two significant issues with error handling and deployment flow that should be addressed.

2 issues detected:

🐞 Bug - String values from failed JSON parsing are incorrectly returned as response objects via unsafe type assertions.

Details: When the server returns a successful response (200 or 409) with non-JSON content, safeJsonParse returns the raw string, which is then type-cast to ArtifactRegistryUploadResponse. This causes the function to return a string instead of a proper response object, breaking the contract for callers expecting an object with a 'success' field.
File: src/ts/artifactRegistry.ts

🐞 Bug - Function throws after successful deployment in strict mode, hiding the deployed contract and violating atomic operation principles. 🛠️

Details: The artifact upload occurs after contract deployment completes. In strict mode, if the upload fails, the contract is already deployed but the function throws an error. This creates an inconsistent state where the caller receives an error but the deployment actually succeeded, potentially leading to confusion, lost contract references, or duplicate deployments on retry.
File: src/ts/utils.ts (31-34)
🛠️ A suggested code correction is included in the review comments.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how


💡 Code Suggestions

src/ts/utils.ts:31-34 🐞 Bug - Deployment State Inconsistency: Either move the upload before deployment (if feasible), or catch upload errors and return the contract with a warning/metadata about upload failure instead of throwing. Alternatively, clearly document this behavior and consider returning both the contract and upload result in a structured response.

  try {
    await maybeUploadArtifactToRegistry({
      artifact: CounterContractArtifact,
      filename: "counter_contract-Counter.json",
    });
  } catch (uploadError) {
    console.warn("Failed to upload artifact to registry:", uploadError);
  }
Is this review accurate? Use 👍 or 👎 to rate it

If you want to tell us more, use /gs feedback e.g. /gs feedback this review doesn't make sense, I disagree, and it keeps repeating over and over