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

Conversation

@wei3erHase

@wei3erHase wei3erHase commented Jan 29, 2026

Copy link
Copy Markdown
Member

✨ PR Description

Purpose: Add Aztec artifact registry integration to automatically upload compiled contract artifacts to devnet.aztec-registry.xyz during deployment for improved contract discoverability.

Main changes:

  • Created artifactRegistry.ts module with upload functions supporting optional, best-effort artifact uploads via environment flags
  • Integrated artifact upload into deployCounter function to automatically register Counter contract on deployment
  • Added environment configuration for registry URL, upload enablement, and strict mode error handling

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

@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
N/A N/A N/A N/A

Contract: counter

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
increment 472,292 472,292 2,253 2,253 28,872 28,872 N/A N/A

@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
N/A N/A N/A N/A

Contract: counter

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
🆕 increment 0 472,292 +Inf% 0 2,253 +Inf% 0 28,872 +Inf% N/A N/A

3 similar comments
@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
N/A N/A N/A N/A

Contract: counter

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
🆕 increment 0 472,292 +Inf% 0 2,253 +Inf% 0 28,872 +Inf% N/A N/A

@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
N/A N/A N/A N/A

Contract: counter

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
🆕 increment 0 472,292 +Inf% 0 2,253 +Inf% 0 28,872 +Inf% N/A N/A

@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
N/A N/A N/A N/A

Contract: counter

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
🆕 increment 0 472,292 +Inf% 0 2,253 +Inf% 0 28,872 +Inf% N/A N/A

@github-actions

Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
N/A N/A N/A N/A

Contract: counter

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
increment 472,292 472,292 2,253 2,253 28,872 28,872 N/A N/A

@wei3erHase
wei3erHase force-pushed the feat/contract-registry branch from 5faec71 to b2fd1e3 Compare February 2, 2026 18:53

@linearb linearb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✨ 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

Comment thread src/ts/utils.ts
Comment on lines +31 to +34
await maybeUploadArtifactToRegistry({
artifact: CounterContractArtifact,
filename: "counter_contract-Counter.json",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🐞 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.

Suggested change
await maybeUploadArtifactToRegistry({
artifact: CounterContractArtifact,
filename: "counter_contract-Counter.json",
});
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

@wei3erHase

Copy link
Copy Markdown
Member Author

Closing this PR as non required feature.

@wei3erHase wei3erHase closed this May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

1 participant