Skip to content

feat: PR from asset-metadata-service for token onboardings#8885

Merged
manas-at-bitgo merged 1 commit into
masterfrom
ams-bot-tokens
May 28, 2026
Merged

feat: PR from asset-metadata-service for token onboardings#8885
manas-at-bitgo merged 1 commit into
masterfrom
ams-bot-tokens

Conversation

@asset-metadata-bot
Copy link
Copy Markdown
Contributor

This is a token onboarding PR opened by asset-metadata-service.

@asset-metadata-bot asset-metadata-bot Bot requested a review from a team as a code owner May 28, 2026 13:13
Copy link
Copy Markdown
Contributor

@manas-at-bitgo manas-at-bitgo left a comment

Choose a reason for hiding this comment

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

lgtm

@manas-at-bitgo manas-at-bitgo merged commit 03bcc23 into master May 28, 2026
22 checks passed
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
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
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