Skip to content

chore: code rabbit#17

Merged
zkfrov merged 7 commits into
test/jsfrom
chore/code-rabbit
Feb 26, 2026
Merged

chore: code rabbit#17
zkfrov merged 7 commits into
test/jsfrom
chore/code-rabbit

Conversation

@zkfrov
Copy link
Copy Markdown
Collaborator

@zkfrov zkfrov commented Feb 11, 2026

🤖 Linear

Closes AZT-XXX

✨ PR Description

Purpose: Add production-ready TypeScript SDK and comprehensive benchmarking infrastructure to enable initializerless account deployment with persistent capsule storage for the Aztec immutables macro pattern.

Main changes:

  • Implemented generic deployWithImmutables utility with automatic PXE capsule persistence and artifact introspection via #[abi(immutables)] layout
  • Added account comparison benchmark measuring 516,258 gate initialization cost savings versus 1,098 gate per-transaction overhead
  • Created Immutables::store() method with salt validation to enable PXE recovery after data loss

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • dev
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

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

@zkfrov zkfrov changed the base branch from feat/constant-account to test/js February 23, 2026 20:46
@linearb linearb Bot added the 5 min review label Feb 23, 2026
@linearb
Copy link
Copy Markdown

linearb Bot commented Feb 23, 2026

✨ PR Review

The PR introduces a comprehensive implementation of the initializerless immutables pattern with TypeScript deployment utilities, benchmarks, and extensive test coverage. The code is generally well-structured, but there are potential runtime errors from unsafe array access patterns in production library code.

3 issues detected:

🐞 Bug - Array access without bounds checking can cause runtime errors if the wallet has no registered accounts 🛠️

Details: The code accesses the first element of the accounts array without checking if the array is empty. If wallet.getAccounts() returns an empty array, this will cause a runtime error. This is in a public utility function that external users will call.
File: src/ts/immutables/index.ts (439-439)
🛠️ A suggested code correction is included in the review comments.

🐞 Bug - Assumes wallet always has at least one account without validation, risking runtime errors 🛠️

Details: The deployer address is retrieved by accessing the first account without verifying the array is non-empty. If wallet.getAccounts() returns an empty array, this will throw an uncaught TypeError at runtime.
File: src/ts/schnorr-account/utils.ts (99-99)
🛠️ A suggested code correction is included in the review comments.

🐞 Bug - Array indexing without bounds check risks TypeError on empty wallet 🛠️

Details: Same unsafe array access pattern as the other function - retrieves deployer address without checking if accounts array is empty, which will cause a runtime error if the wallet has no registered accounts.
File: src/ts/schnorr-account/utils.ts (157-157)
🛠️ 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

@github-actions
Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
AMD EPYC 7763 64-Core Processor 16 63 GiB x64

Contract: account

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
🆕 Immutables Account: transfer_private_to_private 0 550,774 +Inf% 0 22,016 +Inf% 0 512 +Inf% N/A 7,056 +Inf%
🆕 Immutables Account: transfer_private_to_public 0 588,359 +Inf% 0 12,800 +Inf% 0 149,749 +Inf% N/A 7,467 +Inf%
🆕 Standard Account: deploy + initialize 0 516,258 +Inf% 0 12,288 +Inf% 0 512 +Inf% N/A 6,918 +Inf%
🆕 Standard Account: transfer_private_to_private 0 549,676 +Inf% 0 22,016 +Inf% 0 512 +Inf% N/A 7,008 +Inf%
🆕 Standard Account: transfer_private_to_public 0 587,261 +Inf% 0 12,800 +Inf% 0 149,749 +Inf% N/A 7,358 +Inf%

Comment thread .coderabbit.yaml
Comment thread .coderabbit.yaml Outdated
Project configuration. Verify:
- All @aztec/* dependency versions are aligned with each other.
- packageManager field is present and matches the expected Yarn version.
- Node.js engine requirements are specified (>=22).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

=22

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread .coderabbit.yaml Outdated
- All @aztec/* dependency versions are aligned with each other.
- packageManager field is present and matches the expected Yarn version.
- Node.js engine requirements are specified (>=22).
- Node.js engine requirements must pin an exact version (e.g., "22"), not a range (no >= or ~). The pinned version must be 22 or higher.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the version HAS to be 22. No?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dive a bit an yes, pinned it to =22.

@github-actions
Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
AMD EPYC 7763 64-Core Processor 16 63 GiB x64

Contract: account

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
Immutables Account: transfer_private_to_private 550,774 550,774 22,016 22,016 512 512 7,226 7,064 -162 (-2.2%)
Immutables Account: transfer_private_to_public 588,359 588,359 12,800 12,800 149,749 149,749 7,536 7,472 -64 (-0.8%)
Standard Account: deploy + initialize 516,258 516,258 12,288 12,288 512 512 7,066 6,899 -167 (-2.4%)
Standard Account: transfer_private_to_private 549,676 549,676 22,016 22,016 512 512 7,154 7,053 -101 (-1.4%)
Standard Account: transfer_private_to_public 587,261 587,261 12,800 12,800 149,749 149,749 7,574 7,393 -181 (-2.4%)

@github-actions
Copy link
Copy Markdown

Benchmark Comparison

CPU Cores RAM Arch
AMD EPYC 7763 64-Core Processor 16 63 GiB x64

Contract: account

Function Gates DA Gas L2 Gas Proving Time (ms)
Status Base PR Diff Base PR Diff Base PR Diff Base PR Diff
Immutables Account: transfer_private_to_private 550,774 550,774 22,016 22,016 512 512 7,226 7,010 -216 (-3.0%)
Immutables Account: transfer_private_to_public 588,359 588,359 12,800 12,800 149,749 149,749 7,536 7,375 -161 (-2.1%)
Standard Account: deploy + initialize 516,258 516,258 12,288 12,288 512 512 7,066 6,917 -149 (-2.1%)
Standard Account: transfer_private_to_private 549,676 549,676 22,016 22,016 512 512 7,154 6,988 -166 (-2.3%)
Standard Account: transfer_private_to_public 587,261 587,261 12,800 12,800 149,749 149,749 7,574 7,372 -202 (-2.7%)

@zkfrov zkfrov merged commit edafaef into test/js Feb 26, 2026
4 checks passed
@zkfrov zkfrov deleted the chore/code-rabbit branch February 26, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants