Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If localnet, be less strict on the expected chainID #1036

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Conversation

archseer
Copy link
Collaborator

In deployment tests we use a bunch of random identifiers to allow us to run multiple different solana chains at once. The current relayer implementation is quite rigid which causes a mismatch. This PR makes the check more permissive (but still disallows using official IDs on localnet)

@archseer archseer requested a review from a team as a code owner January 31, 2025 07:56
@archseer archseer requested a review from aalu1418 January 31, 2025 07:56
@@ -150,7 +151,9 @@ func (v *verifiedCachedClient) verifyChainID(ctx context.Context) (bool, error)

// check chainID matches expected chainID
expectedChainID := strings.ToLower(v.expectedChainID)
if v.chainID != expectedChainID {
// if this is localnet, allow any chain ID as long as it's not spoofing an official network
ignore := v.chainID == "localnet" && !slices.Contains([]string{"mainnet", "testnet", "devnet"}, expectedChainID)
Copy link

Choose a reason for hiding this comment

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

do we have these consts defined anywhere?

tt-cll
tt-cll previously approved these changes Feb 4, 2025
@archseer archseer enabled auto-merge (squash) February 4, 2025 09:17
@archseer archseer merged commit 341d2b4 into develop Feb 4, 2025
35 of 36 checks passed
@archseer archseer deleted the chainid-fix branch February 4, 2025 09:37
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