Page MenuHomePhabricator

[alias-server] Support for pending alias txs
ClosedPublic

Authored by bytesofman on Jul 3 2023, 22:02.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC860a2c06d709: [alias-server] Support for pending alias txs
Summary

T3060

Support for adding and removing pending aliases from a dedicated pending aliases collection

Caching is introduced so that tipHeight is available inside the added to mempool event. It would be available from serverState in the database, but deemed impractical to make a database call on every incoming tx (could be a huge throughput of these) for a value that only changes every 10 minutes on avg.

pending alias registrations that become valid alias registrations are removed from the cache.

pending aliases are added to the cache on app startup.

pending aliases that go more than 6 confirmations without becoming confirmed or otherwise cleaned up are dropped from the pending collection to prevent unbounded growth.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pending-support-alias-server
Lint
Lint Errors
SeverityLocationCodeMessage
Errorapps/alias-server/test/chronikWsHandlerTests.js:455ESLINTno-unused-vars
Unit
No Test Coverage
Build Status
Buildable 24826
Build 49243: Build Diffalias-server-tests
Build 49242: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Tail of the build log:

    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/work/apps/alias-server/src/alias.js:5:365)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/work/apps/alias-server/test/aliasTests.js:15:5)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at async formattedImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/work/apps/alias-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/work/apps/alias-server/node_modules/mocha/lib/cli/run.js:370:5)
------------------------|---------|----------|---------|---------|-------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------------|---------|----------|---------|---------|-------------------
All files               |    6.31 |        0 |       0 |    6.48 |                   
 alias-server           |     100 |      100 |     100 |     100 |                   
  config.js             |     100 |      100 |     100 |     100 |                   
 alias-server/constants |     100 |      100 |     100 |     100 |                   
  alias.js              |     100 |      100 |     100 |     100 |                   
 alias-server/src       |    5.61 |        0 |       0 |    5.76 |                   
  alias.js              |    4.81 |        0 |       0 |       5 | 14-296            
  db.js                 |    5.88 |        0 |       0 |    5.94 | 12-342            
  rpc.js                |    8.33 |        0 |       0 |    8.33 | 10-105            
  utils.js              |    5.17 |        0 |       0 |    5.45 | 12-152            
------------------------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='269']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='119']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='30']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='262']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/alias-server-junit.xml': No such file or directory
Build alias-server-tests failed with exit code 1
Fabien requested changes to this revision.Aug 23 2023, 08:21

This doesn't work. There is no way you can tell if the node is lacking the tx or if it has been removed. Just handle the removed from mempool event, that's it.

This revision now requires changes to proceed.Aug 23 2023, 08:21

handle RemovedFromMempool event

Tail of the build log:

    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/work/apps/alias-server/src/alias.js:5:365)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/work/apps/alias-server/test/aliasTests.js:15:5)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at async formattedImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/work/apps/alias-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/work/apps/alias-server/node_modules/mocha/lib/cli/run.js:370:5)
------------------------|---------|----------|---------|---------|-------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------------|---------|----------|---------|---------|-------------------
All files               |    6.31 |        0 |       0 |    6.48 |                   
 alias-server           |     100 |      100 |     100 |     100 |                   
  config.js             |     100 |      100 |     100 |     100 |                   
 alias-server/constants |     100 |      100 |     100 |     100 |                   
  alias.js              |     100 |      100 |     100 |     100 |                   
 alias-server/src       |    5.61 |        0 |       0 |    5.76 |                   
  alias.js              |    4.81 |        0 |       0 |       5 | 14-296            
  db.js                 |    5.88 |        0 |       0 |    5.94 | 12-342            
  rpc.js                |    8.33 |        0 |       0 |    8.33 | 10-105            
  utils.js              |    5.17 |        0 |       0 |    5.45 | 12-152            
------------------------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='269']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='119']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='30']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='262']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/alias-server-junit.xml': No such file or directory
Build alias-server-tests failed with exit code 1

Tail of the build log:

    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/work/apps/alias-server/src/alias.js:5:365)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/work/apps/alias-server/test/aliasTests.js:15:5)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at async formattedImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/work/apps/alias-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/work/apps/alias-server/node_modules/mocha/lib/cli/run.js:370:5)
------------------------|---------|----------|---------|---------|-------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------------|---------|----------|---------|---------|-------------------
All files               |    6.31 |        0 |       0 |    6.48 |                   
 alias-server           |     100 |      100 |     100 |     100 |                   
  config.js             |     100 |      100 |     100 |     100 |                   
 alias-server/constants |     100 |      100 |     100 |     100 |                   
  alias.js              |     100 |      100 |     100 |     100 |                   
 alias-server/src       |    5.61 |        0 |       0 |    5.76 |                   
  alias.js              |    4.81 |        0 |       0 |       5 | 14-296            
  db.js                 |    5.88 |        0 |       0 |    5.94 | 12-342            
  rpc.js                |    8.33 |        0 |       0 |    8.33 | 10-105            
  utils.js              |    5.17 |        0 |       0 |    5.45 | 12-152            
