Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/giant-glasses-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/devtools-solana": patch
---

introduce escape hatch for assertValidSolanaAdmin
5 changes: 4 additions & 1 deletion examples/oft-solana/layerzero.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export default async function () {
])

return {
contracts: [{ contract: arbitrumContract }, { contract: solanaContract }],
contracts: [
{ contract: arbitrumContract },
{ contract: solanaContract, config: { delegate: '2XgGZG4oP29U3w5h4nTk1V2LFHL23zKDPJjs3psGzLKQ' } },
Copy link

Choose a reason for hiding this comment

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

Test delegate address accidentally left in example config

The example configuration file now includes a hardcoded test delegate address (2XgGZG4oP29U3w5h4nTk1V2LFHL23zKDPJjs3psGzLKQ). According to the PR description's "Testing" section, this ULN302 Msg Lib PDA was used specifically to verify the escape hatch feature works. This test configuration appears to have been accidentally committed and would affect users who clone this example as a template, potentially causing deployment issues since they'd have an unexpected delegate address that isn't theirs.

Fix in Cursor Fix in Web

],
connections,
}
}
8 changes: 8 additions & 0 deletions packages/devtools-solana/src/common/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export async function isSquadsV4Vault(address: string): Promise<boolean> {
}

export async function assertValidSolanaAdmin(connection: Connection, address: string): Promise<void> {
// Skip validation if environment variable is set
if (process.env.LZ_SKIP_SOLANA_ADMIN_VALIDATION) {
console.warn(
'\n\nWarning: LZ_SKIP_SOLANA_ADMIN_VALIDATION is set. Skipping Solana admin validation. Only use this is you are using a non-Squads Multisig.\n\n'
)
return
}

const pubkey = new PublicKey(address)

try {
Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"LZ_ENABLE_EXPERIMENTAL_PARALLEL_EXECUTION",
"LZ_ENABLE_EXPERIMENTAL_RETRY",
"LZ_ENABLE_EXPERIMENTAL_SIMULATION",
"LZ_SKIP_SOLANA_ADMIN_VALIDATION",
"LZ_ENABLE_SOLANA_OFT_EXAMPLE",
"LZ_ENABLE_SOLANA_OAPP_EXAMPLE",
"LZ_ENABLE_READ_EXAMPLE",
Expand Down
Loading