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

API query: normalize token identifier case #1375

Merged

Conversation

bogdan-rosianu
Copy link
Contributor

@bogdan-rosianu bogdan-rosianu commented Nov 8, 2024

Reasoning

  • API queries regarding tokens were case sensitive.
  • API calls like <api>/tokens/mex-455c57 / <api>/tokens/MEX-455C57 did not work

Proposed Changes

  • convert the ticker part of the token identifier to uppercase and the random sequence part to lowercase before searching inside underlying services

How to test

  • <api>/tokens/mex-455c57 should work

@bogdan-rosianu bogdan-rosianu self-assigned this Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

k6 load testing comparison.
Base Commit Hash: 6a03f1f
Target Commit Hash: 1fa51aa

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Pool47.34672.4950.9752.1845.72306.1949.4351.21-3.43% ✅-54.47% ✅-3.02% ✅-1.87% ✅
Nodes48.141111.8050.9552.3146.731133.1349.3751.24-2.95% ✅+1.92% 🔴-3.09% ✅-2.03% ✅
Transactions61.912878.5451.5353.6059.312790.0449.7853.24-4.21% ✅-3.07% ✅-3.39% ✅-0.68% ✅
Accounts48.391393.3650.9652.0746.731150.8549.4051.24-3.43% ✅-17.40% ✅-3.06% ✅-1.60% ✅
Mex46.97208.0850.9752.1345.54311.8149.4251.19-3.05% ✅+49.86% 🔴-3.04% ✅-1.80% ✅
Tokens47.32599.4050.9552.2045.92479.0949.4151.20-2.96% ✅-20.07% ✅-3.03% ✅-1.91% ✅
Blocks54.351278.2851.3353.4852.531685.6349.7753.15-3.35% ✅+31.87% 🔴-3.03% ✅-0.62% ✅
Test Run Duration60002.6360003.84

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

@bogdan-rosianu bogdan-rosianu changed the title uppercase token identifier API query: normalize token identifier case Nov 8, 2024
@dragos-rebegea dragos-rebegea merged commit 29d9459 into development Nov 15, 2024
5 checks passed
@dragos-rebegea dragos-rebegea deleted the API-54-uppercase-token-identifier-in-api-queries branch November 15, 2024 15:17
dragos-rebegea added a commit that referenced this pull request Nov 18, 2024
* integrate assets cdn

