Skip to content

fix: missing active preset json artifact for template#1558

Merged
0xjei merged 6 commits into
mainfrom
fix/template
May 28, 2026
Merged

fix: missing active preset json artifact for template#1558
0xjei merged 6 commits into
mainfrom
fix/template

Conversation

@0xjei

@0xjei 0xjei commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores

    • SDK build/upload now includes hidden files and enforces the presence of the preset configuration in distributed artifacts.
    • Local deployment templates refreshed with updated contract addresses and deployment block numbers; obsolete verifier/library entries removed.
  • Bug Fixes

    • Artifact verification now fails the job if the required preset file is missing.
    • SDK runtime more gracefully skips preset checks when installed as a dependency and surfaces clearer errors for missing or malformed preset data.

Review Change Stack

@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
enclave-enclave-dashboard Ready Ready Preview, Comment May 28, 2026 10:20am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
crisp Skipped Skipped May 28, 2026 10:20am
enclave-docs Skipped Skipped May 28, 2026 10:20am

Request Review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4fc62102-0eea-4f67-871b-dc5fe5a5a26f

📥 Commits

Reviewing files that changed from the base of the PR and between e6edb09 and 05e5444.

📒 Files selected for processing (1)
  • packages/enclave-sdk/src/circuits/assert-micro-circuits.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/enclave-sdk/src/circuits/assert-micro-circuits.ts

📝 Walkthrough

Walkthrough

CI now uploads hidden files and explicitly includes circuits/bin/.active-preset.json in SDK artifacts; the template integration step verifies the file. SDK code now computes the active preset path by locating the package root. Localhost deployment templates and enclave config have updated addresses and deploy_block values.

Changes

CI artifact and template updates

Layer / File(s) Summary
CI artifact upload and verification
.github/workflows/ci.yml
build_sdk enables include-hidden-files: true, adds circuits/bin/.active-preset.json to uploaded paths, and sets if-no-files-found: error. template_integration adds an existence check for circuits/bin/.active-preset.json.
SDK active preset path resolution
packages/enclave-sdk/src/circuits/assert-micro-circuits.ts
Resolve ACTIVE_PRESET_PATH by walking to the SDK package root (package.json), prefer bundled .active-preset.json, return null when running under node_modules, add existsSync usage, and short-circuit assertSdkMicroCircuits() when path is null; new SDKError code SDK_CIRCUIT_STAMP_MISSING is thrown when the package root is not found.
Deployed contracts metadata updates
templates/default/deployed_contracts.json
Updated blockNumber and/or address values for multiple localhost contracts (MockUSDC, EnclaveTicketToken, SlashingManager, CiphernodeRegistryOwnable, BondingRegistry, Enclave, E3RefundManager, and several mocks); removed several verifier/library entries; updated ImageID and MyProgram metadata.
Enclave config contract entries
templates/default/enclave.config.yaml
Replaced enclave address, adjusted ciphernode_registry, bonding_registry, fee_token deploy_block values, and updated e3_program address and deploy_block.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • gnosisguild/enclave#1113: Related CI workflow changes around SDK artifact build/upload/download and integration verification.

Suggested reviewers

  • cedoor
  • ctrlc03

Poem

A rabbit hopped the CI trail,
Hid the preset in its tail,
It climbed the root and gave a cheer,
Artifacts safe, the checks are clear. 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: ensuring the .active-preset.json artifact is included in template builds and validated during integration tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/template

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/enclave-sdk/src/circuits/assert-micro-circuits.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Line 1160: Update the CI job so missing circuits/bin/.active-preset.json
causes a hard failure: in the artifact upload step change if-no-files-found from
"warn" to "error", and replace the verification command `ls -la
circuits/bin/.active-preset.json || echo "circuit preset stamp not found"` with
a failing check such as `test -f circuits/bin/.active-preset.json || (echo
"ERROR: circuit preset stamp not found" && exit 1)` so the job fails when the
stamp is absent; ensure both the upload configuration and the verification
command are updated consistently.
- Line 1039: The CI currently permits missing circuits/bin/.active-preset.json;
update .github/workflows/ci.yml so the artifact upload step that lists
circuits/bin/.active-preset.json does not use if-no-files-found: warn (make it
fail on missing files), and make the later download/verification step fail the
job when .active-preset.json is not present (remove any
continue-on-error/optional flags or set an explicit failure on missing
artifact). This ensures the output produced by scripts/build-circuits.ts is
required and that scripts/generate-verifiers.ts (when run in CI) will not
proceed without the .active-preset.json artifact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4785cf62-ec20-4f8d-b258-4a756ddba06b

