Skip to content

CI rehearsal only (do not merge) - #24

Open
michael-moffett wants to merge 1 commit into
mainfrom
surfpool-706-setmint-a8
Open

michael-moffett wants to merge 1 commit into
mainfrom
surfpool-706-setmint-a8

Conversation

@michael-moffett

Copy link
Copy Markdown
Member

Fork CI only. Do not merge.

Add a `surfnet_setMint` cheatcode that creates or patches a mint, optionally writing the Token-2022 `ConfidentialTransferMint` extension (authority, auditor ElGamal pubkey, auto-approve).

Lead 3 of : builders must fork a mainnet mint today because there is no way to spin up a confidential-capable mint with a chosen auditor and decimals.
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds test-only cheatcode for minting operations.

The PR appears safe to merge from the reviewed behavior, with a non-blocking instruction-level test gap for cheatcode-created confidential mints.

Findings

  1. P2 Missing instruction-level coverage ▶

Summary

The PR adds surfnet_setMint for creating or updating SPL Token and Token-2022 mints, including a confidential-transfer mint extension, and exposes the method through the Node SDK.

  • It preserves existing extension data and tops up rent when the mint grows.
  • The new tests do not exercise a real confidential-transfer instruction against a cheatcode-created mint.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["surfnet_setMint"] --> B["Load mint or create default"]
  B --> C["Validate owner and apply base fields"]
  C --> D{Confidential update?}
  D -- Yes --> E["Merge Token-2022 mint extension"]
  D -- No --> F["Preserve existing extension bytes"]
  E --> G["Top up rent and write account"]
  F --> G
Loading

Reviews (1) · Last reviewed commit: "feat(core): surfnet_setMint cheatcode wi..."

async fn test_confidential_mint_feeds_set_token_account() {
use bytemuck::bytes_of;
use solana_zk_sdk::encryption::elgamal::ElGamalKeypair;
use solana_zk_sdk_pod::encryption::elgamal::PodElGamalPubkey;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Missing instruction-level coverage The new test creates a mint with set_mint, then verifies it through set_token_account and get_confidential_balance. Those paths write and read account data directly, so the test does not establish that a Token-2022 confidential-transfer instruction accepts the generated mint or uses its configured auditor. An instruction-level test would catch compatibility problems that this round-trip cannot; the existing instruction-level test creates its mint through Token-2022 instructions instead.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

1 participant