Merge branch 'master' into nymkappa/accel-dashboard-cleanup

This commit is contained in:
nymkappa 2024-02-27 12:42:19 +01:00 committed by GitHub
commit cc06f85e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 41 additions and 17 deletions

View File

@ -245,6 +245,8 @@ export class Common {
flags |= TransactionFlags.v1; flags |= TransactionFlags.v1;
} else if (tx.version === 2) { } else if (tx.version === 2) {
flags |= TransactionFlags.v2; flags |= TransactionFlags.v2;
} else if (tx.version === 3) {
flags |= TransactionFlags.v3;
} }
const reusedInputAddresses: { [address: string ]: number } = {}; const reusedInputAddresses: { [address: string ]: number } = {};
const reusedOutputAddresses: { [address: string ]: number } = {}; const reusedOutputAddresses: { [address: string ]: number } = {};

View File

@ -208,6 +208,7 @@ export const TransactionFlags = {
no_rbf: 0b00000010n, no_rbf: 0b00000010n,
v1: 0b00000100n, v1: 0b00000100n,
v2: 0b00001000n, v2: 0b00001000n,
v3: 0b00010000n,
// address types // address types
p2pk: 0b00000001_00000000n, p2pk: 0b00000001_00000000n,
p2ms: 0b00000010_00000000n, p2ms: 0b00000010_00000000n,

View File

@ -4,6 +4,7 @@ import { SpriteUpdateParams, Square, Color, ViewUpdateParams } from './sprite-ty
import { hexToColor } from './utils'; import { hexToColor } from './utils';
import BlockScene from './block-scene'; import BlockScene from './block-scene';
import { TransactionStripped } from '../../interfaces/node-api.interface'; import { TransactionStripped } from '../../interfaces/node-api.interface';
import { TransactionFlags } from '../../shared/filters.utils';
const hoverTransitionTime = 300; const hoverTransitionTime = 300;
const defaultHoverColor = hexToColor('1bd8f4'); const defaultHoverColor = hexToColor('1bd8f4');
@ -58,7 +59,7 @@ export default class TxView implements TransactionStripped {
this.acc = tx.acc; this.acc = tx.acc;
this.rate = tx.rate; this.rate = tx.rate;
this.status = tx.status; this.status = tx.status;
this.bigintFlags = tx.flags ? BigInt(tx.flags) : 0n; this.bigintFlags = tx.flags ? (BigInt(tx.flags) ^ (this.acc ? TransactionFlags.acceleration : 0n)): 0n;
this.initialised = false; this.initialised = false;
this.vertexArray = scene.vertexArray; this.vertexArray = scene.vertexArray;

View File

@ -1,4 +1,4 @@
<div [ngClass]="{'widget': widget}"> <div [ngClass]="{'widget': widget, 'extra-margin-right': widget}">
<div class="clearfix"></div> <div class="clearfix"></div>

View File

@ -4,6 +4,12 @@
margin-top: 13px; margin-top: 13px;
} }
.extra-margin-right {
@media (max-width: 380px) {
margin-left: -10px;
}
}
tr, td, th { tr, td, th {
border: 0px; border: 0px;
padding-top: 0.65rem; padding-top: 0.65rem;

View File

@ -31,7 +31,7 @@ tr, td, th {
} }
.transaction { .transaction {
width: 20%; width: 65%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -57,7 +57,7 @@ tr, td, th {
} }
.output { .output {
width: 20%; width: 50%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;

View File

@ -427,6 +427,7 @@
.card-title-liquid { .card-title-liquid {
padding-top: 20px; padding-top: 20px;
margin-left: 10px;
} }
.in-progress-message { .in-progress-message {

View File

@ -1017,7 +1017,7 @@ export const restApiDocsData = [
fragment: "get-address-transactions", fragment: "get-address-transactions",
title: "GET Address Transactions", title: "GET Address Transactions",
description: { description: {
default: "Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using <code>:last_seen_txid</code> (see below)." default: "Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using an <code>after_txid</code> query parameter."
}, },
urlString: "/address/:address/txs", urlString: "/address/:address/txs",
showConditions: bitcoinNetworks.concat(liquidNetworks), showConditions: bitcoinNetworks.concat(liquidNetworks),
@ -10070,8 +10070,7 @@ export const restApiDocsData = [
"id": 89, "id": 89,
"user_id": 1, "user_id": 1,
"txid": "ae2639469ec000ed1d14e2550cbb01794e1cd288a00cdc7cce18398ba3cc2ffe", "txid": "ae2639469ec000ed1d14e2550cbb01794e1cd288a00cdc7cce18398ba3cc2ffe",
"status": "failed", "status": "failed"
"estimated_fee": 247,
"fee_paid": 0, "fee_paid": 0,
"added": 1706378712, "added": 1706378712,
"last_updated": 1706378712, "last_updated": 1706378712,
@ -10100,8 +10099,7 @@ export const restApiDocsData = [
"id": 88, "id": 88,
"user_id": 1, "user_id": 1,
"txid": "c5840e89173331760e959a190b24e2a289121277ed7f8a095fe289b37cee9fde", "txid": "c5840e89173331760e959a190b24e2a289121277ed7f8a095fe289b37cee9fde",
"status": "completed", "status": "completed"
"estimated_fee": 223,
"fee_paid": 140019, "fee_paid": 140019,
"added": 1706378704, "added": 1706378704,
"last_updated": 1706380231, "last_updated": 1706380231,
@ -10130,8 +10128,7 @@ export const restApiDocsData = [
"id": 87, "id": 87,
"user_id": 1, "user_id": 1,
"txid": "178b5b9b310f0d667d7ea563a2cdcc17bc8cd15261b58b1653860a724ca83458", "txid": "178b5b9b310f0d667d7ea563a2cdcc17bc8cd15261b58b1653860a724ca83458",
"status": "completed", "status": "completed"
"estimated_fee": 115,
"fee_paid": 90062, "fee_paid": 90062,
"added": 1706378684, "added": 1706378684,
"last_updated": 1706380231, "last_updated": 1706380231,

View File

@ -21,7 +21,7 @@ export const TransactionFlags = {
no_rbf: 0b00000010n, no_rbf: 0b00000010n,
v1: 0b00000100n, v1: 0b00000100n,
v2: 0b00001000n, v2: 0b00001000n,
multisig: 0b00010000n, v3: 0b00010000n,
// address types // address types
p2pk: 0b00000001_00000000n, p2pk: 0b00000001_00000000n,
p2ms: 0b00000010_00000000n, p2ms: 0b00000010_00000000n,
@ -34,6 +34,7 @@ export const TransactionFlags = {
cpfp_parent: 0b00000001_00000000_00000000n, cpfp_parent: 0b00000001_00000000_00000000n,
cpfp_child: 0b00000010_00000000_00000000n, cpfp_child: 0b00000010_00000000_00000000n,
replacement: 0b00000100_00000000_00000000n, replacement: 0b00000100_00000000_00000000n,
acceleration: 0b00001000_00000000_00000000n,
// data // data
op_return: 0b00000001_00000000_00000000_00000000n, op_return: 0b00000001_00000000_00000000_00000000n,
fake_pubkey: 0b00000010_00000000_00000000_00000000n, fake_pubkey: 0b00000010_00000000_00000000_00000000n,
@ -64,7 +65,7 @@ export const TransactionFilters: { [key: string]: Filter } = {
no_rbf: { key: 'no_rbf', label: 'RBF disabled', flag: TransactionFlags.no_rbf, toggle: 'rbf', important: true }, no_rbf: { key: 'no_rbf', label: 'RBF disabled', flag: TransactionFlags.no_rbf, toggle: 'rbf', important: true },
v1: { key: 'v1', label: 'Version 1', flag: TransactionFlags.v1, toggle: 'version' }, v1: { key: 'v1', label: 'Version 1', flag: TransactionFlags.v1, toggle: 'version' },
v2: { key: 'v2', label: 'Version 2', flag: TransactionFlags.v2, toggle: 'version' }, v2: { key: 'v2', label: 'Version 2', flag: TransactionFlags.v2, toggle: 'version' },
// multisig: { key: 'multisig', label: 'Multisig', flag: TransactionFlags.multisig }, v3: { key: 'v3', label: 'Version 3', flag: TransactionFlags.v3, toggle: 'version' },
/* address types */ /* address types */
p2pk: { key: 'p2pk', label: 'P2PK', flag: TransactionFlags.p2pk, important: true }, p2pk: { key: 'p2pk', label: 'P2PK', flag: TransactionFlags.p2pk, important: true },
p2ms: { key: 'p2ms', label: 'Bare multisig', flag: TransactionFlags.p2ms, important: true }, p2ms: { key: 'p2ms', label: 'Bare multisig', flag: TransactionFlags.p2ms, important: true },
@ -77,6 +78,7 @@ export const TransactionFilters: { [key: string]: Filter } = {
cpfp_parent: { key: 'cpfp_parent', label: 'Paid for by child', flag: TransactionFlags.cpfp_parent, important: true }, cpfp_parent: { key: 'cpfp_parent', label: 'Paid for by child', flag: TransactionFlags.cpfp_parent, important: true },
cpfp_child: { key: 'cpfp_child', label: 'Pays for parent', flag: TransactionFlags.cpfp_child, important: true }, cpfp_child: { key: 'cpfp_child', label: 'Pays for parent', flag: TransactionFlags.cpfp_child, important: true },
replacement: { key: 'replacement', label: 'Replacement', flag: TransactionFlags.replacement, important: true }, replacement: { key: 'replacement', label: 'Replacement', flag: TransactionFlags.replacement, important: true },
acceleration: window?.['__env']?.ACCELERATOR ? { key: 'acceleration', label: 'Accelerated', flag: TransactionFlags.acceleration, important: false } : undefined,
/* data */ /* data */
op_return: { key: 'op_return', label: 'OP_RETURN', flag: TransactionFlags.op_return, important: true }, op_return: { key: 'op_return', label: 'OP_RETURN', flag: TransactionFlags.op_return, important: true },
fake_pubkey: { key: 'fake_pubkey', label: 'Fake pubkey', flag: TransactionFlags.fake_pubkey }, fake_pubkey: { key: 'fake_pubkey', label: 'Fake pubkey', flag: TransactionFlags.fake_pubkey },
@ -94,9 +96,9 @@ export const TransactionFilters: { [key: string]: Filter } = {
}; };
export const FilterGroups: { label: string, filters: Filter[]}[] = [ export const FilterGroups: { label: string, filters: Filter[]}[] = [
{ label: 'Features', filters: ['rbf', 'no_rbf', 'v1', 'v2', 'multisig'] }, { label: 'Features', filters: ['rbf', 'no_rbf', 'v1', 'v2', 'v3'] },
{ label: 'Address Types', filters: ['p2pk', 'p2ms', 'p2pkh', 'p2sh', 'p2wpkh', 'p2wsh', 'p2tr'] }, { label: 'Address Types', filters: ['p2pk', 'p2ms', 'p2pkh', 'p2sh', 'p2wpkh', 'p2wsh', 'p2tr'] },
{ label: 'Behavior', filters: ['cpfp_parent', 'cpfp_child', 'replacement'] }, { label: 'Behavior', filters: ['cpfp_parent', 'cpfp_child', 'replacement', 'acceleration'] },
{ label: 'Data', filters: ['op_return', 'fake_pubkey', 'inscription'] }, { label: 'Data', filters: ['op_return', 'fake_pubkey', 'inscription'] },
{ label: 'Heuristics', filters: ['coinjoin', 'consolidation', 'batch_payout'] }, { label: 'Heuristics', filters: ['coinjoin', 'consolidation', 'batch_payout'] },
{ label: 'Sighash Flags', filters: ['sighash_all', 'sighash_none', 'sighash_single', 'sighash_default', 'sighash_acp'] }, { label: 'Sighash Flags', filters: ['sighash_all', 'sighash_none', 'sighash_single', 'sighash_default', 'sighash_acp'] },

View File

@ -0,0 +1,6 @@
# used for "internal" API restriction
geo $remote_addr $mempool_external {
127.0.0.1 '';
::1 '';
default 1;
}

View File

@ -4,10 +4,17 @@
# Block the internal APIs of esplora # Block the internal APIs of esplora
location /api/internal/ { location /api/internal/ {
return 403; if ($mempool_external) {
return 403;
}
rewrite ^/api/(.*) /$1 break;
try_files /dev/null @esplora-api-cache-disabled;
} }
location /api/v1/internal/ { location /api/v1/internal/ {
return 403; if ($mempool_external) {
return 403;
}
try_files /dev/null @mempool-api-v1-cache-normal;
} }
# websocket has special HTTP headers # websocket has special HTTP headers

View File

@ -19,6 +19,7 @@ http {
# HTTP basic configuration # HTTP basic configuration
include mempool/production/nginx/http-basic.conf; include mempool/production/nginx/http-basic.conf;
include mempool/production/nginx/http-acl.conf;
include mempool/production/nginx/http-proxy-cache.conf; include mempool/production/nginx/http-proxy-cache.conf;
include mempool/production/nginx/http-language.conf; include mempool/production/nginx/http-language.conf;