From e51c1e439c99fbf00509c1776e823a8469716a60 Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Sun, 9 Oct 2022 12:36:13 +0200 Subject: [PATCH] use AMP payments --- .github/workflows/integration_test.yml | 141 +++++++++++------- .gitignore | 3 - dist/src/grpc/interfaces.js.map | 2 +- dist/src/grpc/lightning.js | 103 ++++++++----- dist/src/grpc/lightning.js.map | 2 +- dist/src/grpc/subscribe.js | 6 +- dist/src/grpc/subscribe.js.map | 2 +- dist/src/network/receive.js | 19 ++- dist/src/network/receive.js.map | 2 +- dist/src/tests/controllers/ampPayment.test.js | 100 +++++++++++++ .../tests/controllers/ampPayment.test.js.map | 1 + .../tests/controllers/messageLength.test.js | 2 +- dist/src/tests/utils/get/getCheckMsgs.js | 2 +- dist/src/tests/utils/get/getCheckMsgs.js.map | 2 +- package.json | 2 +- src/grpc/interfaces.ts | 6 +- src/grpc/lightning.ts | 113 ++++++++++---- src/grpc/subscribe.ts | 10 +- src/network/receive.ts | 15 +- src/tests/configs/.gitignore | 1 + src/tests/configs/nodes.json | 35 ----- src/tests/controllers/ampPayment.test.ts | 115 ++++++++++++++ src/tests/controllers/messageLength.test.ts | 2 +- src/tests/utils/get/getCheckMsgs.ts | 6 +- 24 files changed, 510 insertions(+), 182 deletions(-) create mode 100644 dist/src/tests/controllers/ampPayment.test.js create mode 100644 dist/src/tests/controllers/ampPayment.test.js.map create mode 100644 src/tests/configs/.gitignore delete mode 100644 src/tests/configs/nodes.json create mode 100644 src/tests/controllers/ampPayment.test.ts diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 8b4429b79..fe041b543 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -1,59 +1,98 @@ -name: Integration Test -on: +name: Integration Tests +on: pull_request: branches: - master - + jobs: - build: - runs-on: ubuntu-18.04 + integration-test: + runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: - test-name: ['boostPayment', 'botCreation', 'chatPayment', 'cleanup', 'clearAllChats', 'clearAllContacts', 'contacts', 'images', 'latestTest', 'lsats', 'paidMeet', 'paidTribeImages', 'queryRoutes', 'self', 'sphinxPeople', 'streamPayment', 'tribe', 'tribe3Escrow', 'tribe3Messages', 'tribe3Private', 'tribe3Profile', 'tribeEdit', 'tribeImages', 'messageLength', 'transportToken', 'pinnedMsg', 'hmac', 'socketIO', 'tribeMember'] + test-name: + [ + 'boostPayment', + 'botCreation', + 'chatPayment', + 'cleanup', + 'clearAllChats', + 'clearAllContacts', + 'contacts', + 'images', + 'latestTest', + 'lsats', + 'paidMeet', + 'paidTribeImages', + 'queryRoutes', + 'self', + 'sphinxPeople', + 'streamPayment', + 'tribe', + 'tribe3Escrow', + 'tribe3Messages', + 'tribe3Private', + 'tribe3Profile', + 'tribeEdit', + 'tribeImages', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'messageLength', + 'transportToken', + 'pinnedMsg', + 'hmac', + 'socketIO', + 'tribeMember', + 'ampPayment', + ] steps: - - name: Enable docker.host.internal for Ubuntu - run: | - pwd && sudo bash -c 'echo "172.17.0.1 host.docker.internal" >> /etc/hosts' - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - path: relay - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Build Relay - working-directory: ./relay - run: | - npm install && npm run build && docker build -t sphinxlightning/sphinx-relay . - - name: Checkout stack - run: | - git clone https://github.com/stakwork/sphinx-stack.git stack - - name: give permissions - working-directory: ./stack - run: | - chmod 777 ./bitcoind; - chmod 777 -R ./relay; - chmod 777 -R ./lnd; - chmod 777 -R ./proxy; - - name: Turn on Stack - working-directory: ./stack - run: | - GITACTION_ENV=gitactionenv docker-compose -f alts/proxy.yml --project-dir . up -d - - name: Check for NODES.json - working-directory: ./stack - run: | - sleep 240; - docker-compose ps - docker logs meme.sphinx - docker logs dave.sphinx - docker wait stack_relaysetup_1; - - name: copy file - uses: canastro/copy-file-action@master - with: - source: "stack/relay/NODES.json" - target: "relay/src/tests/configs/nodes.json" - - name: Run tests - working-directory: ./relay - run: | - npx ava src/tests/controllers/${{matrix.test-name}}.test.ts --verbose --serial --timeout=2m + - name: Enable docker.host.internal for Ubuntu + run: pwd && sudo bash -c 'echo "172.17.0.1 host.docker.internal" >> /etc/hosts' + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: relay + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Build Relay + working-directory: ./relay + run: npm install && npm run build && docker build -t sphinxlightning/sphinx-relay . + - name: Checkout stack + uses: actions/checkout@v3 + with: + repository: antonilol/sphinx-stack + ref: amp + path: stack + - name: Give permissions + working-directory: ./stack + run: chmod 777 -R bitcoind relay lnd proxy + - name: Turn on Stack + working-directory: ./stack + run: GITACTION_ENV=gitactionenv docker-compose -f alts/proxy.yml --project-dir . up -d + - name: Check for NODES.json + working-directory: ./stack + run: | + docker-compose ps + docker logs meme.sphinx + docker logs dave.sphinx + docker logs -f stack_lndsetup_1 + docker logs -f stack_relaysetup_1 + sleep 1m + - name: Copy nodes.json + run: cp stack/relay/NODES.json relay/src/tests/configs/nodes.json + - name: Run tests + working-directory: ./relay + run: npx ava src/tests/controllers/${{matrix.test-name}}.test.ts --verbose --serial --timeout=2m diff --git a/.gitignore b/.gitignore index a3dde2780..9884a8985 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,3 @@ creds/* !creds/.gitkeep !creds/scheduler_creds hsm_secret - -src/tests/configs/* -src/tests/configs/nodes.json \ No newline at end of file diff --git a/dist/src/grpc/interfaces.js.map b/dist/src/grpc/interfaces.js.map index 82cf72c2d..5081cf549 100644 --- a/dist/src/grpc/interfaces.js.map +++ b/dist/src/grpc/interfaces.js.map @@ -1 +1 @@ -{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/gr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AAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IAExD,IAAI,CAAC,GAAa,EAAE,CAAA;IACpB,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACvB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KAC1C;IACD,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACjB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IAChC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IAEhC,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IACzD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IAE9C,OAAO,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC1D,CAAC"} \ No newline at end of file diff --git a/dist/src/grpc/lightning.js b/dist/src/grpc/lightning.js index 4055bc1cb..2a2ac14e2 100644 --- a/dist/src/grpc/lightning.js +++ b/dist/src/grpc/lightning.js @@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getChanInfo = exports.channelBalance = exports.complexBalances = exports.openChannel = exports.connectPeer = exports.pendingChannels = exports.listChannels = exports.listPeers = exports.addInvoice = exports.getInfo = exports.verifyAscii = exports.verifyMessage = exports.verifyBytes = exports.signBuffer = exports.signMessage = exports.listAllPaymentsFull = exports.listPaymentsPaginated = exports.listAllPayments = exports.listAllInvoices = exports.listInvoices = exports.signAscii = exports.keysendMessage = exports.loadRouter = exports.keysend = exports.sendPayment = exports.newAddress = exports.UNUSED_NESTED_PUBKEY_HASH = exports.UNUSED_WITNESS_PUBKEY_HASH = exports.NESTED_PUBKEY_HASH = exports.WITNESS_PUBKEY_HASH = exports.queryRoute = exports.setLock = exports.getLock = exports.getHeaders = exports.unlockWallet = exports.loadWalletUnlocker = exports.loadLightning = exports.loadCredentials = exports.SPHINX_CUSTOM_RECORD_KEY = exports.LND_KEYSEND_KEY = void 0; +exports.getChanInfo = exports.channelBalance = exports.complexBalances = exports.openChannel = exports.connectPeer = exports.pendingChannels = exports.listChannels = exports.listPeers = exports.addInvoice = exports.getInfo = exports.verifyAscii = exports.verifyMessage = exports.verifyBytes = exports.signBuffer = exports.signMessage = exports.listAllPaymentsFull = exports.listPaymentsPaginated = exports.listAllPayments = exports.listAllInvoices = exports.listInvoices = exports.signAscii = exports.keysendMessage = exports.loadRouter = exports.keysend = exports.sendPayment = exports.newAddress = exports.UNUSED_NESTED_PUBKEY_HASH = exports.UNUSED_WITNESS_PUBKEY_HASH = exports.NESTED_PUBKEY_HASH = exports.WITNESS_PUBKEY_HASH = exports.queryRoute = exports.setLock = exports.getLock = exports.getHeaders = exports.unlockWallet = exports.loadWalletUnlocker = exports.loadLightning = exports.loadCredentials = exports.SPHINX_CUSTOM_RECORD_KEY = exports.LND_KEYSEND_KEY = exports.IS_GREENLIGHT = void 0; const ByteBuffer = require("bytebuffer"); const fs = require("fs"); const grpc = require("grpc"); @@ -30,7 +30,7 @@ const greenlight_1 = require("./greenlight"); const config = (0, config_1.loadConfig)(); const LND_IP = config.lnd_ip || 'localhost'; // const IS_LND = config.lightning_provider === "LND"; -const IS_GREENLIGHT = config.lightning_provider === 'GREENLIGHT'; +exports.IS_GREENLIGHT = config.lightning_provider === 'GREENLIGHT'; exports.LND_KEYSEND_KEY = 5482373484; exports.SPHINX_CUSTOM_RECORD_KEY = 133773310; const FEE_LIMIT_SAT = 10000; @@ -71,7 +71,7 @@ function loadLightning(tryProxy, ownerPubkey, noCache) { if (lightningClient && !noCache) { return lightningClient; } - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { const credentials = loadGreenlightCredentials(); const descriptor = grpc.load('proto/greenlight.proto'); const greenlight = descriptor.greenlight; @@ -153,7 +153,7 @@ exports.setLock = setLock; function queryRoute(pub_key, amt, route_hint, ownerPubkey) { return __awaiter(this, void 0, void 0, function* () { logger_1.sphinxLogger.info('queryRoute', logger_1.logging.Lightning); - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { // shim for now return { success_prob: 1, @@ -233,7 +233,7 @@ function sendPayment(payment_request, ownerPubkey) { }); } else { - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { lightning.pay({ bolt11: payment_request, timeout: 12, @@ -271,25 +271,32 @@ function keysend(opts, ownerPubkey) { return new Promise(function (resolve, reject) { return __awaiter(this, void 0, void 0, function* () { try { - const preimage = ByteBuffer.wrap(crypto.randomBytes(32)); + const preimage = crypto.randomBytes(32); + const payment_hash = sha.sha256.arrayBuffer(preimage); const dest_custom_records = { - [`${exports.LND_KEYSEND_KEY}`]: preimage, + [exports.LND_KEYSEND_KEY]: preimage, }; if (opts.extra_tlv) { Object.entries(opts.extra_tlv).forEach(([k, v]) => { - dest_custom_records[k] = ByteBuffer.fromUTF8(v); + dest_custom_records[k] = Buffer.from(v, 'utf8'); }); } + // feature bits: + // 9: tlv-onion + // 15: payment-addr + // 30: amp (required) + const keysend_features = [9]; + const amp_features = [9, 15, 30]; const options = { amt: Math.max(opts.amt, constants_1.default.min_sat_amount || 3), final_cltv_delta: 10, dest: ByteBuffer.fromHex(opts.dest), dest_custom_records, - payment_hash: sha.sha256.arrayBuffer(preimage.toBuffer()), - dest_features: [9], + payment_hash, + dest_features: keysend_features, }; if (opts.data) { - options.dest_custom_records[`${exports.SPHINX_CUSTOM_RECORD_KEY}`] = + options.dest_custom_records[exports.SPHINX_CUSTOM_RECORD_KEY] = ByteBuffer.fromUTF8(opts.data); } // add in route hints @@ -323,7 +330,7 @@ function keysend(opts, ownerPubkey) { }); } else { - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { const lightning = yield loadLightning(false, ownerPubkey); const req = interfaces.keysendRequest(options); // console.log("KEYSEND REQ", JSON.stringify(req)) @@ -337,31 +344,54 @@ function keysend(opts, ownerPubkey) { }); } else { - // console.log("SEND sendPaymentV2", options) - // new sendPayment (with optional route hints) + delete options.payment_hash; + delete dest_custom_records[exports.LND_KEYSEND_KEY]; + options.dest_features = amp_features; + options.amp = true; options.fee_limit_sat = FEE_LIMIT_SAT; options.timeout_seconds = 16; const router = yield loadRouter(); const call = router.sendPaymentV2(options); call.on('data', function (payment) { - const state = payment.status || payment.state; - if (payment.payment_error) { - reject(payment.payment_error); - } - else { - if (state === 'IN_FLIGHT') { - // do nothing - } - else if (state === 'FAILED_NO_ROUTE') { - reject(payment.failure_reason || payment); + return __awaiter(this, void 0, void 0, function* () { + const ampState = payment.status || payment.state; + if (payment.payment_error) { + reject(payment.payment_error); } - else if (state === 'FAILED') { - reject(payment.failure_reason || payment); + else { + if (ampState === 'SUCCEEDED') { + resolve(payment); + } + else if (ampState !== 'IN_FLIGHT') { + logger_1.sphinxLogger.debug(`AMP ${ampState}, trying keysend`, logger_1.logging.Lightning); + yield new Promise((resolve, reject) => router.resetMissionControl({}, (err) => err ? reject(err) : resolve())); + // restore options + options.payment_hash = payment_hash; + options.dest_custom_records[exports.LND_KEYSEND_KEY] = preimage; + options.dest_features = keysend_features; + delete options.amp; + const call = router.sendPaymentV2(options); + call.on('data', function (payment) { + const keysendState = payment.status || payment.state; + if (payment.payment_error) { + reject(payment.payment_error); + } + else { + if (keysendState === 'SUCCEEDED') { + resolve(payment); + } + else if (keysendState !== 'IN_FLIGHT') { + logger_1.sphinxLogger.debug(`AMP ${ampState} and keysend ${keysendState}`, logger_1.logging.Lightning); + reject(payment.failure_reason || payment); + } + } + }); + call.on('error', function (err) { + reject(err); + }); + } } - else if (state === 'SUCCEEDED') { - resolve(payment); - } - } + }); }); call.on('error', function (err) { reject(err); @@ -571,7 +601,7 @@ function signBuffer(msg, ownerPubkey) { logger_1.sphinxLogger.info('signBuffer', logger_1.logging.Lightning); return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { try { - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { const pld = interfaces.greenlightSignMessagePayload(msg); const sig = libhsmd_1.default.Handle(1024, 0, null, pld); const sigBuf = Buffer.from(sig, 'hex'); @@ -615,7 +645,7 @@ function verifyMessage(msg, sig, ownerPubkey) { logger_1.sphinxLogger.info('verifyMessage', logger_1.logging.Lightning); return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { try { - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { const fullBytes = zbase32.decode(sig); const sigBytes = fullBytes.slice(1); const recidBytes = fullBytes.slice(0, 1); @@ -747,7 +777,7 @@ exports.listChannels = listChannels; function pendingChannels(ownerPubkey) { return __awaiter(this, void 0, void 0, function* () { logger_1.sphinxLogger.info('pendingChannels', logger_1.logging.Lightning); - if (IS_GREENLIGHT) + if (exports.IS_GREENLIGHT) return []; return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { const lightning = yield loadLightning(true, ownerPubkey); // try proxy @@ -807,7 +837,7 @@ function complexBalances(ownerPubkey) { logger_1.sphinxLogger.info('complexBalances', logger_1.logging.Lightning); const channelList = yield listChannels({}, ownerPubkey); const { channels } = channelList; - if (IS_GREENLIGHT) { + if (exports.IS_GREENLIGHT) { const local_balance = channels.reduce((a, chan) => a + parseInt(chan.local_balance), 0); return { reserve: 0, @@ -818,7 +848,8 @@ function complexBalances(ownerPubkey) { } else { const reserve = channels.reduce((a, chan) => a + parseInt(chan.local_chan_reserve_sat), 0); - const spendableBalance = channels.reduce((a, chan) => a + Math.max(0, parseInt(chan.local_balance) - parseInt(chan.local_chan_reserve_sat)), 0); + const spendableBalance = channels.reduce((a, chan) => a + + Math.max(0, parseInt(chan.local_balance) - parseInt(chan.local_chan_reserve_sat)), 0); const response = yield channelBalance(ownerPubkey); return { reserve, @@ -850,7 +881,7 @@ exports.channelBalance = channelBalance; function getChanInfo(chan_id, tryProxy) { return __awaiter(this, void 0, void 0, function* () { // log('getChanInfo') - if (IS_GREENLIGHT) + if (exports.IS_GREENLIGHT) return {}; // skip for now return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { if (!chan_id) { diff --git a/dist/src/grpc/lightning.js.map b/dist/src/grpc/lightning.js.map index b9a5f16db..9695d2462 100644 --- a/dist/src/grpc/lightning.js.map +++ b/dist/src/grpc/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/grpc/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAkC;AAClC,iCAAgC;AAChC,iCAAgC;AAChC,4CAAoC;AACpC,gDAA+C;AAC/C,4CAA4C;AAC5C,0CAA4D;AAC5D,4CAAuD;AACvD,2CAA0C;AAC1C,4CAA2C;AAC3C,uCAAsC;AACtC,uCAA+B;AAC/B,6CAAsD;AAGtD,kDAAkD;AAClD,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAA;AAC3B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,WAAW,CAAA;AAC3C,sDAAsD;AACtD,MAAM,aAAa,GAAG,MAAM,CAAC,kBAAkB,KAAK,YAAY,CAAA;AAEnD,QAAA,eAAe,GAAG,UAAU,CAAA;AAC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AM,SAAS,GAAG,MAAM,aAAa,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA,CAAC,YAAY;YACrF,SAAS,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,EAAE,QAAQ;gBACxD,IAAI,GAAG,IAAI,IAAI,EAAE;oBACf,OAAO,CAAC,QAAQ,CAAC,CAAA;iBAClB;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,CAAA;iBACZ;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC;CAAA;AAnBD,kCAmBC;AAED,SAAS,aAAa,CAAC,GAAG;IACxB,MAAM,IAAI,GAAa,EAAE,CAAA;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAClD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACf;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACtB,CAAC;AAED,sCAAsC;AACtC,2BAA2B;AAC3B,6BAA6B;AAC7B,aAAa;AACb,yCAAyC;AACzC,8EAA8E;AAC9E,6EAA6E;AAC7E,uCAAuC;AACvC,0FAA0F;AAC1F,6BAA6B;AAC7B,MAAM;AACN,IAAI"} \ No newline at end of file diff --git a/dist/src/grpc/subscribe.js b/dist/src/grpc/subscribe.js index e3ba16e1a..d1f19280f 100644 --- a/dist/src/grpc/subscribe.js +++ b/dist/src/grpc/subscribe.js @@ -39,7 +39,11 @@ function subscribeInvoices(parseKeysendInvoice) { return; } // console.log("IS KEYSEND", inv.is_keysend) - if (inv.is_keysend) { + if ((inv.htlcs && + inv.htlcs[0] && + inv.htlcs[0].custom_records && + lightning_1.SPHINX_CUSTOM_RECORD_KEY in inv.htlcs[0].custom_records) || + inv.is_keysend) { parseKeysendInvoice(inv); } else { diff --git a/dist/src/grpc/subscribe.js.map b/dist/src/grpc/subscribe.js.map index d898e7495..d97b89138 100644 --- a/dist/src/grpc/subscribe.js.map +++ b/dist/src/grpc/subscribe.js.map @@ -1 +1 @@ -{"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../../src/grpc/subscribe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAAqC;AACrC,4CAAgD;AAChD,uCAA6C;AAC7C,2CAA0C;AAC1C,0CAA4D;AAC5D,4CAAuD;AAEvD,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,SAAS;AAE3C,SAAgB,iBAAiB,CAC/B,mBAA6D;IAE7D,OAAO,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,IAAI,IAAA,eAAO,GAAE,EAAE;YACb,WAAW,GAAG,MAAM,IAAA,0BAAkB,GAAE,CAAA;SACzC;QACD,MAAM,SAAS,GAAG,MAAM,IAAA,yBAAa,EAAC,IAAI,EAAE,WAAW,CAAC,CAAA,CAAC,YAAY;QAErE,MAAM,GAAG,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAA;QACzC,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;QAC7B,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,UAAgB,QAAQ;;gBACtC,0CAA0C;gBAC1C,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;gBAClD,uCAAuC;gBACvC,kBAAkB;gBAClB,IAAI,GAA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;oBACjD,MAAM,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;iBACxD;YACH,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;SACT;IACH,CAAC;CAAA;AA1BD,oDA0BC"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 63007301f..b5c6bedd6 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -30,6 +30,7 @@ const proxy_1 = require("../utils/proxy"); const bolt11 = require("@boltz/bolt11"); const config_1 = require("../utils/config"); const logger_1 = require("../utils/logger"); +const sha = require("js-sha256"); const config = (0, config_1.loadConfig)(); /* delete type: @@ -502,14 +503,16 @@ function saveAnonymousKeysend(inv, memo, sender_pubkey, tenant) { const hashCache = {}; function parseKeysendInvoice(i) { return __awaiter(this, void 0, void 0, function* () { - try { - const hash = i.r_hash.toString('base64'); - if (hashCache[hash]) - return; - hashCache[hash] = true; - } - catch (e) { - logger_1.sphinxLogger.error('failed hash cache in parseKeysendInvoice'); + if (Lightning.IS_GREENLIGHT) { + try { + const hash = sha.sha256.hex(JSON.stringify(i)); + if (hashCache[hash]) + return; + hashCache[hash] = true; + } + catch (e) { + logger_1.sphinxLogger.error('failed hash cache in parseKeysendInvoice'); + } } const recs = i.htlcs && i.htlcs[0] && i.htlcs[0].custom_records; let dest = ''; diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index c473d0351..9a85426da 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA+C;AAC/C,+CAA8C;AAC9C,iDAAgD;AAEhD,gDAAwC;AACxC,0CAAyC;AACzC,0CAAyC;AACzC,sCAQkB;AAClB,iCAAqE;AACrE,qCAIiB;AACjB,sCAAoE;AACpE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACz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K,EAAE;aACP,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACzB,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;QACJ,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACf;AACH,CAAC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACjD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;SAC3C;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/tests/controllers/ampPayment.test.js b/dist/src/tests/controllers/ampPayment.test.js new file mode 100644 index 000000000..c626b37fa --- /dev/null +++ b/dist/src/tests/controllers/ampPayment.test.js @@ -0,0 +1,100 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ava_1 = require("ava"); +const msg_1 = require("../utils/msg"); +const nodes_1 = require("../nodes"); +const save_1 = require("../utils/save"); +ava_1.default.serial('ampMessage: send more sats than one channel can handle to test AMP', (t) => __awaiter(void 0, void 0, void 0, function* () { + t.true(Array.isArray(nodes_1.default)); + yield ampMessage(t, nodes_1.default); +})); +function ampMessage(t, nodes) { + return __awaiter(this, void 0, void 0, function* () { + // node accept-keysend accept-amp + // alice true true + // bob false true + // carol true false + // the 3 nodes have 3 2M channels in total with 1M sats local_balance + // + // A + // 1M / \ 1M + // / \ + // / \ + // 1M / \ 1M + // B---------C + // 1M 1M + // + // Test that alice can send a payment of 1.5M sats to bob + // With only keysend this would not work because she has 2x 1M local_balance + // The payment should be split in 2 shards of 750k sats each + // --- shard of 750k sats ---> C --- forward ---> + // A B + // --------- second shard of 750k sats ---------> + { + const node1 = nodes[0]; + const node2 = nodes[1]; + console.log(`amp payment from ${node1.alias} to ${node2.alias}`); + console.log('adding contact'); + const added = yield (0, save_1.addContact)(t, node1, node2); + t.true(added, 'n1 should add n2 as contact'); + console.log('contact added'); + console.log(`sending payment ${node1.alias} -> ${node2.alias}`); + //NODE1 SENDS PAYMENT TO NODE2 + const amount = 1500000; + const paymentText = 'AMP test 1'; + const payment = yield (0, msg_1.sendPayment)(t, node1, node2, amount, paymentText); + console.log(payment); + t.true(payment, 'payment should be sent'); + console.log(`payment sent ${node1.alias} -> ${node2.alias}`); + } + // Nodes will try to send AMP, but carol doesn't `accept-amp` + // Test a payment of 100k sats from bob to carol + { + const node1 = nodes[1]; + const node2 = nodes[2]; + console.log(`amp payment from ${node1.alias} to ${node2.alias}`); + console.log('adding contact'); + const added = yield (0, save_1.addContact)(t, node1, node2); + t.true(added, 'n1 should add n2 as contact'); + console.log('contact added'); + console.log(`sending payment ${node1.alias} -> ${node2.alias}`); + //NODE1 SENDS PAYMENT TO NODE2 + const amount = 100000; + const paymentText = 'AMP test 2'; + const payment = yield (0, msg_1.sendPayment)(t, node1, node2, amount, paymentText); + console.log(payment); + t.true(payment, 'payment should be sent'); + console.log(`payment sent ${node1.alias} -> ${node2.alias}`); + } + // Carol doesn't `accept-amp`, but that doesn't mean he can't send it + // Test a payment of 1.8M sats from carol to alice + { + const node1 = nodes[2]; + const node2 = nodes[0]; + console.log(`amp payment from ${node1.alias} to ${node2.alias}`); + console.log('adding contact'); + const added = yield (0, save_1.addContact)(t, node1, node2); + t.true(added, 'n1 should add n2 as contact'); + console.log('contact added'); + console.log(`sending payment ${node1.alias} -> ${node2.alias}`); + //NODE1 SENDS PAYMENT TO NODE2 + const amount = 1800000; + const paymentText = 'AMP test 3'; + const payment = yield (0, msg_1.sendPayment)(t, node1, node2, amount, paymentText); + console.log(payment); + t.true(payment, 'payment should be sent'); + console.log(`payment sent ${node1.alias} -> ${node2.alias}`); + } + }); +} +module.exports = ampMessage; +//# sourceMappingURL=ampPayment.test.js.map \ No newline at end of file diff --git a/dist/src/tests/controllers/ampPayment.test.js.map b/dist/src/tests/controllers/ampPayment.test.js.map new file mode 100644 index 000000000..60ea5406a --- /dev/null +++ b/dist/src/tests/controllers/ampPayment.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ampPayment.test.js","sourceRoot":"","sources":["../../../../src/tests/controllers/ampPayment.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4C;AAC5C,sCAA0C;AAC1C,oCAA4B;AAC5B,wCAA0C;AAS1C,aAAI,CAAC,MAAM,CACT,oEAAoE,EACpE,CAAO,CAA4B,EAAE,EAAE;IACrC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAK,CAAC,CAAC,CAAA;IAC5B,MAAM,UAAU,CAAC,CAAC,EAAE,eAAK,CAAC,CAAA;AAC5B,CAAC,CAAA,CACF,CAAA;AAED,SAAe,UAAU,CAAC,CAA4B,EAAE,KAAmB;;QACzE,mCAAmC;QACnC,gCAAgC;QAChC,gCAAgC;QAChC,iCAAiC;QAEjC,qEAAqE;QACrE,EAAE;QACF,YAAY;QACZ,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,mBAAmB;QACnB,iBAAiB;QACjB,gBAAgB;QAChB,EAAE;QAEF,yDAAyD;QACzD,4EAA4E;QAC5E,4DAA4D;QAC5D,sDAAsD;QACtD,yDAAyD;QACzD,sD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AAA;YAC5C,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;YAE5B,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;YAC/D,8BAA8B;YAC9B,MAAM,MAAM,GAAG,OAAO,CAAA;YACtB,MAAM,WAAW,GAAG,YAAY,CAAA;YAChC,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAW,EAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAA;YACvE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAA;YACzC,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;SAC7D;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,CAAA"} \ No newline at end of file diff --git a/dist/src/tests/controllers/messageLength.test.js b/dist/src/tests/controllers/messageLength.test.js index fb9b636bd..61bc88a47 100644 --- a/dist/src/tests/controllers/messageLength.test.js +++ b/dist/src/tests/controllers/messageLength.test.js @@ -83,7 +83,7 @@ function longMessage(t, node1, node2) { const longText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Risus feugiat in ante metus dictum at tempor. Ut enim blandit volutpat maecenas volutpat. Velit dignissim sodales ut eu. Eget nunc scelerisque viverra mauris in aliquam sem. Dictum varius duis at consectetur lorem. Maecenas volutpat blandit aliquam etiam erat velit scelerisque. Id velit ut tortor pretium viverra suspendisse potenti. Placerat vestibulum lectus mauris ultrices eros in cursus turpis. Integer vitae justo eget magna. Duis tristique sollicitudin nibh sit amet commodo nulla facilisi nullam. Vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Vitae sapien pellentesque habitant morbi tristique. Varius vel pharetra vel turpis nunc eget lorem dolor. Pellentesque massa placerat duis ultricies lacus sed turpis. Augue neque gravida in fermentum et sollicitudin. Adipiscing elit pellentesque habitant morbi tristique."; console.log("sending long message to", node2.alias); yield (0, msg_1.sendMessage)(t, node1, node2, longText); - yield (0, helpers_1.sleep)(1000); + yield (0, helpers_1.sleep)(2000); //Checking for the new long message const onlyMessage = yield (0, get_1.getCheckAllMessages)(t, node2, limit, offset, 'desc'); t.true(decrypt(onlyMessage.new_messages[0], node2) == longText, 'reciever should get long message'); diff --git a/dist/src/tests/utils/get/getCheckMsgs.js b/dist/src/tests/utils/get/getCheckMsgs.js index a551ac4ff..d962efb1f 100644 --- a/dist/src/tests/utils/get/getCheckMsgs.js +++ b/dist/src/tests/utils/get/getCheckMsgs.js @@ -22,7 +22,7 @@ function getCheckMsgs(_t, node, date, limit, offset, order = 'asc') { exports.getCheckMsgs = getCheckMsgs; function timeout(i, node, date, limit, offset, order, resolve, reject) { return __awaiter(this, void 0, void 0, function* () { - const msgRes = yield http.get(`${node.external_ip}/msgs?date=${date}&limit=${limit}&offset=${offset}&order=${order}`, (0, helpers_1.makeArgs)(node)); + const msgRes = yield http.get(`${node.external_ip}/msgs?date=${date.toISOString().replace(/T/, ' ').replace(/\..+/, '')}&limit=${limit}&offset=${offset}&order=${order}`, (0, helpers_1.makeArgs)(node)); if (msgRes.response.new_messages && msgRes.response.new_messages.length) { // console.log('===>', msgRes.response.new_messages ) return resolve(msgRes.response); diff --git a/dist/src/tests/utils/get/getCheckMsgs.js.map b/dist/src/tests/utils/get/getCheckMsgs.js.map index cea3b1243..48dec1f7f 100644 --- a/dist/src/tests/utils/get/getCheckMsgs.js.map +++ b/dist/src/tests/utils/get/getCheckMsgs.js.map @@ -1 +1 @@ -{"version":3,"file":"getCheckMsgs.js","sourceRoot":"","sources":["../../../../../src/tests/utils/get/getCheckMsgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAgC;AAChC,wCAAqC;AAIrC,S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AK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;QACnE,CAAC,CAAA,EAAE,IAAI,CAAC,CAAA;IACV,CAAC;CAAA"} \ No newline at end of file diff --git a/package.json b/package.json index 3184238aa..11bf0de26 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "dev": "rm -rf dist/ && tsc && cp -r public dist/public && node --inspect ./dist/app.js", "build-binaries": "rm -rf dist/ && tsc && cp config/app.json dist/config/app.json && cp config/config.json dist/config/config.json && pkg . --target node12-alpine-x64,node12-macos-x64 --out-path binaries", "start-ecs": "cp config/app.json dist/config/app.json && cp config/config.json dist/config/config.json && export NODE_ENV=production && node --max-old-space-size=128 dist/app.js", - "lint": "eslint ./src/*.ts ./src/**/*.ts --fix --max-warnings 466" + "lint": "eslint ./src/*.ts ./src/**/*.ts --fix --max-warnings 465" }, "keywords": [], "author": "", diff --git a/src/grpc/interfaces.ts b/src/grpc/interfaces.ts index 6368dc94b..38a3a15b7 100644 --- a/src/grpc/interfaces.ts +++ b/src/grpc/interfaces.ts @@ -351,18 +351,19 @@ export function listPeersResponse( } export type Buf = Buffer | ByteBuffer | ArrayBuffer -type DestCustomRecords = { [k: string]: Buf } +export type DestCustomRecords = { [k: number]: Buf } export interface KeysendRequest { amt: number final_cltv_delta: number dest: Buf dest_custom_records: DestCustomRecords - payment_hash: Buf + payment_hash?: Buf dest_features: number[] route_hints?: RouteHint[] fee_limit?: { [k: string]: number } fee_limit_sat?: number timeout_seconds?: number + amp?: boolean } interface GreenlightHop { node_id: Buf @@ -530,6 +531,7 @@ export interface Invoice { htlcs: InvoiceHTLC[] features: { [k: string]: any } is_keysend: boolean + is_amp: boolean } // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Payment { diff --git a/src/grpc/lightning.ts b/src/grpc/lightning.ts index 29607d0a0..11b912f08 100644 --- a/src/grpc/lightning.ts +++ b/src/grpc/lightning.ts @@ -20,7 +20,7 @@ import { Req } from '../types' const config = loadConfig() const LND_IP = config.lnd_ip || 'localhost' // const IS_LND = config.lightning_provider === "LND"; -const IS_GREENLIGHT = config.lightning_provider === 'GREENLIGHT' +export const IS_GREENLIGHT = config.lightning_provider === 'GREENLIGHT' export const LND_KEYSEND_KEY = 5482373484 export const SPHINX_CUSTOM_RECORD_KEY = 133773310 @@ -289,25 +289,32 @@ export function keysend( sphinxLogger.info('keysend', logging.Lightning) return new Promise(async function (resolve, reject) { try { - const preimage = ByteBuffer.wrap(crypto.randomBytes(32)) - const dest_custom_records = { - [`${LND_KEYSEND_KEY}`]: preimage, + const preimage = crypto.randomBytes(32) + const payment_hash = sha.sha256.arrayBuffer(preimage) + const dest_custom_records: interfaces.DestCustomRecords = { + [LND_KEYSEND_KEY]: preimage, } if (opts.extra_tlv) { Object.entries(opts.extra_tlv).forEach(([k, v]) => { - dest_custom_records[k] = ByteBuffer.fromUTF8(v) + dest_custom_records[k] = Buffer.from(v, 'utf8') }) } + // feature bits: + // 9: tlv-onion + // 15: payment-addr + // 30: amp (required) + const keysend_features = [9] + const amp_features = [9, 15, 30] const options: interfaces.KeysendRequest = { amt: Math.max(opts.amt, constants.min_sat_amount || 3), final_cltv_delta: 10, dest: ByteBuffer.fromHex(opts.dest), dest_custom_records, - payment_hash: sha.sha256.arrayBuffer(preimage.toBuffer()), - dest_features: [9], + payment_hash, + dest_features: keysend_features, } if (opts.data) { - options.dest_custom_records[`${SPHINX_CUSTOM_RECORD_KEY}`] = + options.dest_custom_records[SPHINX_CUSTOM_RECORD_KEY] = ByteBuffer.fromUTF8(opts.data) } // add in route hints @@ -350,25 +357,57 @@ export function keysend( } }) } else { - // console.log("SEND sendPaymentV2", options) - // new sendPayment (with optional route hints) + delete options.payment_hash + delete dest_custom_records[LND_KEYSEND_KEY] + options.dest_features = amp_features + options.amp = true + options.fee_limit_sat = FEE_LIMIT_SAT options.timeout_seconds = 16 const router = await loadRouter() const call = router.sendPaymentV2(options) - call.on('data', function (payment) { - const state = payment.status || payment.state + call.on('data', async function (payment) { + const ampState: string = payment.status || payment.state if (payment.payment_error) { reject(payment.payment_error) } else { - if (state === 'IN_FLIGHT') { - // do nothing - } else if (state === 'FAILED_NO_ROUTE') { - reject(payment.failure_reason || payment) - } else if (state === 'FAILED') { - reject(payment.failure_reason || payment) - } else if (state === 'SUCCEEDED') { + if (ampState === 'SUCCEEDED') { resolve(payment) + } else if (ampState !== 'IN_FLIGHT') { + sphinxLogger.debug( + `AMP ${ampState}, trying keysend`, + logging.Lightning + ) + await new Promise((resolve, reject) => + router.resetMissionControl({}, (err) => + err ? reject(err) : resolve() + ) + ) + // restore options + options.payment_hash = payment_hash + options.dest_custom_records[LND_KEYSEND_KEY] = preimage + options.dest_features = keysend_features + delete options.amp + const call = router.sendPaymentV2(options) + call.on('data', function (payment) { + const keysendState: string = payment.status || payment.state + if (payment.payment_error) { + reject(payment.payment_error) + } else { + if (keysendState === 'SUCCEEDED') { + resolve(payment) + } else if (keysendState !== 'IN_FLIGHT') { + sphinxLogger.debug( + `AMP ${ampState} and keysend ${keysendState}`, + logging.Lightning + ) + reject(payment.failure_reason || payment) + } + } + }) + call.on('error', function (err) { + reject(err) + }) } } }) @@ -488,7 +527,10 @@ export async function listAllInvoices(): Promise { return paginateInvoices(40) } -async function paginateInvoices(limit: number, i = 0): Promise { +async function paginateInvoices( + limit: number, + i = 0 +): Promise { try { const r = await listInvoicesPaginated(limit, i) const lastOffset = parseInt(r.first_index_offset) @@ -501,7 +543,10 @@ async function paginateInvoices(limit: number, i = 0): Promise { +function listInvoicesPaginated( + limit: number, + offset: number +): Promise<{ first_index_offset: string; invoices: interfaces.Invoice[] }> { return new Promise(async (resolve, reject) => { const lightning = await loadLightning() lightning.listInvoices( @@ -526,7 +571,10 @@ export async function listAllPayments(): Promise { return pays } -async function paginatePayments(limit: number, i = 0): Promise { +async function paginatePayments( + limit: number, + i = 0 +): Promise { try { const r = await listPaymentsPaginated(limit, i) const lastOffset = parseInt(r.first_index_offset) // this is "first" cuz its in reverse (lowest index) @@ -539,7 +587,10 @@ async function paginatePayments(limit: number, i = 0): Promise { +export function listPaymentsPaginated( + limit: number, + offset: number +): Promise<{ first_index_offset: string; payments: interfaces.Payment[] }> { return new Promise(async (resolve, reject) => { const lightning = await loadLightning() lightning.listPayments( @@ -556,7 +607,9 @@ export function listPaymentsPaginated(limit: number, offset: number): Promise<{ }) } -export function listAllPaymentsFull(): Promise<{ payments: interfaces.Payment[] }> { +export function listAllPaymentsFull(): Promise<{ + payments: interfaces.Payment[] +}> { sphinxLogger.info('=> list all payments') return new Promise(async (resolve, reject) => { const lightning = await loadLightning() @@ -571,7 +624,10 @@ export function listAllPaymentsFull(): Promise<{ payments: interfaces.Payment[] } // msg is hex -export async function signMessage(msg: string, ownerPubkey?: string): Promise { +export async function signMessage( + msg: string, + ownerPubkey?: string +): Promise { return signBuffer(Buffer.from(msg, 'hex'), ownerPubkey) } @@ -859,7 +915,12 @@ export async function complexBalances( 0 ) const spendableBalance = channels.reduce( - (a, chan) => a + Math.max(0, parseInt(chan.local_balance) - parseInt(chan.local_chan_reserve_sat)), + (a, chan) => + a + + Math.max( + 0, + parseInt(chan.local_balance) - parseInt(chan.local_chan_reserve_sat) + ), 0 ) const response = await channelBalance(ownerPubkey) diff --git a/src/grpc/subscribe.ts b/src/grpc/subscribe.ts index 7450b4ec4..e5b82432c 100644 --- a/src/grpc/subscribe.ts +++ b/src/grpc/subscribe.ts @@ -1,4 +1,4 @@ -import { loadLightning } from './lightning' +import { loadLightning, SPHINX_CUSTOM_RECORD_KEY } from './lightning' import * as network from '../network' import { tryToUnlockLND } from '../utils/unlock' import { receiveNonKeysend } from './regular' @@ -31,7 +31,13 @@ export function subscribeInvoices( return } // console.log("IS KEYSEND", inv.is_keysend) - if (inv.is_keysend) { + if ( + (inv.htlcs && + inv.htlcs[0] && + inv.htlcs[0].custom_records && + SPHINX_CUSTOM_RECORD_KEY in inv.htlcs[0].custom_records) || + inv.is_keysend + ) { parseKeysendInvoice(inv) } else { receiveNonKeysend(inv) diff --git a/src/network/receive.ts b/src/network/receive.ts index 7896876c8..6ecb61dbb 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -32,6 +32,7 @@ import * as bolt11 from '@boltz/bolt11' import { loadConfig } from '../utils/config' import { sphinxLogger, logging } from '../utils/logger' import { Payload, AdminPayload } from './interfaces' +import * as sha from 'js-sha256' const config = loadConfig() /* @@ -535,12 +536,14 @@ const hashCache: { [k: string]: boolean } = {} export async function parseKeysendInvoice( i: interfaces.Invoice ): Promise { - try { - const hash = i.r_hash.toString('base64') - if (hashCache[hash]) return - hashCache[hash] = true - } catch (e) { - sphinxLogger.error('failed hash cache in parseKeysendInvoice') + if (Lightning.IS_GREENLIGHT) { + try { + const hash = sha.sha256.hex(JSON.stringify(i)) + if (hashCache[hash]) return + hashCache[hash] = true + } catch (e) { + sphinxLogger.error('failed hash cache in parseKeysendInvoice') + } } const recs = i.htlcs && i.htlcs[0] && i.htlcs[0].custom_records diff --git a/src/tests/configs/.gitignore b/src/tests/configs/.gitignore new file mode 100644 index 000000000..6a4e54da1 --- /dev/null +++ b/src/tests/configs/.gitignore @@ -0,0 +1 @@ +nodes.json diff --git a/src/tests/configs/nodes.json b/src/tests/configs/nodes.json deleted file mode 100644 index db3c17c6f..000000000 --- a/src/tests/configs/nodes.json +++ /dev/null @@ -1,35 +0,0 @@ -[ - { - "alias": "alice", - "pubkey": "03a394d0ebf0d003124ab130c6b12b8b990a50a30a464354800a51981ba745bb07", - "ip": "http://alice.sphinx:3001", - "external_ip": "http://localhost:3001", - "authToken": "/3S3tM7OZxsgpgGcWghn", - "contact_key": "MIIBCgKCAQEA4qi6zHioHi3fnLOO5s/9YykchQI/DWGnRut5fmt1TaYyigd+zivgXrSndPoGp+J2rvzcavjIlOfbi+omxNNOMv4I9RY+pstcs+qMZ+l4WgtldxJbFGDlyXEBMQUh2AF1xT5arl13PzERvcCMeFViP17WeCvX31Zv4A9bFiXhREsaCQgdONxg5Cv7i9UNjAQnwiwXJ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c29uMzZweFFubkFlaHJRZmVTalJEL1M0ZnB1L2pvYnhxNWRxT2VxQXRGU1RzM0djcUg3RHVWcFBvY2xFYVBuTTVlQmtVdmZvZDBHQi9FUU5ac24xT3RyMFVUaz0=", - "pin": "111111" - }, - { - "alias": "bob", - "pubkey": "02a38857848aca6b32ebcc3c85d07ee41354988f4f1e0b4e6ccd255eee6ed75b8d", - "ip": "http://bob.sphinx:3002", - "external_ip": "http://localhost:3002", - "authToken": "BbANspHdDk5umWHei/0t", - "contact_key": "MIIBCgKCAQEAoSzSQ6XsQTi0SpO0ljU7F1ZM5LIW2dtYU4rR79KbK/EttDmJ7CPISIznyybwS5ANUocC1BWrJTezhSu7hOd1YoW8wU48J3aNn9I3eGzDV4F2hF1pw3iZ36oIiEvaPv2CYswXGocldRgGEurkTXU/4zcxYUYBqo4/ZCGWXm5M76QASggq2rp8auBMPU7jgoG5DXifsdiXKVQkYjCtD2SBBhvEwvHXVaBs2xJEr1aFBjGRqeoyqMbFfECM7RKe2JeeEz0y686/dAscxIgIQp18OEyd3aS92i+lrBv/MzdJHGoST6VQ1nNDKI8AIDPium2R4tp04TtOS7X3ytZet7RdZQIDAQAB", - "privkey": "MIIEowIBAAKCAQEAoSzSQ6XsQTi0SpO0ljU7F1ZM5LIW2dtYU4rR79KbK/EttDmJ7CPISIznyybwS5ANUocC1BWrJTezhSu7hOd1YoW8wU48J3aNn9I3eGzDV4F2hF1pw3iZ36oIiEvaPv2CYswXGocldRgGEurkTXU/4zcxYUYBqo4/ZCGWXm5M76QASggq2rp8auBMPU7jgoG5DXifsdiXKVQkYjCtD2SBBhvEwvHXVaBs2xJEr1aFBjGRqeoyqMbFfECM7RKe2JeeEz0y686/dAscxIgIQp18OEyd3aS92i+lrBv/MzdJHGoST6VQ1nNDKI8AIDPium2R4tp04TtOS7X3ytZet7RdZQIDAQABAoIBAEnWht2G/h1DJRWlZW4LJO8kEkYTcHSOEID1cAg2q/ANpaqTUaRlIDRcmTRwulVjwTa1s44F/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JES3U0NWV6TGxPcmRkWXdOV2FpNFpJaVBPeHZhcjFGN2tpVm1uelp3WVN6dVorUTdoaFRaQnArMU9rc3hzanI1YS9UQXZ3RGxiRDU0VXl6Zklyc2JtN0VWbTFDczBZNmZuc0ZVcHFBeTcvVEtxcnIvc2h1bUNvWVloejBDQVE3RlF1YlJ4N0lzTS95VEEwUElGaHAyWFhMa25qV3RHbVRyQVNIQ1VsTTBkTUJlR0s5V3pDRzE1WUFESlpPOTlKdEVMWU9wMTJTSzdlMGIyQVkvTHNoWkZMU2VyblRGMU4zRFdZS0ozeXc5NHZMek11d0ZCcUlKY2VQeXpqdEdBVjdHMHpPaUt1RGF2QTk4MFRmOTc4cC9PRndwNVFHcFhVSHRVMUJvbUNPcWdPcDNSTW9RT2lLT2tnYmhnMHZFMVphQ2RMVmVRMG05YVFMOWwwQmNpTk4vRlV6RXRRUXFELzRBK2RKT05BZUlXUFFJeEZOSmZXZE1iQkppTlZsS0FLNGVZOExBcXRpSmEzWklDL2kwSDVUaHZ3VnJ0UzJUZmM1ZXJQOWR4eEg4d3p3b2tBST0=", - "pin": "111111" - }, - { - "alias": "carol", - "pubkey": "0364c05cbcbb9612036cc66297445a88bcfc21941fd816e17a56b54b0b52ff02b9", - "ip": "http://carol.sphinx:3003", - "external_ip": "http://localhost:3003", - "authToken": "zdcZoHGIMddIA5xO6I/Z", - "contact_key": "MIIBCgKCAQEAtAvyMIBFrRc9p14gvgn9znFkI0XeEnvUU7NtW0yOuvvWVpWsjI0bOaPRWL9N4GsNnHr2LJwqxBsdk5TaPd1fDkZiJWXQEYfPe3nQwRgIS10EzbKgF/XP1RSAuyvvP7lotalpDEyMPz9oCLtrtBBKoy4YbQhgtVZkNWo8z26jSlvQZR0QIa63tc+p0NzRq5NV0nKieqJidValahAuk3zb13gEnuoWh97QP71itez0EmQB9RugLTakMklHdbJAj5vrjFa0XJpZPqL+a9sXFC27UGMgJ79X8Gyoc8F1Htg52ma+FuETCKFc3YCVZiPo7uFhbcI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5QXVpcz0=", - "pin": "111111" - } -] diff --git a/src/tests/controllers/ampPayment.test.ts b/src/tests/controllers/ampPayment.test.ts new file mode 100644 index 000000000..1401c22cc --- /dev/null +++ b/src/tests/controllers/ampPayment.test.ts @@ -0,0 +1,115 @@ +import test, { ExecutionContext } from 'ava' +import { sendPayment } from '../utils/msg' +import nodes from '../nodes' +import { addContact } from '../utils/save' +import { NodeConfig } from '../types' + +/* + npx ava src/tests/controllers/ampPayment.test.ts --verbose --serial --timeout=2m +*/ + +interface Context {} + +test.serial( + 'ampMessage: send more sats than one channel can handle to test AMP', + async (t: ExecutionContext) => { + t.true(Array.isArray(nodes)) + await ampMessage(t, nodes) + } +) + +async function ampMessage(t: ExecutionContext, nodes: NodeConfig[]) { + // node accept-keysend accept-amp + // alice true true + // bob false true + // carol true false + + // the 3 nodes have 3 2M channels in total with 1M sats local_balance + // + // A + // 1M / \ 1M + // / \ + // / \ + // 1M / \ 1M + // B---------C + // 1M 1M + // + + // Test that alice can send a payment of 1.5M sats to bob + // With only keysend this would not work because she has 2x 1M local_balance + // The payment should be split in 2 shards of 750k sats each + // --- shard of 750k sats ---> C --- forward ---> + // A B + // --------- second shard of 750k sats ---------> + + { + const node1 = nodes[0] + const node2 = nodes[1] + + console.log(`amp payment from ${node1.alias} to ${node2.alias}`) + + console.log('adding contact') + const added = await addContact(t, node1, node2) + t.true(added, 'n1 should add n2 as contact') + console.log('contact added') + + console.log(`sending payment ${node1.alias} -> ${node2.alias}`) + //NODE1 SENDS PAYMENT TO NODE2 + const amount = 1500000 + const paymentText = 'AMP test 1' + const payment = await sendPayment(t, node1, node2, amount, paymentText) + console.log(payment) + t.true(payment, 'payment should be sent') + console.log(`payment sent ${node1.alias} -> ${node2.alias}`) + } + + // Nodes will try to send AMP, but carol doesn't `accept-amp` + // Test a payment of 100k sats from bob to carol + + { + const node1 = nodes[1] + const node2 = nodes[2] + + console.log(`amp payment from ${node1.alias} to ${node2.alias}`) + + console.log('adding contact') + const added = await addContact(t, node1, node2) + t.true(added, 'n1 should add n2 as contact') + console.log('contact added') + + console.log(`sending payment ${node1.alias} -> ${node2.alias}`) + //NODE1 SENDS PAYMENT TO NODE2 + const amount = 100000 + const paymentText = 'AMP test 2' + const payment = await sendPayment(t, node1, node2, amount, paymentText) + console.log(payment) + t.true(payment, 'payment should be sent') + console.log(`payment sent ${node1.alias} -> ${node2.alias}`) + } + + // Carol doesn't `accept-amp`, but that doesn't mean he can't send it + // Test a payment of 1.8M sats from carol to alice + + { + const node1 = nodes[2] + const node2 = nodes[0] + + console.log(`amp payment from ${node1.alias} to ${node2.alias}`) + + console.log('adding contact') + const added = await addContact(t, node1, node2) + t.true(added, 'n1 should add n2 as contact') + console.log('contact added') + + console.log(`sending payment ${node1.alias} -> ${node2.alias}`) + //NODE1 SENDS PAYMENT TO NODE2 + const amount = 1800000 + const paymentText = 'AMP test 3' + const payment = await sendPayment(t, node1, node2, amount, paymentText) + console.log(payment) + t.true(payment, 'payment should be sent') + console.log(`payment sent ${node1.alias} -> ${node2.alias}`) + } +} + +module.exports = ampMessage diff --git a/src/tests/controllers/messageLength.test.ts b/src/tests/controllers/messageLength.test.ts index aa9b41dcc..5b60a06df 100644 --- a/src/tests/controllers/messageLength.test.ts +++ b/src/tests/controllers/messageLength.test.ts @@ -120,7 +120,7 @@ export async function longMessage(t, node1, node2) { const longText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Risus feugiat in ante metus dictum at tempor. Ut enim blandit volutpat maecenas volutpat. Velit dignissim sodales ut eu. Eget nunc scelerisque viverra mauris in aliquam sem. Dictum varius duis at consectetur lorem. Maecenas volutpat blandit aliquam etiam erat velit scelerisque. Id velit ut tortor pretium viverra suspendisse potenti. Placerat vestibulum lectus mauris ultrices eros in cursus turpis. Integer vitae justo eget magna. Duis tristique sollicitudin nibh sit amet commodo nulla facilisi nullam. Vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Vitae sapien pellentesque habitant morbi tristique. Varius vel pharetra vel turpis nunc eget lorem dolor. Pellentesque massa placerat duis ultricies lacus sed turpis. Augue neque gravida in fermentum et sollicitudin. Adipiscing elit pellentesque habitant morbi tristique." console.log("sending long message to", node2.alias) await sendMessage(t, node1, node2, longText) - await sleep(1000) + await sleep(2000) //Checking for the new long message const onlyMessage = await getCheckAllMessages(t, node2, limit, offset, 'desc') diff --git a/src/tests/utils/get/getCheckMsgs.ts b/src/tests/utils/get/getCheckMsgs.ts index df223d047..167605fd9 100644 --- a/src/tests/utils/get/getCheckMsgs.ts +++ b/src/tests/utils/get/getCheckMsgs.ts @@ -6,7 +6,7 @@ import { Assertions } from 'ava' export function getCheckMsgs( _t: Assertions, node: NodeConfig, - date: any, + date: Date, limit: number, offset: number, order: string = 'asc' @@ -21,7 +21,7 @@ export function getCheckMsgs( async function timeout( i: number, node: NodeConfig, - date: any, + date: Date, limit: number, offset: number, order: string, @@ -29,7 +29,7 @@ async function timeout( reject ) { const msgRes = await http.get( - `${node.external_ip}/msgs?date=${date}&limit=${limit}&offset=${offset}&order=${order}`, + `${node.external_ip}/msgs?date=${date.toISOString().replace(/T/, ' ').replace(/\..+/, '')}&limit=${limit}&offset=${offset}&order=${order}`, makeArgs(node) ) if (msgRes.response.new_messages && msgRes.response.new_messages.length) {