Repository navigation
fix(sep40): normalize Gate.io and CEX sources to legal Soroban symbols (#755) - #806
Open
Lkshayyadav wants to merge 1 commit into
Open
Lkshayyadav wants to merge 1 commit into
Lkshayyadav wants to merge 1 commit into
Conversation
Divinity-Labs#755) - Map off-chain venue sources (e.g. Gate.io -> Gate_io) to legal Soroban symbols via venue symbol registry. - Enforce symbol format (alphanumeric + underscore, <= 32 chars) across all adapters. - Skip unknown sources with invalid characters with a warning rather than permanently blocking pairs. - Add venueAdapters symbol validation test and sep40 encoding/publisher tests. - Document off-chain venue inclusion in docs/sep40-oracle-publisher.md. Closes Divinity-Labs#755
|
@Lkshayyadav Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
5 tasks
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.
Description
Closes #755
When
Gate.io(or any off-chain centralized exchange whose identifier contains characters outside[A-Za-z0-9_]) reports price points that contribute to an aggregate price, the SEP-40 oracle publisher previously failed symbol validation because Soroban symbols only allow alphanumeric characters and underscores up to 32 bytes (^[A-Za-z0-9_]+$).Changes Made
Venue Symbol Registry (
src/ingest/venues/symbols.ts):VENUE_SOURCE_TO_SYMBOLmapping canonical storedsourcenames to legal on-chain symbols (e.g.Gate.io->Gate_io).resolveVenueSymbol(sourceOrName: string): string | nullused across callers.symbolproperty onVenueAdapter(KUCOIN_SYMBOL = KuCoin,GATEIO_SYMBOL = Gate_io).Publisher Robustness (
src/publish/sep40.ts):venuesToSpecArg()resolves venue sources to legal on-chain symbols before asserting ScSymbol validity.MAX_SYMBOL_LENGTH(no doomed transaction writes).Registry Invariant Test (
src/__tests__/venueAdapters.test.ts):allVenueAdaptersmaps to a unique, legal Soroban symbol (^[A-Za-z0-9_]+$, length <= 32).Test Coverage (
src/__tests__/sep40Publisher.test.ts,src/__tests__/sep40Encoding.test.ts):Gate.iorow publishes successfully on chain with venueGate_io.Documentation (
docs/sep40-oracle-publisher.md):venues: Vec<Symbol>and the symbol normalization rule in Section 1.4.1.Verification
npx tsc --noEmit: 0 errorsnpm test(vitest): 159 test files passed, 1953 tests passed (0 failed)