From 1b728ee26d87f90a638f3689d54b837fa83fb375 Mon Sep 17 00:00:00 2001 From: Blair Currey <12960453+BlairCurrey@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:32:36 +0300 Subject: [PATCH] feat(backend): add tracing, metrics, get peer tweak --- .../provisioning/dashboards/example.json | 430 +++++++++++++----- .../backend/src/accounting/psql/service.ts | 17 +- .../src/accounting/tigerbeetle/service.ts | 8 + packages/backend/src/index.ts | 11 +- .../payment/outgoing/lifecycle.ts | 37 +- .../src/open_payments/receiver/service.ts | 13 +- .../src/payment-method/ilp/connector/index.ts | 109 +++-- .../src/payment-method/ilp/peer/service.ts | 2 +- pnpm-lock.yaml | 249 +++------- .../scripts/create-outgoing-payments.js | 2 +- 10 files changed, 521 insertions(+), 357 deletions(-) diff --git a/localenv/telemetry/grafana/provisioning/dashboards/example.json b/localenv/telemetry/grafana/provisioning/dashboards/example.json index e34f435ac2..58ef92d6c7 100644 --- a/localenv/telemetry/grafana/provisioning/dashboards/example.json +++ b/localenv/telemetry/grafana/provisioning/dashboards/example.json @@ -76,22 +76,25 @@ "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [] }, "gridPos": { - "h": 8, + "h": 6, "w": 12, "x": 0, "y": 0 }, - "id": 11, + "id": 12, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "p95" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -106,14 +109,27 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (callName) (rate(psql_getAccountBalances_sum[$__rate_interval])/rate(psql_getAccountBalances_count[$__rate_interval]))", + "expr": "sum by (callName) (rate(connector_middleware_sum[$__rate_interval])/rate(connector_middleware_count[$__rate_interval]))", "instant": false, - "legendFormat": "__auto", + "legendFormat": "{{caller}}", "range": true, "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum by (callName) (rate(connector_middleware_stack_sum[$__rate_interval])/rate(connector_middleware_stack_count[$__rate_interval]))", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" } ], - "title": "PSQL Get Account Balance", + "title": "ILP Connector", "type": "timeseries" }, { @@ -171,12 +187,13 @@ "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [] }, "gridPos": { - "h": 8, + "h": 6, "w": 12, "x": 12, "y": 0 @@ -184,9 +201,11 @@ "id": 9, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "p95" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -338,17 +357,19 @@ "overrides": [] }, "gridPos": { - "h": 8, + "h": 5, "w": 12, "x": 0, - "y": 8 + "y": 6 }, - "id": 10, + "id": 7, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "p95" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -363,9 +384,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (callName) (rate(getPendingPayment_sum[$__rate_interval])/rate(getPendingPayment_count[$__rate_interval]))", + "expr": "rate(quote_service_create_time_ms_sum[$__rate_interval])/rate(quote_service_create_time_ms_count[$__rate_interval])", "instant": false, - "legendFormat": "{{caller}}", + "legendFormat": "{{description}}", "range": true, "refId": "A" }, @@ -375,33 +396,110 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (callName) (rate(handleSending_sum[$__rate_interval])/rate(handleSending_count[$__rate_interval]))", + "expr": "rate(quote_service_create_resolve_receiver_time_ms_sum[$__rate_interval])/rate(quote_service_create_resolve_receiver_time_ms_count[$__rate_interval])", "hide": false, "instant": false, - "legendFormat": "__auto", + "legendFormat": "{{description}}", "range": true, "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(quote_service_create_get_quote_time_ms_sum[$__rate_interval])/rate(quote_service_create_get_quote_time_ms_count[$__rate_interval])", + "hide": false, + "instant": false, + "legendFormat": "{{description}}", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(quote_service_create_get_latest_fee_time_ms_sum[$__rate_interval])/rate(quote_service_create_get_latest_fee_time_ms_count[$__rate_interval])", + "hide": false, + "instant": false, + "legendFormat": "{{description}}", + "range": true, + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(quote_service_create_insert_time_ms_sum[$__rate_interval])/rate(quote_service_create_insert_time_ms_count[$__rate_interval])", + "hide": false, + "instant": false, + "legendFormat": "{{description}}", + "range": true, + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(quote_service_finalize_quote_ms_sum[$__rate_interval])/rate(quote_service_finalize_quote_ms_count[$__rate_interval])", + "hide": false, + "instant": false, + "legendFormat": "{{description}}", + "range": true, + "refId": "F" } ], - "title": "Outgoing Payment Worker", + "title": "Quote Service Create Time (ms)", "type": "timeseries" }, { "datasource": { - "type": "tempo", - "uid": "P214B5B846CF3925F" + "type": "prometheus", + "uid": "PBFA97CFB590B2093" }, "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" }, "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "inspect": false + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { @@ -416,82 +514,46 @@ "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [] }, "gridPos": { - "h": 8, + "h": 5, "w": 12, "x": 12, - "y": 8 + "y": 6 }, - "id": 4, + "id": 11, "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Duration" - } - ] + "tooltip": { + "mode": "single", + "sort": "none" + } }, - "pluginVersion": "11.1.4", "targets": [ { "datasource": { - "type": "tempo", - "uid": "P214B5B846CF3925F" + "type": "prometheus", + "uid": "PBFA97CFB590B2093" }, - "filters": [ - { - "id": "9bab4a0a", - "operator": "=", - "scope": "span" - }, - { - "id": "service-name", - "operator": "=", - "scope": "resource", - "tag": "service.name", - "value": [ - "RAFIKI_NETWORK" - ], - "valueType": "string" - }, - { - "id": "span-name", - "operator": "=", - "scope": "span", - "tag": "name", - "value": [], - "valueType": "string" - }, - { - "id": "min-duration", - "operator": ">", - "tag": "duration", - "value": "100ms", - "valueType": "duration" - } - ], - "limit": 20, - "queryType": "traceqlSearch", - "refId": "A", - "tableType": "traces" + "editorMode": "code", + "expr": "sum by (callName) (rate(psql_getAccountBalances_sum[$__rate_interval])/rate(psql_getAccountBalances_count[$__rate_interval]))", + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A" } ], - "title": "Traces > 100ms", - "type": "table" + "title": "PSQL Get Account Balance", + "type": "timeseries" }, { "datasource": { @@ -548,22 +610,25 @@ "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, + "h": 7, + "w": 24, "x": 0, - "y": 16 + "y": 11 }, - "id": 7, + "id": 10, "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "p95" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -578,9 +643,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(quote_service_create_time_ms_sum[$__rate_interval])/rate(quote_service_create_time_ms_count[$__rate_interval])", + "expr": "sum by (callName) (rate(getPendingPayment_sum[$__rate_interval])/rate(getPendingPayment_count[$__rate_interval]))", "instant": false, - "legendFormat": "{{description}}", + "legendFormat": "{{caller}}", "range": true, "refId": "A" }, @@ -590,10 +655,10 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(quote_service_create_resolve_receiver_time_ms_sum[$__rate_interval])/rate(quote_service_create_resolve_receiver_time_ms_count[$__rate_interval])", + "expr": "sum by (callName) (rate(handleSending_sum[$__rate_interval])/rate(handleSending_count[$__rate_interval]))", "hide": false, "instant": false, - "legendFormat": "{{description}}", + "legendFormat": "__auto", "range": true, "refId": "B" }, @@ -603,10 +668,10 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(quote_service_create_get_quote_time_ms_sum[$__rate_interval])/rate(quote_service_create_get_quote_time_ms_count[$__rate_interval])", + "expr": "sum by (callName) (rate(getReceiver_sum[$__rate_interval])/rate(getReceiver_count[$__rate_interval]))", "hide": false, "instant": false, - "legendFormat": "{{description}}", + "legendFormat": "__auto", "range": true, "refId": "C" }, @@ -616,10 +681,10 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(quote_service_create_get_latest_fee_time_ms_sum[$__rate_interval])/rate(quote_service_create_get_latest_fee_time_ms_count[$__rate_interval])", + "expr": "sum by (callName) (rate(psql_getAccountTotalSent_sum[$__rate_interval])/rate(psql_getAccountTotalSent_count[$__rate_interval]))", "hide": false, "instant": false, - "legendFormat": "{{description}}", + "legendFormat": "__auto", "range": true, "refId": "D" }, @@ -629,10 +694,10 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(quote_service_create_insert_time_ms_sum[$__rate_interval])/rate(quote_service_create_insert_time_ms_count[$__rate_interval])", + "expr": "sum by (callName) (rate(tb_getAccountTotalSent_sum[$__rate_interval])/rate(tb_getAccountTotalSent_count[$__rate_interval]))", "hide": false, "instant": false, - "legendFormat": "{{description}}", + "legendFormat": "__auto", "range": true, "refId": "E" }, @@ -642,15 +707,28 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(quote_service_finalize_quote_ms_sum[$__rate_interval])/rate(quote_service_finalize_quote_ms_count[$__rate_interval])", + "expr": "sum by (callName) (rate(handleCompleted_sum[$__rate_interval])/rate(handleCompleted_count[$__rate_interval]))", "hide": false, "instant": false, - "legendFormat": "{{description}}", + "legendFormat": "__auto", "range": true, "refId": "F" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum by (callName) (rate(sendWebhookEvent_sum[$__rate_interval])/rate(sendWebhookEvent_count[$__rate_interval]))", + "hide": false, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "G" } ], - "title": "Quote Service Create Time (ms)", + "title": "Outgoing Payment Worker", "type": "timeseries" }, { @@ -686,8 +764,8 @@ "gridPos": { "h": 12, "w": 12, - "x": 12, - "y": 16 + "x": 0, + "y": 18 }, "id": 6, "options": { @@ -726,6 +804,113 @@ "title": "Graphql Resolver Duration (95th Percentile)", "type": "bargauge" }, + { + "datasource": { + "type": "tempo", + "uid": "P214B5B846CF3925F" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 18 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Duration" + } + ] + }, + "pluginVersion": "11.1.4", + "targets": [ + { + "datasource": { + "type": "tempo", + "uid": "P214B5B846CF3925F" + }, + "filters": [ + { + "id": "9bab4a0a", + "operator": "=", + "scope": "span" + }, + { + "id": "service-name", + "operator": "=", + "scope": "resource", + "tag": "service.name", + "value": [ + "RAFIKI_NETWORK" + ], + "valueType": "string" + }, + { + "id": "span-name", + "operator": "=", + "scope": "span", + "tag": "name", + "value": [], + "valueType": "string" + }, + { + "id": "min-duration", + "operator": ">", + "tag": "duration", + "value": "100ms", + "valueType": "duration" + } + ], + "limit": 20, + "queryType": "traceqlSearch", + "refId": "A", + "tableType": "traces" + } + ], + "title": "Traces > 100ms", + "type": "table" + }, { "datasource": { "type": "prometheus", @@ -789,7 +974,7 @@ "h": 8, "w": 12, "x": 0, - "y": 24 + "y": 30 }, "id": 2, "interval": "15s", @@ -887,7 +1072,7 @@ "h": 8, "w": 12, "x": 0, - "y": 32 + "y": 38 }, "id": 1, "interval": "15s", @@ -955,7 +1140,7 @@ "h": 5, "w": 12, "x": 0, - "y": 40 + "y": 46 }, "id": 3, "options": { @@ -1035,7 +1220,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1051,7 +1237,7 @@ "h": 5, "w": 12, "x": 0, - "y": 45 + "y": 51 }, "id": 5, "options": { @@ -1123,7 +1309,7 @@ "list": [] }, "time": { - "from": "now-15m", + "from": "now-5m", "to": "now" }, "timepicker": { @@ -1142,6 +1328,6 @@ "timezone": "browser", "title": "Example Dashboard", "uid": "fdr58stwkr6yof", - "version": 1, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/packages/backend/src/accounting/psql/service.ts b/packages/backend/src/accounting/psql/service.ts index af682d9e11..ecdf64f177 100644 --- a/packages/backend/src/accounting/psql/service.ts +++ b/packages/backend/src/accounting/psql/service.ts @@ -147,13 +147,28 @@ export async function getAccountTotalSent( deps: ServiceDependencies, accountRef: string ): Promise { + deps.telemetry && + deps.telemetry.startTimer('psql_getAccountTotalSent', { + callName: 'psql_getAccountTotalSent' + }) const account = await getLiquidityAccount(deps, accountRef) if (!account) { + deps.telemetry && + deps.telemetry.startTimer('psql_getAccountTotalSent', { + callName: 'psql_getAccountTotalSent' + }) return } - return (await getAccountBalances(deps, account)).debitsPosted + const totalsSent = (await getAccountBalances(deps, account)).debitsPosted + + deps.telemetry && + deps.telemetry.startTimer('psql_getAccountTotalSent', { + callName: 'psql_getAccountTotalSent' + }) + + return totalsSent } export async function getAccountsTotalSent( diff --git a/packages/backend/src/accounting/tigerbeetle/service.ts b/packages/backend/src/accounting/tigerbeetle/service.ts index 79b9105be1..479bb754d5 100644 --- a/packages/backend/src/accounting/tigerbeetle/service.ts +++ b/packages/backend/src/accounting/tigerbeetle/service.ts @@ -31,6 +31,7 @@ import { getAccountTransfers } from './transfers' import { toTigerBeetleId } from './utils' +import { TelemetryService } from '../../telemetry/service' export enum TigerBeetleAccountCode { LIQUIDITY_WEB_MONETIZATION = 1, @@ -69,6 +70,7 @@ export const convertToTigerBeetleTransferCode: { export interface ServiceDependencies extends BaseService { tigerBeetle: Client withdrawalThrottleDelay?: number + telemetry?: TelemetryService } export function createAccountingService( @@ -218,10 +220,16 @@ export async function getAccountTotalSent( deps: ServiceDependencies, id: string ): Promise { + deps.telemetry && + deps.telemetry.startTimer('tb_getAccountTotalSent', { + callName: 'tb_getAccountTotalSent' + }) const account = (await getAccounts(deps, [id]))[0] if (account) { + deps.telemetry && deps.telemetry.stopTimer('tb_getAccountTotalSent') return account.debits_posted } + deps.telemetry && deps.telemetry.stopTimer('tb_getAccountTotalSent') } export async function getAccountsTotalSent( diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 14a524e6a6..dd85dc9068 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -212,6 +212,7 @@ export function initIocContainer( const logger = await deps.use('logger') const knex = await deps.use('knex') const config = await deps.use('config') + const telemetry = await deps.use('telemetry') if (config.useTigerBeetle) { container.singleton('tigerBeetle', async (deps) => { @@ -228,7 +229,8 @@ export function initIocContainer( logger, knex, tigerBeetle, - withdrawalThrottleDelay: config.withdrawalThrottleDelay + withdrawalThrottleDelay: config.withdrawalThrottleDelay, + telemetry }) } @@ -236,9 +238,7 @@ export function initIocContainer( logger, knex, withdrawalThrottleDelay: config.withdrawalThrottleDelay, - telemetry: config.enableTelemetry - ? await deps.use('telemetry') - : undefined + telemetry }) }) container.singleton('peerService', async (deps) => { @@ -346,7 +346,8 @@ export function initIocContainer( walletAddressService: await deps.use('walletAddressService'), remoteIncomingPaymentService: await deps.use( 'remoteIncomingPaymentService' - ) + ), + telemetry: deps.use('telemetry') ? await deps.use('telemetry') : undefined }) }) diff --git a/packages/backend/src/open_payments/payment/outgoing/lifecycle.ts b/packages/backend/src/open_payments/payment/outgoing/lifecycle.ts index f273e008a1..10c37c2307 100644 --- a/packages/backend/src/open_payments/payment/outgoing/lifecycle.ts +++ b/packages/backend/src/open_payments/payment/outgoing/lifecycle.ts @@ -76,24 +76,24 @@ export async function handleSending( throw LifecycleError.BadState } - const payStartTime = Date.now() - await deps.paymentMethodHandlerService.pay('ILP', { - receiver, - outgoingPayment: payment, - finalDebitAmount: maxDebitAmount, - finalReceiveAmount: maxReceiveAmount - }) - const payEndTime = Date.now() + deps.telemetry && + deps.telemetry.startTimer('ilp_pay_time_ms', { + description: 'Time to complete an ILP payment', + callName: 'paymentMethodHandlerService.pay (ILP)' + }), + await deps.paymentMethodHandlerService.pay('ILP', { + receiver, + outgoingPayment: payment, + finalDebitAmount: maxDebitAmount, + finalReceiveAmount: maxReceiveAmount + }) if (deps.telemetry) { - const payDuration = payEndTime - payStartTime await Promise.all([ deps.telemetry.incrementCounter('transactions_total', 1, { description: 'Count of funded transactions' }), - deps.telemetry.recordHistogram('ilp_pay_time_ms', payDuration, { - description: 'Time to complete an ILP payment' - }), + deps.telemetry.stopTimer('ilp_pay_time_ms'), deps.telemetry.incrementCounterWithTransactionAmountDifference( 'transaction_fee_amounts', payment.sentAmount, @@ -144,17 +144,24 @@ export async function handleFailed( payment: OutgoingPayment, error: string ): Promise { + deps.telemetry && + deps.telemetry.startTimer('handleFailed', { callName: 'handleFailed ' }) await payment.$query(deps.knex).patch({ state: OutgoingPaymentState.Failed, error }) await sendWebhookEvent(deps, payment, OutgoingPaymentEventType.PaymentFailed) + deps.telemetry && deps.telemetry.startTimer('handleFailed') } async function handleCompleted( deps: ServiceDependencies, payment: OutgoingPayment ): Promise { + deps.telemetry && + deps.telemetry.startTimer('handleCompleted', { + callName: 'handleCompleted' + }) await payment.$query(deps.knex).patch({ state: OutgoingPaymentState.Completed }) @@ -164,6 +171,7 @@ async function handleCompleted( payment, OutgoingPaymentEventType.PaymentCompleted ) + deps.telemetry && deps.telemetry.stopTimer('handleCompleted') } export async function sendWebhookEvent( @@ -172,6 +180,10 @@ export async function sendWebhookEvent( type: OutgoingPaymentEventType, trx?: TransactionOrKnex ): Promise { + deps.telemetry && + deps.telemetry.startTimer('sendWebhookEvent', { + callName: 'outgoingPaymentLifecycle_sendwebhookEvent' + }) // TigerBeetle accounts are only created as the OutgoingPayment is funded. // So default the amountSent and balance to 0 for outgoing payments still in the funding state const amountSent = @@ -201,6 +213,7 @@ export async function sendWebhookEvent( data: payment.toData({ amountSent, balance }), withdrawal }) + deps.telemetry && deps.telemetry.stopTimer('sendWebhookEvent') } function validateAssets( diff --git a/packages/backend/src/open_payments/receiver/service.ts b/packages/backend/src/open_payments/receiver/service.ts index adb022e78f..3fba5e6709 100644 --- a/packages/backend/src/open_payments/receiver/service.ts +++ b/packages/backend/src/open_payments/receiver/service.ts @@ -14,6 +14,7 @@ import { errorToMessage as receiverErrorToMessage } from './errors' import { isRemoteIncomingPaymentError } from '../payment/incoming_remote/errors' +import { TelemetryService } from '../../telemetry/service' interface CreateReceiverArgs { walletAddressUrl: string @@ -33,6 +34,7 @@ export interface ServiceDependencies extends BaseService { incomingPaymentService: IncomingPaymentService walletAddressService: WalletAddressService remoteIncomingPaymentService: RemoteIncomingPaymentService + telemetry?: TelemetryService } const INCOMING_PAYMENT_URL_REGEX = @@ -136,21 +138,28 @@ async function getReceiver( deps: ServiceDependencies, url: string ): Promise { + deps.telemetry && + deps.telemetry.startTimer('getReceiver', { callName: 'getReceiver' }) try { const localIncomingPayment = await getLocalIncomingPayment(deps, url) if (localIncomingPayment) { - return new Receiver(localIncomingPayment, true) + const receiver = new Receiver(localIncomingPayment, true) + deps.telemetry && deps.telemetry.stopTimer('getReceiver') + return receiver } const remoteIncomingPayment = await getRemoteIncomingPayment(deps, url) if (remoteIncomingPayment) { - return new Receiver(remoteIncomingPayment, false) + const receiver = new Receiver(remoteIncomingPayment, false) + deps.telemetry && deps.telemetry.stopTimer('getReceiver') + return receiver } } catch (err) { deps.logger.error( { errorMessage: err instanceof Error && err.message }, 'Could not get incoming payment' ) + deps.telemetry && deps.telemetry.stopTimer('getReceiver') } } diff --git a/packages/backend/src/payment-method/ilp/connector/index.ts b/packages/backend/src/payment-method/ilp/connector/index.ts index 9f3ecc3f95..ae3c859b6e 100644 --- a/packages/backend/src/payment-method/ilp/connector/index.ts +++ b/packages/backend/src/payment-method/ilp/connector/index.ts @@ -68,49 +68,104 @@ export async function createConnectorService({ streamServer, telemetry }, - compose([ - // Incoming Rules - createIncomingErrorHandlerMiddleware(ilpAddress), - createStreamAddressMiddleware(), - createAccountMiddleware(ilpAddress), - createIncomingMaxPacketAmountMiddleware(), - createIncomingRateLimitMiddleware({}), - createIncomingThroughputMiddleware(), - createIldcpMiddleware(ilpAddress), + compose( + [ + // Incoming Rules + { + name: 'createIncomingErrorHandlerMiddleware', + fn: createIncomingErrorHandlerMiddleware(ilpAddress) + }, + { + name: 'createStreamAddressMiddleware', + fn: createStreamAddressMiddleware() + }, + { + name: 'createAccountMiddleware', + fn: createAccountMiddleware(ilpAddress) + }, + { + name: 'createIncomingMaxPacketAmountMiddleware', + fn: createIncomingMaxPacketAmountMiddleware() + }, + { + name: 'createIncomingRateLimitMiddleware', + fn: createIncomingRateLimitMiddleware({}) + }, + { + name: 'createIncomingThroughputMiddleware', + fn: createIncomingThroughputMiddleware() + }, + { + name: 'createIldcpMiddleware', + fn: createIldcpMiddleware(ilpAddress) + }, - // Local pay - createBalanceMiddleware(), + // Local pay + { name: 'createBalanceMiddleware', fn: createBalanceMiddleware() }, - // Outgoing Rules - createStreamController(), - createOutgoingThroughputMiddleware(), - createOutgoingReduceExpiryMiddleware({}), - createOutgoingExpireMiddleware(), - createOutgoingValidateFulfillmentMiddleware(), + // Outgoing Rules + { name: 'createStreamController', fn: createStreamController() }, + { + name: 'createOutgoingThroughputMiddleware', + fn: createOutgoingThroughputMiddleware() + }, + { + name: 'createOutgoingReduceExpiryMiddleware', + fn: createOutgoingReduceExpiryMiddleware({}) + }, + { + name: 'createOutgoingExpireMiddleware', + fn: createOutgoingExpireMiddleware() + }, + { + name: 'createOutgoingValidateFulfillmentMiddleware', + fn: createOutgoingValidateFulfillmentMiddleware() + }, - // Send outgoing packets - createClientController() - ]) + // Send outgoing packets + { name: 'createClientController', fn: createClientController() } + ], + telemetry + ) ) } // Adapted from koa-compose -function compose(middlewares: ILPMiddleware[]): ILPMiddleware { +function compose( + middlewares: { name: string; fn: ILPMiddleware }[], + telemetry: TelemetryService | undefined +): ILPMiddleware { return function (ctx: ILPContext, next: () => Promise): Promise { // last called middleware let index = -1 - return (function dispatch(i: number): Promise { + + telemetry && + telemetry.startTimer('connector_middleware_stack', { + callName: 'connector_middleware_stack' + }) + + async function dispatch(i: number): Promise { if (i <= index) return Promise.reject(new Error('next() called multiple times')) index = i - let fn = middlewares[i] - if (i === middlewares.length) fn = next - if (!fn) return Promise.resolve() + let m = middlewares[i] + if (i === middlewares.length) m.fn = next + if (!m.fn) return Promise.resolve() try { - return Promise.resolve(fn(ctx, dispatch.bind(null, i + 1))) + telemetry && + telemetry.startTimer('connector_middleware', { + callName: m.name + }) + const p = Promise.resolve(m.fn(ctx, dispatch.bind(null, i + 1))) + telemetry && telemetry.stopTimer('connector_middleware') + return p } catch (err) { return Promise.reject(err) } - })(0) + } + + return dispatch(0).finally(() => { + telemetry && telemetry.stopTimer('connector_middleware_stack') + }) } } diff --git a/packages/backend/src/payment-method/ilp/peer/service.ts b/packages/backend/src/payment-method/ilp/peer/service.ts index be64dcc520..fc39c49a60 100644 --- a/packages/backend/src/payment-method/ilp/peer/service.ts +++ b/packages/backend/src/payment-method/ilp/peer/service.ts @@ -314,7 +314,7 @@ async function getPeerByDestinationAddress( // for `staticIlpAddress`s in the accounts table: // new RegExp('^' + staticIlpAddress + '($|\\.)')).test(destinationAddress) const peerQuery = Peer.query(deps.knex) - .withGraphJoined('asset') + .withGraphFetched('asset') .where( raw('?', [destinationAddress]), 'like', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba7cf22bc9..4b90f661df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -256,7 +256,7 @@ importers: version: 8.4.1 '@graphql-codegen/cli': specifier: 5.0.2 - version: 5.0.2(@babel/core@7.24.7)(@types/node@18.19.29)(graphql@16.8.1) + version: 5.0.2(@babel/core@7.25.2)(@types/node@18.19.29)(graphql@16.8.1) '@graphql-codegen/introspection': specifier: 4.0.3 version: 4.0.3(graphql@16.8.1) @@ -476,7 +476,7 @@ importers: version: 3.9.9(@types/react@18.2.73)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) '@graphql-codegen/cli': specifier: 5.0.2 - version: 5.0.2(@babel/core@7.24.7)(@types/node@18.19.29)(graphql@16.8.1) + version: 5.0.2(@babel/core@7.25.2)(@types/node@18.19.29)(graphql@16.8.1) '@graphql-codegen/introspection': specifier: 4.0.3 version: 4.0.3(graphql@16.8.1) @@ -745,6 +745,21 @@ importers: specifier: ^6.7.5 version: 6.7.5 + test/grpc-http-benchmark: + dependencies: + '@grpc/grpc-js': + specifier: ^1.11.1 + version: 1.11.1 + '@grpc/proto-loader': + specifier: ^0.7.13 + version: 0.7.13 + '@koa/router': + specifier: ^12.0.0 + version: 12.0.0 + koa: + specifier: ^2.15.3 + version: 2.15.3 + test/integration: devDependencies: '@apollo/client': @@ -876,6 +891,7 @@ packages: zen-observable-ts: 1.2.5 transitivePeerDependencies: - '@types/react' + dev: true /@apollo/client@3.9.9(@types/react@18.2.73)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-/sMecU/M0WK9knrguts1lSLV8xFKzIgOMVb4mi6MOxgJXjliDB8PvOtmXhTqh2cVMMR4TzXgOnb+af/690zlQw==} @@ -1287,14 +1303,9 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/compat-data@7.24.7: - resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} - engines: {node: '>=6.9.0'} - /@babel/compat-data@7.25.2: resolution: {integrity: sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==} engines: {node: '>=6.9.0'} - dev: false /@babel/core@7.23.2: resolution: {integrity: sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==} @@ -1342,28 +1353,6 @@ packages: - supports-color dev: true - /@babel/core@7.24.7: - resolution: {integrity: sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.7 - '@babel/helper-compilation-targets': 7.24.7 - '@babel/helper-module-transforms': 7.24.7(@babel/core@7.24.7) - '@babel/helpers': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/template': 7.24.7 - '@babel/traverse': 7.24.7 - '@babel/types': 7.24.7 - convert-source-map: 2.0.0 - debug: 4.3.5 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - /@babel/core@7.25.2: resolution: {integrity: sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==} engines: {node: '>=6.9.0'} @@ -1385,7 +1374,6 @@ packages: semver: 6.3.1 transitivePeerDependencies: - supports-color - dev: false /@babel/eslint-parser@7.21.8(@babel/core@7.23.2)(eslint@8.57.0): resolution: {integrity: sha512-HLhI+2q+BP3sf78mFUZNCGc10KEmoUqtUT1OCdMZsN+qr4qFeLUod62/zAnF3jNQstwyasDkZnVXwfK2Bml7MQ==} @@ -1421,15 +1409,6 @@ packages: jsesc: 2.5.2 dev: true - /@babel/generator@7.24.7: - resolution: {integrity: sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.7 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - /@babel/generator@7.25.0: resolution: {integrity: sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==} engines: {node: '>=6.9.0'} @@ -1475,16 +1454,6 @@ packages: semver: 6.3.1 dev: true - /@babel/helper-compilation-targets@7.24.7: - resolution: {integrity: sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/compat-data': 7.24.7 - '@babel/helper-validator-option': 7.24.7 - browserslist: 4.23.0 - lru-cache: 5.1.1 - semver: 6.3.1 - /@babel/helper-compilation-targets@7.25.2: resolution: {integrity: sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==} engines: {node: '>=6.9.0'} @@ -1494,7 +1463,6 @@ packages: browserslist: 4.23.3 lru-cache: 5.1.1 semver: 6.3.1 - dev: false /@babel/helper-create-class-features-plugin@7.21.8(@babel/core@7.23.2): resolution: {integrity: sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw==} @@ -1541,12 +1509,6 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-environment-visitor@7.24.7: - resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.7 - /@babel/helper-function-name@7.23.0: resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} engines: {node: '>=6.9.0'} @@ -1555,13 +1517,6 @@ packages: '@babel/types': 7.23.9 dev: true - /@babel/helper-function-name@7.24.7: - resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.7 - /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} @@ -1569,12 +1524,6 @@ packages: '@babel/types': 7.23.9 dev: true - /@babel/helper-hoist-variables@7.24.7: - resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.7 - /@babel/helper-member-expression-to-functions@7.21.5: resolution: {integrity: sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg==} engines: {node: '>=6.9.0'} @@ -1640,21 +1589,6 @@ packages: '@babel/helper-validator-identifier': 7.22.20 dev: true - /@babel/helper-module-transforms@7.24.7(@babel/core@7.24.7): - resolution: {integrity: sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - transitivePeerDependencies: - - supports-color - /@babel/helper-module-transforms@7.25.2(@babel/core@7.25.2): resolution: {integrity: sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==} engines: {node: '>=6.9.0'} @@ -1668,7 +1602,6 @@ packages: '@babel/traverse': 7.25.3 transitivePeerDependencies: - supports-color - dev: false /@babel/helper-optimise-call-expression@7.18.6: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} @@ -1731,12 +1664,6 @@ packages: '@babel/types': 7.23.9 dev: true - /@babel/helper-split-export-declaration@7.24.7: - resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.24.7 - /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} @@ -1746,10 +1673,6 @@ packages: resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} engines: {node: '>=6.9.0'} - /@babel/helper-string-parser@7.24.7: - resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} - engines: {node: '>=6.9.0'} - /@babel/helper-string-parser@7.24.8: resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} engines: {node: '>=6.9.0'} @@ -1772,14 +1695,9 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.24.7: - resolution: {integrity: sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==} - engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.24.8: resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} engines: {node: '>=6.9.0'} - dev: false /@babel/helpers@7.23.2: resolution: {integrity: sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==} @@ -1803,20 +1721,12 @@ packages: - supports-color dev: true - /@babel/helpers@7.24.7: - resolution: {integrity: sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.7 - /@babel/helpers@7.25.0: resolution: {integrity: sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.25.0 '@babel/types': 7.25.2 - dev: false /@babel/highlight@7.22.20: resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} @@ -1860,13 +1770,6 @@ packages: dependencies: '@babel/types': 7.23.9 - /@babel/parser@7.24.7: - resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.24.7 - /@babel/parser@7.25.3: resolution: {integrity: sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==} engines: {node: '>=6.0.0'} @@ -1950,13 +1853,13 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-assertions@7.20.0(@babel/core@7.24.7): + /@babel/plugin-syntax-import-assertions@7.20.0(@babel/core@7.25.2): resolution: {integrity: sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.22.5 dev: true @@ -2460,14 +2363,6 @@ packages: '@babel/types': 7.23.9 dev: true - /@babel/template@7.24.7: - resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 - /@babel/template@7.25.0: resolution: {integrity: sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==} engines: {node: '>=6.9.0'} @@ -2506,29 +2401,12 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.9 '@babel/types': 7.23.9 - debug: 4.3.5 + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/traverse@7.24.7: - resolution: {integrity: sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.7 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-hoist-variables': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/types': 7.24.7 - debug: 4.3.5 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - /@babel/traverse@7.25.3: resolution: {integrity: sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==} engines: {node: '>=6.9.0'} @@ -2560,14 +2438,6 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - /@babel/types@7.24.7: - resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - to-fast-properties: 2.0.0 - /@babel/types@7.25.2: resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} @@ -3437,7 +3307,7 @@ packages: tslib: 2.6.2 dev: true - /@graphql-codegen/cli@5.0.2(@babel/core@7.24.7)(@types/node@18.19.29)(graphql@16.8.1): + /@graphql-codegen/cli@5.0.2(@babel/core@7.25.2)(@types/node@18.19.29)(graphql@16.8.1): resolution: {integrity: sha512-MBIaFqDiLKuO4ojN6xxG9/xL9wmfD3ZjZ7RsPjwQnSHBCUXnEkdKvX+JVpx87Pq29Ycn8wTJUguXnTZ7Di0Mlw==} hasBin: true peerDependencies: @@ -3454,9 +3324,9 @@ packages: '@graphql-codegen/core': 4.0.2(graphql@16.8.1) '@graphql-codegen/plugin-helpers': 5.0.3(graphql@16.8.1) '@graphql-tools/apollo-engine-loader': 8.0.0(graphql@16.8.1) - '@graphql-tools/code-file-loader': 8.0.1(@babel/core@7.24.7)(graphql@16.8.1) - '@graphql-tools/git-loader': 8.0.1(@babel/core@7.24.7)(graphql@16.8.1) - '@graphql-tools/github-loader': 8.0.0(@babel/core@7.24.7)(@types/node@18.19.29)(graphql@16.8.1) + '@graphql-tools/code-file-loader': 8.0.1(@babel/core@7.25.2)(graphql@16.8.1) + '@graphql-tools/git-loader': 8.0.1(@babel/core@7.25.2)(graphql@16.8.1) + '@graphql-tools/github-loader': 8.0.0(@babel/core@7.25.2)(@types/node@18.19.29)(graphql@16.8.1) '@graphql-tools/graphql-file-loader': 8.0.1(graphql@16.8.1) '@graphql-tools/json-file-loader': 8.0.0(graphql@16.8.1) '@graphql-tools/load': 8.0.2(graphql@16.8.1) @@ -3745,13 +3615,13 @@ packages: value-or-promise: 1.0.12 dev: false - /@graphql-tools/code-file-loader@8.0.1(@babel/core@7.24.7)(graphql@16.8.1): + /@graphql-tools/code-file-loader@8.0.1(@babel/core@7.25.2)(graphql@16.8.1): resolution: {integrity: sha512-pmg81lsIXGW3uW+nFSCIG0lFQIxWVbgDjeBkSWlnP8CZsrHTQEkB53DT7t4BHLryoxDS4G4cPxM52yNINDSL8w==} engines: {node: '>=16.0.0'} peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - '@graphql-tools/graphql-tag-pluck': 8.0.1(@babel/core@7.24.7)(graphql@16.8.1) + '@graphql-tools/graphql-tag-pluck': 8.0.1(@babel/core@7.25.2)(graphql@16.8.1) '@graphql-tools/utils': 10.1.0(graphql@16.8.1) globby: 11.1.0 graphql: 16.8.1 @@ -3952,13 +3822,13 @@ packages: value-or-promise: 1.0.12 dev: false - /@graphql-tools/git-loader@8.0.1(@babel/core@7.24.7)(graphql@16.8.1): + /@graphql-tools/git-loader@8.0.1(@babel/core@7.25.2)(graphql@16.8.1): resolution: {integrity: sha512-ivNtxD+iEfpPONYKip0kbpZMRdMCNR3HrIui8NCURmUdvBYGaGcbB3VrGMhxwZuzc+ybhs2ralPt1F8Oxq2jLA==} engines: {node: '>=16.0.0'} peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: - '@graphql-tools/graphql-tag-pluck': 8.0.1(@babel/core@7.24.7)(graphql@16.8.1) + '@graphql-tools/graphql-tag-pluck': 8.0.1(@babel/core@7.25.2)(graphql@16.8.1) '@graphql-tools/utils': 10.1.0(graphql@16.8.1) graphql: 16.8.1 is-glob: 4.0.3 @@ -3970,7 +3840,7 @@ packages: - supports-color dev: true - /@graphql-tools/github-loader@8.0.0(@babel/core@7.24.7)(@types/node@18.19.29)(graphql@16.8.1): + /@graphql-tools/github-loader@8.0.0(@babel/core@7.25.2)(@types/node@18.19.29)(graphql@16.8.1): resolution: {integrity: sha512-VuroArWKcG4yaOWzV0r19ElVIV6iH6UKDQn1MXemND0xu5TzrFme0kf3U9o0YwNo0kUYEk9CyFM0BYg4he17FA==} engines: {node: '>=16.0.0'} peerDependencies: @@ -3978,7 +3848,7 @@ packages: dependencies: '@ardatan/sync-fetch': 0.0.1 '@graphql-tools/executor-http': 1.0.1(@types/node@18.19.29)(graphql@16.8.1) - '@graphql-tools/graphql-tag-pluck': 8.0.1(@babel/core@7.24.7)(graphql@16.8.1) + '@graphql-tools/graphql-tag-pluck': 8.0.1(@babel/core@7.25.2)(graphql@16.8.1) '@graphql-tools/utils': 10.1.0(graphql@16.8.1) '@whatwg-node/fetch': 0.9.8 graphql: 16.8.1 @@ -4004,14 +3874,14 @@ packages: tslib: 2.6.2 unixify: 1.0.0 - /@graphql-tools/graphql-tag-pluck@8.0.1(@babel/core@7.24.7)(graphql@16.8.1): + /@graphql-tools/graphql-tag-pluck@8.0.1(@babel/core@7.25.2)(graphql@16.8.1): resolution: {integrity: sha512-4sfBJSoXxVB4rRCCp2GTFhAYsUJgAPSKxSV+E3Voc600mK52JO+KsHCCTnPgCeyJFMNR9l94J6+tqxVKmlqKvw==} engines: {node: '>=16.0.0'} peerDependencies: graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 dependencies: '@babel/parser': 7.23.9 - '@babel/plugin-syntax-import-assertions': 7.20.0(@babel/core@7.24.7) + '@babel/plugin-syntax-import-assertions': 7.20.0(@babel/core@7.25.2) '@babel/traverse': 7.23.9 '@babel/types': 7.23.9 '@graphql-tools/utils': 10.1.0(graphql@16.8.1) @@ -4348,6 +4218,14 @@ packages: '@js-sdsl/ordered-map': 4.4.2 dev: false + /@grpc/grpc-js@1.11.1: + resolution: {integrity: sha512-gyt/WayZrVPH2w/UTLansS7F9Nwld472JxxaETamrM8HNlsa+jSLNyKAZmhxI2Me4c3mQHFiS1wWHDY1g1Kthw==} + engines: {node: '>=12.10.0'} + dependencies: + '@grpc/proto-loader': 0.7.13 + '@js-sdsl/ordered-map': 4.4.2 + dev: false + /@grpc/proto-loader@0.7.13: resolution: {integrity: sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==} engines: {node: '>=6'} @@ -4355,7 +4233,7 @@ packages: dependencies: lodash.camelcase: 4.3.0 long: 5.2.3 - protobufjs: 7.2.6 + protobufjs: 7.3.2 yargs: 17.7.2 dev: false @@ -5749,7 +5627,7 @@ packages: '@types/tldjs': 2.3.1 cookie: 0.5.0 istextorbinary: 6.0.0 - next: 14.1.4(@babel/core@7.24.7)(react-dom@18.2.0)(react@18.2.0) + next: 14.1.4(@babel/core@7.25.2)(react-dom@18.2.0)(react@18.2.0) ory-prettier-styles: 1.3.0 prettier: 2.3.2 request: 2.88.2 @@ -7229,7 +7107,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 5.60.1(typescript@5.4.3) '@typescript-eslint/utils': 5.60.1(eslint@8.57.0)(typescript@5.4.3) - debug: 4.3.5 + debug: 4.3.6 eslint: 8.57.0 tsutils: 3.21.0(typescript@5.4.3) typescript: 5.4.3 @@ -7283,7 +7161,7 @@ packages: dependencies: '@typescript-eslint/types': 5.60.1 '@typescript-eslint/visitor-keys': 5.60.1 - debug: 4.3.5 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 @@ -7304,7 +7182,7 @@ packages: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.5 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 @@ -7668,7 +7546,7 @@ packages: resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} engines: {node: '>= 14'} dependencies: - debug: 4.3.5 + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -8456,6 +8334,7 @@ packages: electron-to-chromium: 1.4.685 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) + dev: true /browserslist@4.23.3: resolution: {integrity: sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==} @@ -8466,7 +8345,6 @@ packages: electron-to-chromium: 1.5.7 node-releases: 2.0.18 update-browserslist-db: 1.1.0(browserslist@4.23.3) - dev: false /bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} @@ -8597,10 +8475,10 @@ packages: /caniuse-lite@1.0.30001600: resolution: {integrity: sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==} + dev: true /caniuse-lite@1.0.30001651: resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==} - dev: false /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -9867,10 +9745,10 @@ packages: /electron-to-chromium@1.4.685: resolution: {integrity: sha512-yDYeobbTEe4TNooEzOQO6xFqg9XnAkVy2Lod1C1B2it8u47JNLYvl9nLDWBamqUakWB8Jc1hhS1uHUNYTNQdfw==} + dev: true /electron-to-chromium@1.5.7: resolution: {integrity: sha512-6FTNWIWMxMy/ZY6799nBlPtF1DFDQ6VQJ7yyDP27SJNt5lwtQ5ufqVvHylb3fdQefvRcgA3fKcFMJi9OLwBRNw==} - dev: false /elkjs@0.9.1: resolution: {integrity: sha512-JWKDyqAdltuUcyxaECtYG6H4sqysXSLeoXuGUBfRNESMTkj+w+qdb0jya8Z/WI0jVd03WQtCGhS6FOFtlhD5FQ==} @@ -10223,7 +10101,6 @@ packages: /escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} - dev: false /escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -12627,7 +12504,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.5 + debug: 4.3.6 istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: @@ -13428,7 +13305,7 @@ packages: content-disposition: 0.5.4 content-type: 1.0.5 cookies: 0.9.1 - debug: 4.3.5 + debug: 4.3.6 delegates: 1.0.0 depd: 2.0.0 destroy: 1.2.0 @@ -14739,7 +14616,7 @@ packages: resolution: {integrity: sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg==} dependencies: '@types/debug': 4.1.7 - debug: 4.3.5 + debug: 4.3.6 decode-named-character-reference: 1.0.2 micromark-core-commonmark: 1.0.6 micromark-factory-space: 1.0.0 @@ -14762,7 +14639,7 @@ packages: resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} dependencies: '@types/debug': 4.1.7 - debug: 4.3.5 + debug: 4.3.6 decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.0 @@ -14998,7 +14875,7 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} - /next@14.1.4(@babel/core@7.24.7)(react-dom@18.2.0)(react@18.2.0): + /next@14.1.4(@babel/core@7.25.2)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==} engines: {node: '>=18.17.0'} hasBin: true @@ -15016,12 +14893,12 @@ packages: '@next/env': 14.1.4 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001600 + caniuse-lite: 1.0.30001651 graceful-fs: 4.2.11 postcss: 8.4.31 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.24.7)(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.25.2)(react@18.2.0) optionalDependencies: '@next/swc-darwin-arm64': 14.1.4 '@next/swc-darwin-x64': 14.1.4 @@ -15131,10 +15008,10 @@ packages: /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} + dev: true /node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} - dev: false /non-layered-tidy-tree-layout@2.0.2: resolution: {integrity: sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==} @@ -15864,7 +15741,6 @@ packages: /picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - dev: false /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -16094,7 +15970,7 @@ packages: engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.7 - picocolors: 1.0.0 + picocolors: 1.0.1 source-map-js: 1.2.0 dev: false @@ -16614,6 +16490,7 @@ packages: optional: true react: optional: true + dev: true /rehype-expressive-code@0.35.6: resolution: {integrity: sha512-pPdE+pRcRw01kxMOwHQjuRxgwlblZt5+wAc3w2aPGgmcnn57wYjn07iKO7zaznDxYVxMYVvYlnL+R3vWFQS4Gw==} @@ -17840,7 +17717,7 @@ packages: inline-style-parser: 0.2.3 dev: false - /styled-jsx@5.1.1(@babel/core@7.24.7)(react@18.2.0): + /styled-jsx@5.1.1(@babel/core@7.25.2)(react@18.2.0): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: @@ -17853,7 +17730,7 @@ packages: babel-plugin-macros: optional: true dependencies: - '@babel/core': 7.24.7 + '@babel/core': 7.25.2 client-only: 0.0.1 react: 18.2.0 dev: false @@ -18702,6 +18579,7 @@ packages: browserslist: 4.23.0 escalade: 3.1.1 picocolors: 1.0.0 + dev: true /update-browserslist-db@1.1.0(browserslist@4.23.3): resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} @@ -18712,7 +18590,6 @@ packages: browserslist: 4.23.3 escalade: 3.1.2 picocolors: 1.0.1 - dev: false /upper-case-first@2.0.2: resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} diff --git a/test/performance/scripts/create-outgoing-payments.js b/test/performance/scripts/create-outgoing-payments.js index c8251f9221..67eb293f98 100644 --- a/test/performance/scripts/create-outgoing-payments.js +++ b/test/performance/scripts/create-outgoing-payments.js @@ -2,7 +2,7 @@ import http from 'k6/http' import { fail } from 'k6' export const options = { // A number specifying the number of VUs to run concurrently. - vus: 5, + vus: 9, // A string specifying the total duration of the test run. duration: '120s' }