------------------------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='269']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='119']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='30']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='262']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/alias-server-junit.xml': No such file or directory
Build alias-server-tests failed with exit code 1

This doesn't work. There is no way you can tell if the node is lacking the tx or if it has been removed. Just handle the removed from mempool event, that's it.

The websocket connection can't be treated as 100% reliable, as it will frequently disconnect and reconnect, occasionally missing events.

This is acceptable for the BlockConnected event -- as the app will eventually get a confirmed block, and, if it missed earlier blocks, catch up by processing those txs.

With RemovedFromMempool -- if the app misses the msg, it will never get it again. So, there needs to be some sort of fallback.

In this case, isNotInMempool is only being called on a txid that has already been seen once in the mempool -- so we know the node is not lacking the tx.

Refactor to use sample secrets in failing CI unit test

Fabien requested changes to this revision.Aug 24 2023, 12:52

This doesn't work. There is no way you can tell if the node is lacking the tx or if it has been removed. Just handle the removed from mempool event, that's it.

The websocket connection can't be treated as 100% reliable, as it will frequently disconnect and reconnect, occasionally missing events.

This is acceptable for the BlockConnected event -- as the app will eventually get a confirmed block, and, if it missed earlier blocks, catch up by processing those txs.

With RemovedFromMempool -- if the app misses the msg, it will never get it again. So, there needs to be some sort of fallback.

I'm ok with some periodic cleanup to recover from this kind of issue, but this is just not a right way to do it.

In this case, isNotInMempool is only being called on a txid that has already been seen once in the mempool -- so we know the node is not lacking the tx.

That is wrong. There is no guarantee that chronik is using the same node as your call (in fact it's unlikely to be the case) so discrepeancy is to be expected.
Really there is no point in reading the mempool anyway: if a tx was not confirmed after x blocks, just remove it from the pending list: there is something wrong with that tx.

This revision now requires changes to proceed.Aug 24 2023, 12:52

remove mempool check, add increment function and 'missedConfirmations' key to pendingAlias objects

lint and remove debug logging

Improve efficiency here

  • Lose the age in ms check
  • Save pendingAliases with a tipheight, then filtered delete for > 10 blocks from tipHeight

Using redis to store pending aliases in cache, not database.

need to clean up, review, add a unit test

unit test for tx history provided to handle mempool, remove debug logging, better code comments

Tail of the build log:

  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Build alias-server-tests timed out after 3600.0s

Tail of the build log:

  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Build alias-server-tests timed out after 3600.0s

Tail of the build log:

  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
Build alias-server-tests timed out after 3600.0s

need to address redis in unit testing CI

Mock redis for CI unit tests

Fabien requested changes to this revision.Sep 8 2023, 08:43

It costs about 60$ to crash the server.

This revision now requires changes to proceed.Sep 8 2023, 08:43

need to handle removed from mempool event

reverting to mongodb with ttl to handle mempool drops

needs more testing, need to review this myself and clean up

implement caching for tipheight, mongo ttl will not work for compound index, which is needed

need to self review and run more tests

Clean up comments, remove changes unrelated to diff

apps/alias-server/test/chronikWsHandlerTests.js
13 ↗(On Diff #42163)

still pending a one-off diff to move all apps using local chronik-client over to this one. need to make this change here bc the local copy doesn't have the .tx mock feature, but the master one does.

Fabien requested changes to this revision.Sep 13 2023, 07:56
Fabien added inline comments.
apps/alias-server/src/db.js
275 ↗(On Diff #42164)

It's no longer using redis (good thing), so you need to update the summary

305 ↗(On Diff #42164)

I don't think this is ever going to be useful outside of the tests ? If I'm right you'd better implement getPendingAliasesForAddress() directly, as you can use it the same way in the tests.

This revision now requires changes to proceed.Sep 13 2023, 07:56
bytesofman marked an inline comment as done.

Modify getPendingAliases function to accept mongodb selection filter

bytesofman added inline comments.
apps/alias-server/src/db.js
305 ↗(On Diff #42164)

In this diff, no -- but the function will be used when we set up the API.

Will include unit tests for those cases in that diff.

Keeping it open to specific queries as could be useful to know all pending aliases, though I would not want it to be in a public API endpoint.

This revision is now accepted and ready to land.Sep 14 2023, 12:51
This revision was automatically updated to reflect the committed changes.
bytesofman marked an inline comment as done.