Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR systematically upgrades the Compact language version from 0.21.0 to 0.22.0 across all contract files, updates dependencies (compact-runtime 0.14.0→0.15.0, ledger-v7→ledger-v8, yarn 4.12.0→4.13.0), updates version constants, refreshes import paths in test utilities, and adds documentation for testing unreleased compiler versions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/compact/README.md (1)
113-115:⚠️ Potential issue | 🟡 MinorUnclosed code block.
Line 113 opens a code block section but there's no closing ``` before the next section header on line 115. This will cause rendering issues.
Proposed fix
# Build specific directory and skip proving key generation compact-builder --dir token --skip-zk +``` ## Programmatic API🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/compact/README.md` around lines 113 - 115, Close the unclosed fenced code block that starts with the line containing "compact-builder --dir token --skip-zk" by adding a closing triple backtick (```) immediately before the "## Programmatic API" header so the code block is terminated properly; locate the open block by searching for that command string and ensure the README's sections render correctly by inserting the closing fence just above the "## Programmatic API" heading.
🧹 Nitpick comments (3)
packages/compact/install-local.sh (2)
51-51: Quote version variable and add trailing newline.The
$REPORTED_COMPACT_VERSIONvariable should be quoted in case the version string contains unexpected characters. Also, the file is missing a trailing newline.Proposed fix
-compact update $REPORTED_COMPACT_VERSION +compact update "$REPORTED_COMPACT_VERSION" +🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/compact/install-local.sh` at line 51, Quote the version variable in the compact update invocation and ensure the script ends with a trailing newline: change the command that calls compact update to use the quoted variable "$REPORTED_COMPACT_VERSION" (so the compact update invocation handles any special chars or whitespace) and add a final newline at the end of the install-local.sh file.
46-51: Consider adding validation before executing compactc binary.The script assumes
$REPO_PATH/result/bin/compactcexists without checking. If the build step failed or the binary is missing, the error message won't be clear.Proposed improvement
# compact-compiler tool requires the destination path version to match the reported compact version from the binary +COMPACTC_BIN="$REPO_PATH/result/bin/compactc" +if [[ ! -x "$COMPACTC_BIN" ]]; then + echo "Error: compactc binary not found or not executable at '$COMPACTC_BIN'" >&2 + echo "Did you run 'nix build .#compactc-binary' first?" >&2 + exit 1 +fi + -REPORTED_COMPACT_VERSION=$("$REPO_PATH/result/bin/compactc" --version | tail -n1) +REPORTED_COMPACT_VERSION=$("$COMPACTC_BIN" --version | tail -n1) DEST="$HOME/.compact/versions/$REPORTED_COMPACT_VERSION/$PLATFORM" mkdir -p "$DEST" cp -r "$REPO_PATH/result/bin/." "$DEST/" echo "Installed $GIT_TAG ($PLATFORM) to $DEST" compact update $REPORTED_COMPACT_VERSION🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/compact/install-local.sh` around lines 46 - 51, Add validation to ensure the built compactc binary exists and is executable before invoking it: check the file referenced by "$REPO_PATH/result/bin/compactc" (used to compute REPORTED_COMPACT_VERSION) and if missing or not executable, print a clear error referencing the path and suggested action (e.g., build step failed), then exit non‑zero; only proceed to compute REPORTED_COMPACT_VERSION, create DEST, copy files, and run compact update if the check passes.packages/compact/src/versions.ts (1)
1-2: Version constants updated, but README examples remain at 0.29.0.The version constants are correctly bumped to
0.30.0and0.22.0. However,packages/compact/README.mdstill shows0.29.0in multiple example outputs and CLI usage (e.g., lines 14, 40, 77, 125, 134, 235, 238, 239). Consider updating those examples to reflect the new version for consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/compact/src/versions.ts` around lines 1 - 2, The README examples still show the old version strings; update the example outputs and CLI usage in the README.md to match the bumped constants COMPACT_VERSION ('0.30.0') and LANGUAGE_VERSION ('0.22.0'). Locate occurrences of the old '0.29.0' examples in packages/compact README.md (example outputs and CLI snippets) and replace them with the new version strings, ensuring any inline examples, sample command outputs, and help text consistently reflect COMPACT_VERSION and LANGUAGE_VERSION.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/compact/README.md`:
- Around line 113-115: Close the unclosed fenced code block that starts with the
line containing "compact-builder --dir token --skip-zk" by adding a closing
triple backtick (```) immediately before the "## Programmatic API" header so the
code block is terminated properly; locate the open block by searching for that
command string and ensure the README's sections render correctly by inserting
the closing fence just above the "## Programmatic API" heading.
---
Nitpick comments:
In `@packages/compact/install-local.sh`:
- Line 51: Quote the version variable in the compact update invocation and
ensure the script ends with a trailing newline: change the command that calls
compact update to use the quoted variable "$REPORTED_COMPACT_VERSION" (so the
compact update invocation handles any special chars or whitespace) and add a
final newline at the end of the install-local.sh file.
- Around line 46-51: Add validation to ensure the built compactc binary exists
and is executable before invoking it: check the file referenced by
"$REPO_PATH/result/bin/compactc" (used to compute REPORTED_COMPACT_VERSION) and
if missing or not executable, print a clear error referencing the path and
suggested action (e.g., build step failed), then exit non‑zero; only proceed to
compute REPORTED_COMPACT_VERSION, create DEST, copy files, and run compact
update if the check passes.
In `@packages/compact/src/versions.ts`:
- Around line 1-2: The README examples still show the old version strings;
update the example outputs and CLI usage in the README.md to match the bumped
constants COMPACT_VERSION ('0.30.0') and LANGUAGE_VERSION ('0.22.0'). Locate
occurrences of the old '0.29.0' examples in packages/compact README.md (example
outputs and CLI snippets) and replace them with the new version strings,
ensuring any inline examples, sample command outputs, and help text consistently
reflect COMPACT_VERSION and LANGUAGE_VERSION.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2ba0c4e3-e6b8-4eec-b48c-74d02415b8c4
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (32)
README.mdcontracts/src/access/AccessControl.compactcontracts/src/access/Ownable.compactcontracts/src/access/ZOwnablePK.compactcontracts/src/access/test/mocks/MockAccessControl.compactcontracts/src/access/test/mocks/MockOwnable.compactcontracts/src/access/test/mocks/MockZOwnablePK.compactcontracts/src/archive/ShieldedToken.compactcontracts/src/archive/test/mocks/MockShieldedToken.compactcontracts/src/archive/test/utils/address.tscontracts/src/security/Initializable.compactcontracts/src/security/Pausable.compactcontracts/src/security/test/mocks/MockInitializable.compactcontracts/src/security/test/mocks/MockPausable.compactcontracts/src/token/FungibleToken.compactcontracts/src/token/MultiToken.compactcontracts/src/token/NonFungibleToken.compactcontracts/src/token/test/mocks/MockFungibleToken.compactcontracts/src/token/test/mocks/MockMultiToken.compactcontracts/src/token/test/mocks/MockNonFungibleToken.compactcontracts/src/utils/Utils.compactcontracts/src/utils/test/mocks/MockUtils.compactcontracts/test-utils/address.tspackage.jsonpackages/compact/README.mdpackages/compact/install-local.shpackages/compact/src/versions.tspackages/simulator/package.jsonpackages/simulator/test/fixtures/sample-contracts/SampleZOwnable.compactpackages/simulator/test/fixtures/sample-contracts/Simple.compactpackages/simulator/test/fixtures/sample-contracts/Witness.compactpackages/simulator/test/fixtures/utils/address.ts
…om/OpenZeppelin/midnight-contracts into refactor/upgrade-contracts-to-0.30
Bumps yarn version, pragma versions in contracts dir, bumps
compact-runtimeandledgerpackages to latestSummary by CodeRabbit
Chores
Documentation