feat: auto-resolve external token refs during evm pool deployment#2106
Draft
chris-de-leon-cll wants to merge 5 commits into
Draft
feat: auto-resolve external token refs during evm pool deployment#2106chris-de-leon-cll wants to merge 5 commits into
chris-de-leon-cll wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the EVM pool deployment flow to allow token refs that are not present in the datastore (e.g., customer-deployed tokens) to be auto-populated via on-chain reads, so pool deployments can proceed without requiring prior datastore entries.
Changes:
- Add fallback token-ref resolution during
DeployTokenPoolForToken: datastore lookup first, then on-chain resolution when missing. - Minor formatting changes to sequence construction / invocation for consistency.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+314
to
+318
| fallbackRef, err := a.ResolveTokenRef(b, chains, input.ExistingDataStore, input.ChainSelector, tokenRef.Address) | ||
| if err != nil { | ||
| return sequences.OnChainOutput{}, fmt.Errorf("failed to resolve token ref from on-chain data for token address %s: %w", tokenRef.Address, err) | ||
| } | ||
| tokenRef = fallbackRef |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During EVM pool deployments, we can get cases where we want to deploy a pool that's backed by a token which has already been deployed by the customer
In these situations, the token ref does not exist in the datastore, but that shouldn't be a blocker for token pool deployment
This PR allows 3rd party token refs to be fully populated from on-chain data allowing pool deployments to properly succeed
The resolution strategy for the token ref works as follows - suppose we are given an arbitrary token ref that may or may not be populated in the
DeployTokenPoolForTokensequemnce: