diff --git a/.changeset/giant-glasses-count.md b/.changeset/giant-glasses-count.md new file mode 100644 index 0000000000..07594f0f02 --- /dev/null +++ b/.changeset/giant-glasses-count.md @@ -0,0 +1,5 @@ +--- +"@layerzerolabs/devtools-solana": patch +--- + +introduce escape hatch for assertValidSolanaAdmin diff --git a/packages/devtools-solana/src/common/addresses.ts b/packages/devtools-solana/src/common/addresses.ts index 59c20bd4f6..acbdce9802 100644 --- a/packages/devtools-solana/src/common/addresses.ts +++ b/packages/devtools-solana/src/common/addresses.ts @@ -73,6 +73,14 @@ export async function isSquadsV4Vault(eid: EndpointId, address: string): Promise * - Address is off-curve AND account exists AND owned by Squads V3 Program (legacy, allowed with warning) */ export async function assertValidSolanaAdmin(connection: Connection, address: string): Promise { + // 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 logger = createLogger() const pubkey = new PublicKey(address) diff --git a/turbo.json b/turbo.json index 92e5cc9082..751447efa0 100644 --- a/turbo.json +++ b/turbo.json @@ -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_OAPP_EXAMPLE", "LZ_ENABLE_READ_EXAMPLE", "LZ_ENABLE_ZKSOLC_EXAMPLE",