📥 Commits

Reviewing files that changed from the base of the PR and between a6d7efc and 433b966.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/default/enclave.config.yaml`:
- Around line 23-25: The YAML contains a duplicated contract key "e3_program"
under the "contracts" mapping which causes ambiguous semantics and lint
failures; remove the duplicate entry so "contracts" contains a single
"e3_program" mapping (keep the correct address/deploy_block from the intended
entry) and ensure there is only one "e3_program" key in
templates/default/enclave.config.yaml so the "contracts" mapping is unique and
valid.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a628fa44-f9fe-4d2c-8c51-dbaddfb04a8e

📥 Commits

Reviewing files that changed from the base of the PR and between fe2f441 and 6e45119.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • templates/default/deployed_contracts.json
  • templates/default/enclave.config.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

Comment thread templates/default/enclave.config.yaml Outdated
ctrlc03
ctrlc03 previously approved these changes May 28, 2026

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/enclave-sdk/src/circuits/assert-micro-circuits.ts (1)

29-29: 💤 Low value

Consider using a distinct error code for package root lookup failure.

Both line 29 (can't find package root) and line 51 (can't read preset file) throw SDK_CIRCUIT_STAMP_MISSING. While the error messages clearly distinguish the scenarios, using different codes (e.g., SDK_PACKAGE_ROOT_NOT_FOUND for line 29) would make programmatic error handling and log filtering easier.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/enclave-sdk/src/circuits/assert-micro-circuits.ts` at line 29, The
throw in assert-micro-circuits.ts that constructs SDKError('Could not locate SDK
package root', 'SDK_CIRCUIT_STAMP_MISSING') should use a distinct error code
(e.g., 'SDK_PACKAGE_ROOT_NOT_FOUND') so it is distinguishable from the
preset-file read error which keeps 'SDK_CIRCUIT_STAMP_MISSING'; update the
SDKError instantiation at that location to use the new code while leaving the
message intact and do not change the throw at the preset-file read site.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/enclave-sdk/src/circuits/assert-micro-circuits.ts`:
- Around line 16-30: findActivePath currently always resolves
../../circuits/bin/.active-preset.json relative to the package root which
escapes node_modules for external consumers; update findActivePath to first look
for a bundled preset inside the package (e.g., resolve(dir,
'./.active-preset.json' or in dist) and return that if exists, and only if not
running from node_modules (detect via dir.includes('node_modules') or similar)
fall back to the monorepo path resolve(dir,
'../../circuits/bin/.active-preset.json'); if neither path exists, throw the
existing SDKError('Could not locate SDK package
root','SDK_CIRCUIT_STAMP_MISSING'). Ensure changes are made inside the
findActivePath function and reference the '.active-preset.json' filename and
SDKError symbol.

---

Nitpick comments:
In `@packages/enclave-sdk/src/circuits/assert-micro-circuits.ts`:
- Line 29: The throw in assert-micro-circuits.ts that constructs SDKError('Could
not locate SDK package root', 'SDK_CIRCUIT_STAMP_MISSING') should use a distinct
error code (e.g., 'SDK_PACKAGE_ROOT_NOT_FOUND') so it is distinguishable from
the preset-file read error which keeps 'SDK_CIRCUIT_STAMP_MISSING'; update the
SDKError instantiation at that location to use the new code while leaving the
message intact and do not change the throw at the preset-file read site.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fe6777e4-ecbe-45ab-b86e-cefddbc61131

📥 Commits

Reviewing files that changed from the base of the PR and between 6e45119 and e6edb09.

📒 Files selected for processing (2)
  • packages/enclave-sdk/src/circuits/assert-micro-circuits.ts
  • templates/default/enclave.config.yaml
💤 Files with no reviewable changes (1)
  • templates/default/enclave.config.yaml

Comment thread packages/enclave-sdk/src/circuits/assert-micro-circuits.ts Outdated
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@0xjei 0xjei merged commit a817b88 into main May 28, 2026
34 checks passed
@ctrlc03 ctrlc03 deleted the fix/template branch May 28, 2026 10: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