Skip to content

Commit 1ddb661

Browse files
authored
DEVREL-932 devtools-solana: add escape hatch for assertValidSolanaAdmin (#1877)
1 parent e18564f commit 1ddb661

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

.changeset/giant-glasses-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@layerzerolabs/devtools-solana": patch
3+
---
4+
5+
introduce escape hatch for assertValidSolanaAdmin

packages/devtools-solana/src/common/addresses.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ export async function isSquadsV4Vault(eid: EndpointId, address: string): Promise
7373
* - Address is off-curve AND account exists AND owned by Squads V3 Program (legacy, allowed with warning)
7474
*/
7575
export async function assertValidSolanaAdmin(connection: Connection, address: string): Promise<void> {
76+
// Skip validation if environment variable is set
77+
if (process.env.LZ_SKIP_SOLANA_ADMIN_VALIDATION) {
78+
console.warn(
79+
'\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'
80+
)
81+
return
82+
}
83+
7684
const logger = createLogger()
7785
const pubkey = new PublicKey(address)
7886

turbo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"LZ_ENABLE_EXPERIMENTAL_PARALLEL_EXECUTION",
5757
"LZ_ENABLE_EXPERIMENTAL_RETRY",
5858
"LZ_ENABLE_EXPERIMENTAL_SIMULATION",
59+
"LZ_SKIP_SOLANA_ADMIN_VALIDATION",
5960
"LZ_ENABLE_SOLANA_OAPP_EXAMPLE",
6061
"LZ_ENABLE_READ_EXAMPLE",
6162
"LZ_ENABLE_ZKSOLC_EXAMPLE",

0 commit comments

Comments
 (0)