Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Unable to fetch top token balances for certain accounts (#2065)
Browse files Browse the repository at this point in the history
* 🐛 Fix top balance retrieval

* 📦 Update dependencies

* 🔨 Fix unit test
  • Loading branch information
sameersubudhi authored May 15, 2024
1 parent 8f88ea7 commit 60e7328
Show file tree
Hide file tree
Showing 16 changed files with 3,059 additions and 3,057 deletions.
255 changes: 127 additions & 128 deletions framework/yarn.lock

Large diffs are not rendered by default.

308 changes: 157 additions & 151 deletions services/blockchain-app-registry/yarn.lock

Large diffs are not rendered by default.

471 changes: 235 additions & 236 deletions services/blockchain-connector/yarn.lock

Large diffs are not rendered by default.

463 changes: 231 additions & 232 deletions services/blockchain-coordinator/yarn.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ const getTokenTopBalances = async params => {
if (search) {
params.orSearch = [
{
property: `${accountTableSchema.tableName}.name`,
property: `${accountBalancesTableSchema.tableName}.address`,
pattern: search,
},
{
property: `${accountTableSchema.tableName}.address`,
pattern: search,
},
{
property: `${accountTableSchema.tableName}.name`,
pattern: search,
},
{
property: `${accountTableSchema.tableName}.publicKey`,
pattern: search,
Expand Down
5 changes: 4 additions & 1 deletion services/blockchain-indexer/shared/indexer/genesisBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ const indexGenesisBlockAssets = async dbTrx => {

let indexedGenesisAccountBalances;
const interval = setInterval(async () => {
logger.debug(
`indexedGenesisAccountBalances interval triggered. ${genesisAccountBalances.length} pending.`,
);
try {
if (genesisAccountBalances.length) {
if (indexedGenesisAccountBalances === false) return;
Expand All @@ -241,11 +244,11 @@ const interval = setInterval(async () => {
numEntries++;
})
.catch(err => {
numEntries--;
genesisAccountBalances.push(accountBalanceEntry);
logger.warn(
`Updating account balance for ${accountBalanceEntry.address} failed. Will retry.\nError: ${err.message}`,
);
logger.debug(`${numEntries} indexed so far, ${genesisAccountBalances.length} pending.`);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ const mockTokenTopBalancesDbSearchResult = {
},
orSearch: [
{
property: 'accounts.name',
property: 'account_balances.address',
pattern: 'search123',
},
{
property: 'accounts.address',
pattern: 'search123',
},
{
property: 'accounts.name',
pattern: 'search123',
},
{
property: 'accounts.publicKey',
pattern: 'search123',
Expand Down
477 changes: 238 additions & 239 deletions services/blockchain-indexer/yarn.lock

Large diffs are not rendered by default.

305 changes: 158 additions & 147 deletions services/export/yarn.lock

Large diffs are not rendered by default.

465 changes: 232 additions & 233 deletions services/fee-estimator/yarn.lock

Large diffs are not rendered by default.

255 changes: 127 additions & 128 deletions services/gateway/yarn.lock

Large diffs are not rendered by default.

261 changes: 130 additions & 131 deletions services/market/yarn.lock

Large diffs are not rendered by default.

69 changes: 34 additions & 35 deletions services/template/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==

"@keyv/redis@^2.1.2":
version "2.8.4"
resolved "https://registry.yarnpkg.com/@keyv/redis/-/redis-2.8.4.tgz#0d1afb74ef4588c849658509fb69051648ac17d9"
integrity sha512-osO4C+i+Gi844wHjvXuHwhl+sDx3289Of309ZlLcj6SJReTLmPXzNiVR81N88wOu5aC+lVFdmx9FUQkkjdbPRQ==
version "2.8.5"
resolved "https://registry.yarnpkg.com/@keyv/redis/-/redis-2.8.5.tgz#2365eed421c74ec8837572af557ca058c3f47049"
integrity sha512-e9W1faN32A1Wy5726qtorAvPu1Xffh75ngfQQtETQ0hIN/FQtK0RcBTz/OH/vwDvLX8zrzdu0sWq/KoSHDYfVw==
dependencies:
ioredis "^5.3.2"
ioredis "^5.4.1"

"@log4js-node/gelf@github:MichalTuleja/log4js-node-gelf#89d9933":
version "1.0.2"
Expand All @@ -28,9 +28,9 @@
debug "^3.1.0"

"@socket.io/component-emitter@~3.1.0":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.1.tgz#621270c02c0a5d4f4669eb1caa9723c91cf201de"
integrity sha512-dzJtaDAAoXx4GCOJpbB2eG/Qj8VDpdwkLsWGzGm+0L7E8/434RyMbAHmk9ubXWVAb9nXmc44jUf8GKqVDiKezg==
version "3.1.2"
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz#821f8442f4175d8f0467b9daf26e3a18e2d02af2"
integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==

"@types/cookie@^0.4.1":
version "0.4.1"
Expand All @@ -45,9 +45,9 @@
"@types/node" "*"

"@types/node@*", "@types/node@>=10.0.0":
version "20.12.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.7.tgz#04080362fa3dd6c5822061aa3124f5c152cff384"
integrity sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==
version "20.12.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.12.tgz#7cbecdf902085cec634fdb362172dfe12b8f2050"
integrity sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==
dependencies:
undici-types "~5.26.4"

Expand Down Expand Up @@ -628,9 +628,9 @@ expand-template@^2.0.3:
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==

fastest-validator@^1.10.1, fastest-validator@^1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/fastest-validator/-/fastest-validator-1.17.0.tgz#0c032e9c42c40a237d24b20be187f732ebdcc062"
integrity sha512-37U/JDP72QSFqcvNnO81f0Aeu9og+5I3mc55b2v2RbV0S2I7KvQEdBtrFeIvaYVgam1bDUgy9F9AK9HolByogA==
version "1.18.0"
resolved "https://registry.yarnpkg.com/fastest-validator/-/fastest-validator-1.18.0.tgz#77a51fa09de13727f3216827a2cbd9f90e09a84c"
integrity sha512-3v6UJF1U/b56GqzDZqEtgPi2g261eGI9zQWDUrmOVKHiAktFIsHklp4XViX+a4yF7S5JjPm4KKmkgCsaara03g==

[email protected]:
version "1.0.0"
Expand Down Expand Up @@ -767,11 +767,12 @@ glob@^7.2.0:
path-is-absolute "^1.0.0"

globalthis@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf"
integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==
version "1.0.4"
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236"
integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==
dependencies:
define-properties "^1.1.3"
define-properties "^1.2.1"
gopd "^1.0.1"

gopd@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -910,10 +911,10 @@ ioredis@^4.27.0:
redis-parser "^3.0.0"
standard-as-callback "^2.1.0"

ioredis@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.3.2.tgz#9139f596f62fc9c72d873353ac5395bcf05709f7"
integrity sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==
ioredis@^5.3.2, ioredis@^5.4.1:
version "5.4.1"
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.4.1.tgz#1c56b70b759f01465913887375ed809134296f40"
integrity sha512-2YZsvl7jopIa1gaePkeMtd9rAcSjOOjPtpcLlOeusyO+XH2SK5ZcT+UCrElPP+WVIInh2TzeI4XW9ENaSLVVHA==
dependencies:
"@ioredis/commands" "^1.1.1"
cluster-key-slot "^1.1.0"
Expand All @@ -926,9 +927,9 @@ ioredis@^5.3.2:
standard-as-callback "^2.1.0"

ipaddr.js@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.1.0.tgz#2119bc447ff8c257753b196fc5f1ce08a4cdf39f"
integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==
version "2.2.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8"
integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==

is-array-buffer@^3.0.4:
version "3.0.4"
Expand Down Expand Up @@ -1359,9 +1360,9 @@ [email protected]:
integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==

node-abi@^3.3.0:
version "3.57.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.57.0.tgz#d772cb899236c0aa46778d0d25256917cf15eb15"
integrity sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==
version "3.62.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.62.0.tgz#017958ed120f89a3a14a7253da810f5d724e3f36"
integrity sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==
dependencies:
semver "^7.3.5"

Expand Down Expand Up @@ -1547,9 +1548,9 @@ [email protected]:
side-channel "^1.0.4"

qs@^6.11.0:
version "6.12.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.0.tgz#edd40c3b823995946a8a0b1f208669c7a200db77"
integrity sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==
version "6.12.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a"
integrity sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==
dependencies:
side-channel "^1.0.6"

Expand Down Expand Up @@ -1682,11 +1683,9 @@ safe-regex-test@^1.0.3:
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

semver@^7.3.2, semver@^7.3.5:
version "7.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d"
integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==
dependencies:
lru-cache "^6.0.0"
version "7.6.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==

[email protected]:
version "0.18.0"
Expand Down
Loading

0 comments on commit 60e7328

Please sign in to comment.