* fetch token price from mx-assets priceSource.url (#1290)

* fetch token price from mx-assets priceSource.url

* update extractData methods

* use apiService.get to fetch result data

* update list of providers

* update key

* review & adjustments

* removed v2 from allEsdtTokens

---------

Co-authored-by: tanghel <tanghel@live.com>

* Nodes and tokens fetch from external api (#1306)

* updated devnet config

* Signed commit test

* Signed commit restore changes

* Signed commit test

* Signed message restore changes

* Added tokens fetch from external API

* Added nodes fetch from external API

* Add ApiService as provider in tests

* Add nodes/tokens fetch features in config files

* Add unit tests for external api

* Divide requests for nodes and tokens in smaller requests containing maximum 1000 elements and bug fixes

* Wrong function call when fetching nodes fixed

* refactoring

* simplified node / token fetching

* Fixed tests bug

---------

Co-authored-by: GuticaStefan <stefan.gutica@gmail.com>
Co-authored-by: Nicolae Mogage <mogagenicolae@yahoo.com>
Co-authored-by: Gabriel Matei <gabrielvmatei@gmail.com>

* default features disabled (#1323)

* use assets cdn url

* use destructuring syntax

* add applications unit tests (#1321)

* Create applications.spec.ts

* Update schema.gql

* Update applications.spec.ts

* fetch also collection ranks

* update API to latest sdk-nestjs version 3.7.4 (#1322)

* Change rabbitmq docker image version from 3.5 to 3.9 (#1325)

* Integration of K6 into API Github workflow (#1309)

* Add workflow load-tests

* Add initialization of the project

* Fix port when waiting for API

* Add config for API

* Add folder content for debug

* Add folder content for debug before api start

* Add debug for config file

* Remove config.yaml from gitignore

* Add config.yaml file in dist

* Move config copy after build

* Add docker services

* Remove wrong added -

* Change rabbitmq version

* Add background API start

* Add docker installation in workflow

* Changed docker compose version use to start services

* Changed docker compose version

* Add docker compose global

* Change docker compose plugin version

* Change docker compose plugin version

* Update trend names

* Add cache preload

* Add 1 minute duration

* Add preload for all tokens/nodes

* Add preload for all tokens/nodes

* test

* Change table

* Change wrong closing tag for table

* Refactor generateTable function

* Add more endpoints

* Fix wrong name for Trends

* Add empty line at end of file

* Fix wrong trend calls

* Changed actions/upload-artifacts from v2 to v3

* changed actions/download-artifact from v2 to v3

* Clear docker images caching in workflow

* removed unncessary clear docker images cache

* Update load-tests.yml

* Update load-test.yml

* updated preload.js path

* update path for preload.js

* test

* disable preload cache

* revert ref base

* run action for PRs to main or development only

* update load-tests.yml

---------

Co-authored-by: tanghel <tanghel@live.com>
Co-authored-by: GuticaStefan <stefan.gutica@gmail.com>
Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>

* Fetch-providers-from-external-API (#1326)

* added feature to fetch providers from external api instead of computing them everytime the api-service starts

* removed unnecessary return type

* added unit test for fetch providers from external api

* linter fix

* add more unit tests for providers service

---------

Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>

* Update nodes.spec.ts (#1330)

* fixes after review

* tokens fetch from external api unit tests (#1331)

* upgrade tokens unit tests WIP

* add unit test for tokens

* fix lint

* remove console log

* Filter NFTs by full tag (#1332)

* removed erl_crash.dump file (#1337)

* Handle activation epoch where staking v4 flag is checked (#1338)

* handle activation epoch where staking v4 flag is checked

* update specs

---------

Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>

* remove support for indexer v 3 (#1324)

* remove indexerV3 + specs

* fix specs

* remove support for indexerV5

* remove token.keyword

---------

Co-authored-by: tanghel <tanghel@live.com>

* applications assets (#1340)

* add applications assets

* code formatting

---------

Co-authored-by: tanghel <tanghel@live.com>

* add support for token priceSource filter (#1342)

* add mex token charts (#1334)

* add mex token charts

* Create mex.token.charts.spec.ts

* check if given token has pair

* Update mex.token.charts.spec.ts

* user after instead of start query param

* add caching

* Update mex.token.charts.spec.ts

* fixes after review

* Update mex.token.charts.spec.ts

* fix format

* fixes after review

* small adjustments

---------

Co-authored-by: tanghel <tanghel@live.com>

* update deprecated pairs query (#1335)

* update deprecated pairs query

* add tradesCount24h

* add mex pair status and apply filter by state

* integrate-latest-sdk-nestjs-version (#1343)

* fix nft filters (#1344)

* fix nft filters

* fix failing unit tests

* relayed v3 features (#1299)

* add innerTransactions

* add result status field

* add relayer field + filter

* remove relayerAddr from query

* update tests

* filter by relayer address

* add account transfer relayer

* remove relayerAddr

* fixes after review

* extract relayed version from ES

* revert changes

* add receiverUsername in innerTransaction

* fix specs

* Update mex.token.charts.spec.ts

---------

Co-authored-by: tanghel <tanghel@live.com>

* contracts deploys endpoints (#1336)

* replace account contracts with account deploys

* add account contracts

* add AccountContract Entity instead of any

* Update mex.token.charts.spec.ts

---------

Co-authored-by: tanghel <tanghel@live.com>

* add support for relayer v3 (#1346)

* add support for isRelayed in global trasfers endpoint

* small identation fix

* apply relayer field for transaction details

* add support for isRelayed filter

* add support for wildSearchcard accounts (#1347)

* Basic support for innerTx in transfers endpoint (#1351)

* add feature flag

* feat/sovereign (#1341)

* add cacheDuration

* add support for NftSubType

* Update elastic.indexer.helper.ts

* Update nft.filter.ts

* Update nft.controller.ts

* add filter.type on collection elastic

* add subType even for SFT

* fix mex.token.charts.spec.ts

* Update nft.controller.ts

* revert changes

* add subType filter

* add collections subType filter

* add address collection roles subType

* add subType filter for roles/collections count

* add accounts/nfts subType filter

* add accounts/collection subType Filter

* improved support for subType filtering

* commented out field decoration for inner transactions in context of graphgql

* fix array subType filter

* Update elastic.indexer.helper.ts

* remove empty line

---------

Co-authored-by: tanghel <tanghel@live.com>

* add token owners history info

* use double quotes

* Update tokens.spec.ts

* add entrypoint

* remove support for relayed inner transactions ( relayedV3 ) (#1361)

* fix nfts count + upgrade deps (#1362)

* update package name (#1363)

* add round filter

* add address keys proxy (#1366)

* add events support (#1367)

* add events support

* fixes and improvements

* remove postgres support

* add NFT balance

* remove if condition for ESDT types

* Reset transferLast24h to 0 for accounts that have no transactions in the last 24h (#1355)

* reset transferLast24h to 0 for accounts that have no transactions in the last 24h

* fix lint errors

---------

Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>

* remove support for graphql & update swagger version (#1368)

* remove support for graphql

* SERVICES-2711: update Swagger required fields

* fix: update property name for locked accounts in TokenSupplyResult

* fix: correct type definition for lockedAccounts in TokenSupplyResult

* fix: update type definition for lockedAccounts in TokenSupplyResult

* fixes

* further fixes

* fixes after review

* update swagger version

* remove unnecessary GraphQL field from Token entity

---------

Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com>
Co-authored-by: bogdan-rosianu <51945539+bogdan-rosianu@users.noreply.github.com>

* API-70: improve tx pool endpoint

* API-70: remove module import

* API-70: senderShard + receiverShard filters

* added missing filters to tx pool count endpoint

* API query: normalize token identifier case (#1375)

* Merge main into dev nov15 (#1383)

* added dockerfile, workflow and entrypoint (#1364)

* added dockerfile, workflow and entrypoint

* add entrypoint

---------

Co-authored-by: liviuancas-elrond <liviu.ancas@elrond.com>
Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>

* Add guardianData to GatewayComponentRequest in GatewayService (#1377)

---------

Co-authored-by: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com>
Co-authored-by: liviuancas-elrond <liviu.ancas@elrond.com>
Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>
Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com>

* Merge main development (#1386)

---------

Co-authored-by: cfaur09 <catalinfaurpaul@gmail.com>
Co-authored-by: Catalin Faur <52102171+cfaur09@users.noreply.github.com>
Co-authored-by: tanghel <tanghel@live.com>
Co-authored-by: GuticaStefan <stefan.gutica@gmail.com>
Co-authored-by: Nicolae Mogage <mogagenicolae@yahoo.com>
Co-authored-by: Gabriel Matei <gabrielvmatei@gmail.com>
Co-authored-by: GuticaStefan <123564494+GuticaStefan@users.noreply.github.com>
Co-authored-by: bogdan-rosianu <51945539+bogdan-rosianu@users.noreply.github.com>
Co-authored-by: Liviu Ancas <83750585+liviuf-ancas@users.noreply.github.com>
Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com>
Co-authored-by: liviuancas-elrond <liviu.ancas@elrond.com>
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.

3 participants