feat: PR from asset-metadata-service for token onboardings#8885
Merged
Conversation
2670348 to
6e9a0a3
Compare
veetragjain
approved these changes
May 28, 2026
mmcshinsky-bitgo
added a commit
that referenced
this pull request
Jun 5, 2026
…ress or nft collection id createTokenMapUsingConfigDetails merges dynamic AMS token configs into the statics coin map. The presence guard (isCoinPresentInCoinMap) dedupes only by name, id, and alias, but CoinMap.fromCoins also dedupes by contract address (family:networkType:contractAddress) and NFT collection id ((prefix)family:networkType:nftCollectionId), throwing DuplicateContractAddressDefinitionError / DuplicateNftCollectionIdDefinitionError on a collision. A dynamic AMS token that shares a contract address with a statics token under a different name -- e.g. drift between the generated botTokens snapshot and live AMS data (eth:at on hoodi testnet, added in #8885 / statics 58.43.0) -- slipped past the name guard and threw in fromCoins, aborting the entire token-map build for every consumer (bitgo-retail hydration, bitgo-admin, bitgo-microservices, etc.). Track contract-address and nft-collection-id keys while merging (reusing the now-public CoinMap.contractAddressKey / nftCollectionIdKey so the keys never drift from addCoin) and skip a duplicate with a warning, mirroring the existing malformed-token handling, so one bad token can no longer take down the whole map. CSHLD-976
Closed
4 tasks
3 tasks
mmcshinsky-bitgo
added a commit
that referenced
this pull request
Jun 5, 2026
… nft collection id The ams<->static merge in createTokenMapUsingConfigDetails dedups via isCoinPresentInCoinMap, which only matches on name/id/alias -- never the contract address. An AMS-served token that reuses a contract address (or NFT collection id) already claimed by a static token under a different name slips through, and CoinMap.fromCoins -> addCoin then throws DuplicateContractAddressDefinitionError, aborting the entire token-map build for every consumer. Add CoinMap.hasTokenAddressConflict(coin) -- reusing the map's own contractAddressKey / nftCollectionIdKey derivation against its populated address/NFT indexes -- and use it in the merge loop to skip a colliding token instead of crashing. Statics coins are seeded first, so statics stays the source of truth and the colliding AMS token is the one dropped. Covers both contract-address and NFT-collection-id collisions. Surfaced by the eth:at bot token (0x0581ccdf...aa, eth testnet) added in #8885; the live AMS config serves a token at the same address under a different name. Supersedes the handoff reference in #8959 (closed). CSHLD-976
mmcshinsky-bitgo
added a commit
that referenced
this pull request
Jun 5, 2026
… nft collection id The ams<->static merge in createTokenMapUsingConfigDetails dedups via isCoinPresentInCoinMap, which only matches on name/id/alias -- never the contract address. An AMS-served token that reuses a contract address (or NFT collection id) already claimed by a static token under a different name slips through, and CoinMap.fromCoins -> addCoin then throws DuplicateContractAddressDefinitionError, aborting the entire token-map build for every consumer. Add CoinMap.hasTokenAddressConflict(coin) -- reusing the map's own contractAddressKey / nftCollectionIdKey derivation against its populated address/NFT indexes -- and use it in the merge loop to skip a colliding token instead of crashing. Statics coins are seeded first, so statics stays the source of truth and the colliding AMS token is the one dropped. Covers both contract-address and NFT-collection-id collisions. Surfaced by the eth:at bot token (0x0581ccdf...aa, eth testnet) added in #8885; the live AMS config serves a token at the same address under a different name. Supersedes the handoff reference in #8959 (closed). CSHLD-976
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.
This is a token onboarding PR opened by asset-metadata-service.