Skip to content

Conversation

@nazreen
Copy link
Contributor

@nazreen nazreen commented Jan 23, 2026

Solana OFT debug script: state that value 0 for confirmations means 'use default'

Closes DEVREL-1238

When running:

npx hardhat lz:oft:solana:debug --eid <eid> --dst-eids <dst-eids>  

Before:

           confirmations: 0                                        

After:

           confirmations: 0 (Use Pathway Defaults)

Solana OFT - updateMetadata script supports Token-2022 Metadata Update

Closes DEVREL-1239

Problem

  • lz:oft:solana:update-metadata only supported Metaplex metadata, not Token-2022.

Solution

  • Auto-detect metadata type: SPL Token → Metaplex; Token-2022 → probe Metaplex first, else Token Extensions.
  • Add updateTokenExtensionsMetadata() with authority validation and rent handling for multisig.

Changes

  • updateMetadata.ts: Auto-detect and support Token-2022 metadata with authority checks and rent top-up.

Example Run

pnpm hardhat lz:oft:solana:update-metadata --eid 40168 --mint <MINT> --name "New Name"

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

🧪 E2E Test Status

E2E tests are non-blocking and validate real blockchain interactions. Failures may occur due to network issues, RPC rate limits, or external service downtime.

Test Runs (Newest First):

  • Run #6709 - Passed - 2026-02-10 02:40 (UTC)
  • Run #6673 - Passed - 2026-02-03 17:18 (UTC)
  • Run #6661 - Passed - 2026-01-29 16:57 (UTC)
  • Run #6628 - Passed - 2026-01-23 22:05 (UTC)

@nazreen nazreen requested review from fabianhug and lzJxhn January 29, 2026 17:09
@nazreen nazreen marked this pull request as ready for review January 29, 2026 17:09
@cursor
Copy link

cursor bot commented Jan 29, 2026

PR Summary

Medium Risk
Adds new transaction-building paths for Token-2022 metadata updates (including rent transfers and authority checks), which could fail or behave unexpectedly across different mint states; other changes are low-risk logging/UX tweaks.

Overview
Improves Solana OFT task ergonomics and metadata management.

lz:oft:solana:update-metadata now auto-detects whether a mint uses Metaplex metadata or Token-2022 Token Extensions metadata, and can update Token Extensions fields (name, symbol, uri) with update-authority validation plus automatic rent top-ups and Squads-friendly base58 output for multisig flows.

lz:oft:solana:debug now annotates confirmations: 0 as “Use Pathway Defaults”, and getOftStoreAddress no longer emits a warning when the deployment file is absent (returns null silently), reducing noise during lz:oft:solana:create/pre-deploy usage.

Written by Cursor Bugbot for commit 00489b3. This will update automatically on new commits. Configure here.

@nazreen
Copy link
Contributor Author

nazreen commented Feb 3, 2026

bump @lzJxhn

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

throw new Error('SOLANA_PRIVATE_KEY environment variable is required for non-multisig transactions')
}

const keypair = privateKeyStr ? Keypair.fromSecretKey(bs58.decode(privateKeyStr)) : undefined
Copy link

Choose a reason for hiding this comment

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

Token Extensions keypair loading bypasses standard resolution

High Severity

updateTokenExtensionsMetadata reads SOLANA_PRIVATE_KEY directly and decodes with bs58.decode(), bypassing the centralized getSolanaKeypair() from @layerzerolabs/devtools-solana that deriveConnection uses everywhere else. The standard utility supports three keypair sources (SOLANA_PRIVATE_KEY, SOLANA_KEYPAIR_PATH, and ~/.config/solana/id.json) and multiple formats (base58 and JSON array). This function only supports one source in one format, so users relying on SOLANA_KEYPAIR_PATH or the default path will get a misleading error, and array-format private keys will cause a decode failure.

Fix in Cursor Fix in Web

field: 'name',
value: name,
})
)
Copy link

Choose a reason for hiding this comment

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

String field names create custom metadata instead of standard

High Severity

createUpdateFieldInstruction is called with string literals 'name', 'symbol', and 'uri' for the field parameter. The SPL Token metadata interface distinguishes between standard fields (passed as Field enum values like Field.Name, Field.Symbol, Field.Uri) and custom additional metadata keys (passed as strings). Passing strings would create or update entries in the additionalMetadata array rather than updating the token's actual name, symbol, or URI. The Field enum needs to be imported from @solana/spl-token and used instead.

Additional Locations (2)

Fix in Cursor Fix in Web

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