Merge branch 'master' into add-meta-descriptions
This commit is contained in:
commit
9fdb164b64
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -27,8 +27,17 @@ jobs:
|
|||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
registry-url: "https://registry.npmjs.org"
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
|
||||||
- name: Install 1.63.x Rust toolchain
|
- name: Read rust-toolchain file from repository
|
||||||
uses: dtolnay/rust-toolchain@1.63
|
id: gettoolchain
|
||||||
|
run: echo "::set-output name=toolchain::$(cat rust-toolchain)"
|
||||||
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}
|
||||||
|
|
||||||
|
- name: Install ${{ steps.gettoolchain.outputs.toolchain }} Rust toolchain
|
||||||
|
# Latest version available on this commit is 1.71.1
|
||||||
|
# Commit date is Aug 3, 2023
|
||||||
|
uses: dtolnay/rust-toolchain@f361669954a8ecfc00a3443f35f9ac8e610ffc06
|
||||||
|
with:
|
||||||
|
toolchain: ${{ steps.gettoolchain.outputs.toolchain }}
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
if: ${{ matrix.flavor == 'dev'}}
|
if: ${{ matrix.flavor == 'dev'}}
|
||||||
|
@ -85,7 +85,7 @@ Install dependencies with `npm` and build the backend:
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd backend
|
cd backend
|
||||||
npm install
|
npm install --no-install-links # npm@9.4.2 and later can omit the --no-install-links
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@ authors = ["mononaut"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[workspace]
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
|
@ -451,6 +451,7 @@ class MempoolBlocks {
|
|||||||
private processBlockTemplates(mempool: { [txid: string]: MempoolTransactionExtended }, blocks: string[][], blockWeights: number[] | null, rates: [string, number][], clusters: string[][], accelerations, accelerationPool, saveResults): MempoolBlockWithTransactions[] {
|
private processBlockTemplates(mempool: { [txid: string]: MempoolTransactionExtended }, blocks: string[][], blockWeights: number[] | null, rates: [string, number][], clusters: string[][], accelerations, accelerationPool, saveResults): MempoolBlockWithTransactions[] {
|
||||||
for (const [txid, rate] of rates) {
|
for (const [txid, rate] of rates) {
|
||||||
if (txid in mempool) {
|
if (txid in mempool) {
|
||||||
|
mempool[txid].cpfpDirty = (rate !== mempool[txid].effectiveFeePerVsize);
|
||||||
mempool[txid].effectiveFeePerVsize = rate;
|
mempool[txid].effectiveFeePerVsize = rate;
|
||||||
mempool[txid].cpfpChecked = false;
|
mempool[txid].cpfpChecked = false;
|
||||||
}
|
}
|
||||||
@ -494,6 +495,9 @@ class MempoolBlocks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (mempoolTx.ancestors?.length !== ancestors.length || mempoolTx.descendants?.length !== descendants.length) {
|
||||||
|
mempoolTx.cpfpDirty = true;
|
||||||
|
}
|
||||||
Object.assign(mempoolTx, {ancestors, descendants, bestDescendant: null, cpfpChecked: true});
|
Object.assign(mempoolTx, {ancestors, descendants, bestDescendant: null, cpfpChecked: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -531,12 +535,21 @@ class MempoolBlocks {
|
|||||||
|
|
||||||
const acceleration = accelerations[txid];
|
const acceleration = accelerations[txid];
|
||||||
if (isAccelerated[txid] || (acceleration && (!accelerationPool || acceleration.pools.includes(accelerationPool)))) {
|
if (isAccelerated[txid] || (acceleration && (!accelerationPool || acceleration.pools.includes(accelerationPool)))) {
|
||||||
|
if (!mempoolTx.acceleration) {
|
||||||
|
mempoolTx.cpfpDirty = true;
|
||||||
|
}
|
||||||
mempoolTx.acceleration = true;
|
mempoolTx.acceleration = true;
|
||||||
for (const ancestor of mempoolTx.ancestors || []) {
|
for (const ancestor of mempoolTx.ancestors || []) {
|
||||||
|
if (!mempool[ancestor.txid].acceleration) {
|
||||||
|
mempool[ancestor.txid].cpfpDirty = true;
|
||||||
|
}
|
||||||
mempool[ancestor.txid].acceleration = true;
|
mempool[ancestor.txid].acceleration = true;
|
||||||
isAccelerated[ancestor.txid] = true;
|
isAccelerated[ancestor.txid] = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (mempoolTx.acceleration) {
|
||||||
|
mempoolTx.cpfpDirty = true;
|
||||||
|
}
|
||||||
delete mempoolTx.acceleration;
|
delete mempoolTx.acceleration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import bitcoinApi, { bitcoinCoreApi } from './bitcoin/bitcoin-api-factory';
|
|||||||
import * as bitcoinjs from 'bitcoinjs-lib';
|
import * as bitcoinjs from 'bitcoinjs-lib';
|
||||||
import logger from '../logger';
|
import logger from '../logger';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
|
import pLimit from '../utils/p-limit';
|
||||||
|
|
||||||
class TransactionUtils {
|
class TransactionUtils {
|
||||||
constructor() { }
|
constructor() { }
|
||||||
@ -74,8 +75,12 @@ class TransactionUtils {
|
|||||||
|
|
||||||
public async $getMempoolTransactionsExtended(txids: string[], addPrevouts = false, lazyPrevouts = false, forceCore = false): Promise<MempoolTransactionExtended[]> {
|
public async $getMempoolTransactionsExtended(txids: string[], addPrevouts = false, lazyPrevouts = false, forceCore = false): Promise<MempoolTransactionExtended[]> {
|
||||||
if (forceCore || config.MEMPOOL.BACKEND !== 'esplora') {
|
if (forceCore || config.MEMPOOL.BACKEND !== 'esplora') {
|
||||||
const results = await Promise.allSettled(txids.map(txid => this.$getTransactionExtended(txid, addPrevouts, lazyPrevouts, forceCore, true)));
|
const limiter = pLimit(8); // Run 8 requests at a time
|
||||||
return (results.filter(r => r.status === 'fulfilled') as PromiseFulfilledResult<MempoolTransactionExtended>[]).map(r => r.value);
|
const results = await Promise.allSettled(txids.map(
|
||||||
|
txid => limiter(() => this.$getMempoolTransactionExtended(txid, addPrevouts, lazyPrevouts, forceCore))
|
||||||
|
));
|
||||||
|
return results.filter(reply => reply.status === 'fulfilled')
|
||||||
|
.map(r => (r as PromiseFulfilledResult<MempoolTransactionExtended>).value);
|
||||||
} else {
|
} else {
|
||||||
const transactions = await bitcoinApi.$getMempoolTransactions(txids);
|
const transactions = await bitcoinApi.$getMempoolTransactions(txids);
|
||||||
return transactions.map(transaction => {
|
return transactions.map(transaction => {
|
||||||
|
@ -586,13 +586,25 @@ class WebsocketHandler {
|
|||||||
|
|
||||||
const mempoolTx = newMempool[trackTxid];
|
const mempoolTx = newMempool[trackTxid];
|
||||||
if (mempoolTx && mempoolTx.position) {
|
if (mempoolTx && mempoolTx.position) {
|
||||||
response['txPosition'] = JSON.stringify({
|
const positionData = {
|
||||||
txid: trackTxid,
|
txid: trackTxid,
|
||||||
position: {
|
position: {
|
||||||
...mempoolTx.position,
|
...mempoolTx.position,
|
||||||
accelerated: mempoolTx.acceleration || undefined,
|
accelerated: mempoolTx.acceleration || undefined,
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
if (mempoolTx.cpfpDirty) {
|
||||||
|
positionData['cpfp'] = {
|
||||||
|
ancestors: mempoolTx.ancestors,
|
||||||
|
bestDescendant: mempoolTx.bestDescendant || null,
|
||||||
|
descendants: mempoolTx.descendants || null,
|
||||||
|
effectiveFeePerVsize: mempoolTx.effectiveFeePerVsize || null,
|
||||||
|
sigops: mempoolTx.sigops,
|
||||||
|
adjustedVsize: mempoolTx.adjustedVsize,
|
||||||
|
acceleration: mempoolTx.acceleration
|
||||||
|
};
|
||||||
|
}
|
||||||
|
response['txPosition'] = JSON.stringify(positionData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ export interface MempoolTransactionExtended extends TransactionExtended {
|
|||||||
adjustedFeePerVsize: number;
|
adjustedFeePerVsize: number;
|
||||||
inputs?: number[];
|
inputs?: number[];
|
||||||
lastBoosted?: number;
|
lastBoosted?: number;
|
||||||
|
cpfpDirty?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AuditTransaction {
|
export interface AuditTransaction {
|
||||||
|
179
backend/src/utils/p-limit.ts
Normal file
179
backend/src/utils/p-limit.ts
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||||
|
software and associated documentation files (the "Software"), to deal in the Software
|
||||||
|
without restriction, including without limitation the rights to use, copy, modify,
|
||||||
|
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||||
|
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
How it works:
|
||||||
|
`this._head` is an instance of `Node` which keeps track of its current value and nests
|
||||||
|
another instance of `Node` that keeps the value that comes after it. When a value is
|
||||||
|
provided to `.enqueue()`, the code needs to iterate through `this._head`, going deeper
|
||||||
|
and deeper to find the last value. However, iterating through every single item is slow.
|
||||||
|
This problem is solved by saving a reference to the last value as `this._tail` so that
|
||||||
|
it can reference it to add a new value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Node {
|
||||||
|
value;
|
||||||
|
next;
|
||||||
|
|
||||||
|
constructor(value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Queue {
|
||||||
|
private _head;
|
||||||
|
private _tail;
|
||||||
|
private _size;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
enqueue(value) {
|
||||||
|
const node = new Node(value);
|
||||||
|
|
||||||
|
if (this._head) {
|
||||||
|
this._tail.next = node;
|
||||||
|
this._tail = node;
|
||||||
|
} else {
|
||||||
|
this._head = node;
|
||||||
|
this._tail = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._size++;
|
||||||
|
}
|
||||||
|
|
||||||
|
dequeue() {
|
||||||
|
const current = this._head;
|
||||||
|
if (!current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._head = this._head.next;
|
||||||
|
this._size--;
|
||||||
|
return current.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
clear() {
|
||||||
|
this._head = undefined;
|
||||||
|
this._tail = undefined;
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get size() {
|
||||||
|
return this._size;
|
||||||
|
}
|
||||||
|
|
||||||
|
*[Symbol.iterator]() {
|
||||||
|
let current = this._head;
|
||||||
|
|
||||||
|
while (current) {
|
||||||
|
yield current.value;
|
||||||
|
current = current.next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface LimitFunction {
|
||||||
|
readonly activeCount: number;
|
||||||
|
readonly pendingCount: number;
|
||||||
|
clearQueue: () => void;
|
||||||
|
<Arguments extends unknown[], ReturnType>(
|
||||||
|
fn: (...args: Arguments) => PromiseLike<ReturnType> | ReturnType,
|
||||||
|
...args: Arguments
|
||||||
|
): Promise<ReturnType>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function pLimit(concurrency: number): LimitFunction {
|
||||||
|
if (
|
||||||
|
!(
|
||||||
|
(Number.isInteger(concurrency) ||
|
||||||
|
concurrency === Number.POSITIVE_INFINITY) &&
|
||||||
|
concurrency > 0
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queue = new Queue();
|
||||||
|
let activeCount = 0;
|
||||||
|
|
||||||
|
const next = () => {
|
||||||
|
activeCount--;
|
||||||
|
|
||||||
|
if (queue.size > 0) {
|
||||||
|
queue.dequeue()();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const run = async (fn, resolve, args) => {
|
||||||
|
activeCount++;
|
||||||
|
|
||||||
|
const result = (async () => fn(...args))();
|
||||||
|
|
||||||
|
resolve(result);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await result;
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
next();
|
||||||
|
};
|
||||||
|
|
||||||
|
const enqueue = (fn, resolve, args) => {
|
||||||
|
queue.enqueue(run.bind(undefined, fn, resolve, args));
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
// This function needs to wait until the next microtask before comparing
|
||||||
|
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
||||||
|
// when the run function is dequeued and called. The comparison in the if-statement
|
||||||
|
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
||||||
|
await Promise.resolve();
|
||||||
|
|
||||||
|
if (activeCount < concurrency && queue.size > 0) {
|
||||||
|
queue.dequeue()();
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
|
||||||
|
const generator = (fn, ...args) =>
|
||||||
|
new Promise((resolve) => {
|
||||||
|
enqueue(fn, resolve, args);
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperties(generator, {
|
||||||
|
activeCount: {
|
||||||
|
get: () => activeCount,
|
||||||
|
},
|
||||||
|
pendingCount: {
|
||||||
|
get: () => queue.size,
|
||||||
|
},
|
||||||
|
clearQueue: {
|
||||||
|
value: () => {
|
||||||
|
queue.clear();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return generator as any;
|
||||||
|
}
|
3375
frontend/package-lock.json
generated
3375
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -61,18 +61,18 @@
|
|||||||
"cypress:run:ci:staging": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:run:record"
|
"cypress:run:ci:staging": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:run:record"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular-devkit/build-angular": "^16.1.4",
|
"@angular-devkit/build-angular": "^16.2.0",
|
||||||
"@angular/animations": "^16.1.5",
|
"@angular/animations": "^16.2.2",
|
||||||
"@angular/cli": "^16.1.4",
|
"@angular/cli": "^16.2.0",
|
||||||
"@angular/common": "^16.1.5",
|
"@angular/common": "^16.2.2",
|
||||||
"@angular/compiler": "^16.1.5",
|
"@angular/compiler": "^16.2.2",
|
||||||
"@angular/core": "^16.1.5",
|
"@angular/core": "^16.2.2",
|
||||||
"@angular/forms": "^16.1.5",
|
"@angular/forms": "^16.2.2",
|
||||||
"@angular/localize": "^16.1.5",
|
"@angular/localize": "^16.2.2",
|
||||||
"@angular/platform-browser": "^16.1.5",
|
"@angular/platform-browser": "^16.2.2",
|
||||||
"@angular/platform-browser-dynamic": "^16.1.5",
|
"@angular/platform-browser-dynamic": "^16.2.2",
|
||||||
"@angular/platform-server": "^16.1.5",
|
"@angular/platform-server": "^16.2.2",
|
||||||
"@angular/router": "^16.1.5",
|
"@angular/router": "^16.2.2",
|
||||||
"@fortawesome/angular-fontawesome": "~0.13.0",
|
"@fortawesome/angular-fontawesome": "~0.13.0",
|
||||||
"@fortawesome/fontawesome-common-types": "~6.4.0",
|
"@fortawesome/fontawesome-common-types": "~6.4.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "~6.4.0",
|
"@fortawesome/fontawesome-svg-core": "~6.4.0",
|
||||||
|
@ -242,7 +242,7 @@
|
|||||||
<img class="image" src="/resources/profile/ronindojo.png" />
|
<img class="image" src="/resources/profile/ronindojo.png" />
|
||||||
<span>RoninDojo</span>
|
<span>RoninDojo</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/runcitadel/core" target="_blank" title="Citadel">
|
<a href="https://github.com/runcitadel" target="_blank" title="Citadel">
|
||||||
<img class="image" src="/resources/profile/runcitadel.svg" />
|
<img class="image" src="/resources/profile/runcitadel.svg" />
|
||||||
<span>Citadel</span>
|
<span>Citadel</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -162,34 +162,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.subscribe((cpfpInfo) => {
|
.subscribe((cpfpInfo) => {
|
||||||
if (!cpfpInfo || !this.tx) {
|
this.setCpfpInfo(cpfpInfo);
|
||||||
this.cpfpInfo = null;
|
|
||||||
this.hasEffectiveFeeRate = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// merge ancestors/descendants
|
|
||||||
const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])];
|
|
||||||
if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) {
|
|
||||||
relatives.push(cpfpInfo.bestDescendant);
|
|
||||||
}
|
|
||||||
const hasRelatives = !!relatives.length;
|
|
||||||
if (!cpfpInfo.effectiveFeePerVsize && hasRelatives) {
|
|
||||||
let totalWeight =
|
|
||||||
this.tx.weight +
|
|
||||||
relatives.reduce((prev, val) => prev + val.weight, 0);
|
|
||||||
let totalFees =
|
|
||||||
this.tx.fee +
|
|
||||||
relatives.reduce((prev, val) => prev + val.fee, 0);
|
|
||||||
this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
|
|
||||||
} else {
|
|
||||||
this.tx.effectiveFeePerVsize = cpfpInfo.effectiveFeePerVsize;
|
|
||||||
}
|
|
||||||
if (cpfpInfo.acceleration) {
|
|
||||||
this.tx.acceleration = cpfpInfo.acceleration;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.cpfpInfo = cpfpInfo;
|
|
||||||
this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fetchRbfSubscription = this.fetchRbfHistory$
|
this.fetchRbfSubscription = this.fetchRbfHistory$
|
||||||
@ -260,6 +233,10 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
mempoolPosition: this.mempoolPosition
|
mempoolPosition: this.mempoolPosition
|
||||||
});
|
});
|
||||||
this.txInBlockIndex = this.mempoolPosition.block;
|
this.txInBlockIndex = this.mempoolPosition.block;
|
||||||
|
|
||||||
|
if (txPosition.cpfp !== undefined) {
|
||||||
|
this.setCpfpInfo(txPosition.cpfp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.mempoolPosition = null;
|
this.mempoolPosition = null;
|
||||||
@ -509,6 +486,37 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCpfpInfo(cpfpInfo: CpfpInfo): void {
|
||||||
|
if (!cpfpInfo || !this.tx) {
|
||||||
|
this.cpfpInfo = null;
|
||||||
|
this.hasEffectiveFeeRate = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// merge ancestors/descendants
|
||||||
|
const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])];
|
||||||
|
if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) {
|
||||||
|
relatives.push(cpfpInfo.bestDescendant);
|
||||||
|
}
|
||||||
|
const hasRelatives = !!relatives.length;
|
||||||
|
if (!cpfpInfo.effectiveFeePerVsize && hasRelatives) {
|
||||||
|
const totalWeight =
|
||||||
|
this.tx.weight +
|
||||||
|
relatives.reduce((prev, val) => prev + val.weight, 0);
|
||||||
|
const totalFees =
|
||||||
|
this.tx.fee +
|
||||||
|
relatives.reduce((prev, val) => prev + val.fee, 0);
|
||||||
|
this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
|
||||||
|
} else {
|
||||||
|
this.tx.effectiveFeePerVsize = cpfpInfo.effectiveFeePerVsize;
|
||||||
|
}
|
||||||
|
if (cpfpInfo.acceleration) {
|
||||||
|
this.tx.acceleration = cpfpInfo.acceleration;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cpfpInfo = cpfpInfo;
|
||||||
|
this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01));
|
||||||
|
}
|
||||||
|
|
||||||
setFeatures(): void {
|
setFeatures(): void {
|
||||||
if (this.tx) {
|
if (this.tx) {
|
||||||
this.segwitEnabled = !this.tx.status.confirmed || isFeatureActive(this.stateService.network, this.tx.status.block_height, 'segwit');
|
this.segwitEnabled = !this.tx.status.confirmed || isFeatureActive(this.stateService.network, this.tx.status.block_height, 'segwit');
|
||||||
|
@ -19,7 +19,7 @@ export interface Transaction {
|
|||||||
ancestors?: Ancestor[];
|
ancestors?: Ancestor[];
|
||||||
bestDescendant?: BestDescendant | null;
|
bestDescendant?: BestDescendant | null;
|
||||||
cpfpChecked?: boolean;
|
cpfpChecked?: boolean;
|
||||||
acceleration?: number;
|
acceleration?: boolean;
|
||||||
deleteAfter?: number;
|
deleteAfter?: number;
|
||||||
_unblinded?: any;
|
_unblinded?: any;
|
||||||
_deduced?: boolean;
|
_deduced?: boolean;
|
||||||
|
@ -27,7 +27,7 @@ export interface CpfpInfo {
|
|||||||
effectiveFeePerVsize?: number;
|
effectiveFeePerVsize?: number;
|
||||||
sigops?: number;
|
sigops?: number;
|
||||||
adjustedVsize?: number;
|
adjustedVsize?: number;
|
||||||
acceleration?: number;
|
acceleration?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RbfInfo {
|
export interface RbfInfo {
|
||||||
|
@ -2,7 +2,7 @@ import { Inject, Injectable, PLATFORM_ID, LOCALE_ID } from '@angular/core';
|
|||||||
import { ReplaySubject, BehaviorSubject, Subject, fromEvent, Observable, merge } from 'rxjs';
|
import { ReplaySubject, BehaviorSubject, Subject, fromEvent, Observable, merge } from 'rxjs';
|
||||||
import { Transaction } from '../interfaces/electrs.interface';
|
import { Transaction } from '../interfaces/electrs.interface';
|
||||||
import { IBackendInfo, MempoolBlock, MempoolBlockDelta, MempoolInfo, Recommendedfees, ReplacedTransaction, ReplacementInfo, TransactionStripped } from '../interfaces/websocket.interface';
|
import { IBackendInfo, MempoolBlock, MempoolBlockDelta, MempoolInfo, Recommendedfees, ReplacedTransaction, ReplacementInfo, TransactionStripped } from '../interfaces/websocket.interface';
|
||||||
import { BlockExtended, DifficultyAdjustment, MempoolPosition, OptimizedMempoolStats, RbfTree } from '../interfaces/node-api.interface';
|
import { BlockExtended, CpfpInfo, DifficultyAdjustment, MempoolPosition, OptimizedMempoolStats, RbfTree } from '../interfaces/node-api.interface';
|
||||||
import { Router, NavigationStart } from '@angular/router';
|
import { Router, NavigationStart } from '@angular/router';
|
||||||
import { isPlatformBrowser } from '@angular/common';
|
import { isPlatformBrowser } from '@angular/common';
|
||||||
import { filter, map, scan, shareReplay } from 'rxjs/operators';
|
import { filter, map, scan, shareReplay } from 'rxjs/operators';
|
||||||
@ -113,7 +113,7 @@ export class StateService {
|
|||||||
utxoSpent$ = new Subject<object>();
|
utxoSpent$ = new Subject<object>();
|
||||||
difficultyAdjustment$ = new ReplaySubject<DifficultyAdjustment>(1);
|
difficultyAdjustment$ = new ReplaySubject<DifficultyAdjustment>(1);
|
||||||
mempoolTransactions$ = new Subject<Transaction>();
|
mempoolTransactions$ = new Subject<Transaction>();
|
||||||
mempoolTxPosition$ = new Subject<{ txid: string, position: MempoolPosition}>();
|
mempoolTxPosition$ = new Subject<{ txid: string, position: MempoolPosition, cpfp: CpfpInfo | null}>();
|
||||||
blockTransactions$ = new Subject<Transaction>();
|
blockTransactions$ = new Subject<Transaction>();
|
||||||
isLoadingWebSocket$ = new ReplaySubject<boolean>(1);
|
isLoadingWebSocket$ = new ReplaySubject<boolean>(1);
|
||||||
isLoadingMempool$ = new BehaviorSubject<boolean>(true);
|
isLoadingMempool$ = new BehaviorSubject<boolean>(true);
|
||||||
|
@ -48,7 +48,7 @@ load_rc_config ${name}
|
|||||||
: ${bitcoin_syslog_facility:="local0"}
|
: ${bitcoin_syslog_facility:="local0"}
|
||||||
: ${bitcoin_syslog_priority:="info"}
|
: ${bitcoin_syslog_priority:="info"}
|
||||||
: ${bitcoin_syslog_tag:="bitcoin"}
|
: ${bitcoin_syslog_tag:="bitcoin"}
|
||||||
: ${bitcoin_kill_after:="300"}
|
: ${bitcoin_kill_after:="600"}
|
||||||
: ${bitcoinlimits_args:="-e -U ${bitcoin_user}"}
|
: ${bitcoinlimits_args:="-e -U ${bitcoin_user}"}
|
||||||
|
|
||||||
# set up dependant variables
|
# set up dependant variables
|
||||||
|
@ -1045,11 +1045,9 @@ osSudo "${ROOT_USER}" crontab -u "${MEMPOOL_USER}" "${MEMPOOL_HOME}/${MEMPOOL_RE
|
|||||||
echo "[*] Installing nvm.sh from GitHub"
|
echo "[*] Installing nvm.sh from GitHub"
|
||||||
osSudo "${MEMPOOL_USER}" sh -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh'
|
osSudo "${MEMPOOL_USER}" sh -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh'
|
||||||
|
|
||||||
echo "[*] Building NodeJS v20.4.0 via nvm.sh"
|
echo "[*] Building NodeJS v20.5.1 via nvm.sh"
|
||||||
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v20.4.0 --shared-zlib'
|
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v20.5.1 --shared-zlib'
|
||||||
echo "[*] Building NodeJS v18.16.1 via nvm.sh"
|
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm alias default 20.5.1'
|
||||||
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm install v18.16.1 --shared-zlib'
|
|
||||||
osSudo "${MEMPOOL_USER}" zsh -c 'source ~/.zshrc ; nvm alias default 18.16.1'
|
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Tor installation #
|
# Tor installation #
|
||||||
@ -1857,22 +1855,22 @@ ln -s "${MEMPOOL_HOME}/mempool" "${NGINX_ETC_FOLDER}/mempool"
|
|||||||
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!${NGINX_USER}!" "${NGINX_CONFIGURATION}"
|
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!${NGINX_USER}!" "${NGINX_CONFIGURATION}"
|
||||||
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}"
|
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}"
|
||||||
|
|
||||||
if [ "${TOR_INSTALL}" = ON ];then
|
#if [ "${TOR_INSTALL}" = ON ];then
|
||||||
echo "[*] Read tor v3 onion hostnames"
|
# echo "[*] Read tor v3 onion hostnames"
|
||||||
|
#
|
||||||
NGINX_MEMPOOL_ONION=$(cat "${TOR_RESOURCES}/mempool/hostname")
|
# NGINX_MEMPOOL_ONION=$(cat "${TOR_RESOURCES}/mempool/hostname")
|
||||||
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}"
|
# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}"
|
||||||
|
#
|
||||||
if [ "${ELEMENTS_LIQUID_ENABLE}" = "ON" ];then
|
# if [ "${ELEMENTS_LIQUID_ENABLE}" = "ON" ];then
|
||||||
NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname")
|
# NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname")
|
||||||
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}"
|
# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}"
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
if [ "${BISQ_MAINNET_ENABLE}" = "ON" ];then
|
# if [ "${BISQ_MAINNET_ENABLE}" = "ON" ];then
|
||||||
NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname")
|
# NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname")
|
||||||
osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}"
|
# osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}"
|
||||||
fi
|
# fi
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
##### OS systemd
|
##### OS systemd
|
||||||
|
|
||||||
@ -1896,13 +1894,26 @@ echo "[*] Updating system startup configuration"
|
|||||||
case $OS in
|
case $OS in
|
||||||
|
|
||||||
FreeBSD)
|
FreeBSD)
|
||||||
echo 'nginx_enable="YES"' >> /etc/rc.conf
|
cat >> /etc/rc.conf <<EOF
|
||||||
echo 'bitcoin_enable="YES"' >> /etc/rc.conf
|
moused_nondefault_enable="NO"
|
||||||
echo 'tor_enable="YES"' >> /etc/rc.conf
|
|
||||||
echo 'postfix_enable="YES"' >> /etc/rc.conf
|
nginx_enable="YES"
|
||||||
echo 'mysql_enable="YES"' >> /etc/rc.conf
|
nginx_profiles="mempool"
|
||||||
echo 'mysql_dbdir="/mysql"' >> /etc/rc.conf
|
nginx_mempool_flags="-p /mempool"
|
||||||
echo 'tor_enable="YES"' >> /etc/rc.conf
|
nginx_mempool_configfile="/mempool/mempool/nginx/nginx.conf"
|
||||||
|
|
||||||
|
mysql_enable="YES"
|
||||||
|
mysql_dbdir="/mysql"
|
||||||
|
mysql_args="--innodb-buffer-pool-size=8G --bind-address 127.0.0.1"
|
||||||
|
|
||||||
|
kld_list="nvidia"
|
||||||
|
nvidia_xorg_enable="YES"
|
||||||
|
|
||||||
|
dbus_enable="YES"
|
||||||
|
tor_enable="YES"
|
||||||
|
bitcoin_enable="YES"
|
||||||
|
postfix_enable="YES"
|
||||||
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Debian)
|
Debian)
|
||||||
@ -2038,12 +2049,12 @@ osSudo "${MEMPOOL_USER}" sh -c "cd ${MEMPOOL_HOME} && ./upgrade" || true
|
|||||||
|
|
||||||
##### finish
|
##### finish
|
||||||
|
|
||||||
if [ "${TOR_INSTALL}" = ON ];then
|
#if [ "${TOR_INSTALL}" = ON ];then
|
||||||
echo "Your auto-generated Tor addresses are:"
|
# echo "Your auto-generated Tor addresses are:"
|
||||||
echo "${NGINX_MEMPOOL_ONION}"
|
# echo "${NGINX_MEMPOOL_ONION}"
|
||||||
echo "${NGINX_BISQ_ONION}"
|
# echo "${NGINX_BISQ_ONION}"
|
||||||
echo "${NGINX_LIQUID_ONION}"
|
# echo "${NGINX_LIQUID_ONION}"
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo 'Please reboot to start all the services.'
|
echo 'Please reboot to start all the services.'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
source "$NVM_DIR/nvm.sh"
|
source "$NVM_DIR/nvm.sh"
|
||||||
nvm use v20.4.0
|
nvm use v20.5.1
|
||||||
|
|
||||||
# start all mempool backends that exist
|
# start all mempool backends that exist
|
||||||
for site in mainnet mainnet-lightning testnet testnet-lightning signet signet-lightning bisq liquid liquidtestnet;do
|
for site in mainnet mainnet-lightning testnet testnet-lightning signet signet-lightning bisq liquid liquidtestnet;do
|
||||||
|
@ -1 +1 @@
|
|||||||
1.70
|
1.63
|
||||||
|
@ -42,6 +42,6 @@
|
|||||||
"--use-mock-keychain",
|
"--use-mock-keychain",
|
||||||
"--ignore-gpu-blacklist",
|
"--ignore-gpu-blacklist",
|
||||||
"--ignore-gpu-blocklist",
|
"--ignore-gpu-blocklist",
|
||||||
"--use-gl=egl"
|
"--use-angle=default"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user