Merge branch 'master' into fix-pools-address-overflow

This commit is contained in:
Oscar Guevara 2026-02-12 19:04:08 -06:00 committed by GitHub
commit d31fcc25ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 3584 additions and 2043 deletions

View file

@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
import { RowDataPacket } from 'mysql2';
class DatabaseMigration {
private static currentVersion = 105;
private static currentVersion = 106;
private queryTimeout = 3600_000;
private statisticsAddedIndexed = false;
private uniqueLogs: string[] = [];
@ -1201,6 +1201,27 @@ class DatabaseMigration {
}
await this.updateToSchemaVersion(105);
}
// another liquid failure, fix bad timelocks on federation txos
// (safe to make this conditional on the network since it doesn't change the database schema)
if (databaseSchemaVersion < 106 && config.MEMPOOL.NETWORK === 'liquid') {
// In a specific setup it's possible that 3G6neksSBMp51kHJ2if8SeDUrzT8iVETWT and bc1qwnevjp8nsq7adu3hxlvdvslrf242q4vuavfg0y929jp2zntp3vgq7cq6z2
// were set with a timelock of 2016 instead of 4032
// This rollbacks the tables to before bc1qwnevjp8nsq7adu3hxlvdvslrf242q4vuavfg0y929jp2zntp3vgq7cq6z2 is used, and
// manually fixes the timelock for 3G6neksSBMp51kHJ2if8SeDUrzT8iVETWT
const [stateRows]: any[] = await DB.query(`SELECT name, number FROM state WHERE name IN ('last_elements_block', 'last_bitcoin_block_audit')`);
const lastElementsBlock = Number(stateRows?.find((row: any) => row.name === 'last_elements_block')?.number ?? 0);
const lastBlockAudit = Number(stateRows?.find((row: any) => row.name === 'last_bitcoin_block_audit')?.number ?? 0);
if (lastElementsBlock > 3686608 && lastBlockAudit > 929700) {
await this.$executeQuery('DELETE FROM elements_pegs WHERE block > 3686608');
await this.$executeQuery('DELETE FROM federation_txos WHERE blocknumber > 929701');
await this.$executeQuery(`UPDATE federation_txos SET lastblockupdate = 929700 WHERE unspent = 1;`);
await this.$executeQuery(`UPDATE federation_txos SET timelock = 4032 WHERE bitcoinaddress = '3G6neksSBMp51kHJ2if8SeDUrzT8iVETWT';`);
await this.$executeQuery(`UPDATE state SET number = 3686608 WHERE name = 'last_elements_block';`);
await this.$executeQuery(`UPDATE state SET number = 929700 WHERE name = 'last_bitcoin_block_audit';`);
}
await this.updateToSchemaVersion(106);
}
}
/**

View file

@ -138,6 +138,19 @@
</defs>
</svg>
</ng-container>
<ng-container *ngSwitchCase="'mempoolSquare'">
<svg [class]="class" [style]="style" [attr.width]="width" [attr.height]="height" [attr.viewBox]="viewBox" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M124.706 110.25C124.706 118.849 117.772 125.791 109.183 125.791H15.5236C6.93387 125.791 0 118.849 0 110.25V16.4837C0 7.88416 6.98561 0.942383 15.5236 0.942383H109.183C117.772 0.942383 124.706 7.88416 124.706 16.4837V110.25Z" fill="#2E3349"/>
<path d="M0 63.5225V110.25C0 118.849 6.98561 125.791 15.5753 125.791H109.183C117.772 125.791 124.758 118.849 124.758 110.25V63.5225H0Z" [attr.fill]="'url(#paint0_linear' + randomId + ')'"/>
<path opacity="0.3" d="M109.909 109.11C109.909 111.026 108.615 112.581 107.011 112.581H90.8665C89.2624 112.581 87.9688 111.026 87.9688 109.11V17.6232C87.9688 15.7065 89.2624 14.1523 90.8665 14.1523H107.011C108.615 14.1523 109.909 15.7065 109.909 17.6232V109.11Z" fill="white"/>
<defs>
<linearGradient [id]="'paint0_linear' + randomId" x1="62.3768" y1="36.3949" x2="62.3768" y2="156.837" gradientUnits="userSpaceOnUse">
<stop stop-color="#AE61FF"/>
<stop offset="1" stop-color="#13EFD8"/>
</linearGradient>
</defs>
</svg>
</ng-container>
<ng-container *ngSwitchCase="'liquidNetwork'">
<svg width="140" viewBox="0 0 500 126" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">

View file

@ -12451,6 +12451,121 @@ export const restApiDocsData = [
}
}
},
{
options: { officialOnly: true },
type: 'endpoint',
category: 'accelerator-private',
httpRequestMethod: 'POST',
fragment: 'accelerator-auto-accelerate',
title: 'POST Auto-Accelerate A Transaction (Pro)',
description: {
default: '<p>Sends a request to automatically accelerate a transaction based on specified trigger conditions.</p><p>The <code>type</code> parameter must be one of: <code>time_delay</code>, <code>block_height</code>, <code>timestamp</code>, or <code>next_block</code>.<br>The <code>value</code> parameter is required for types other than <code>next_block</code> and depends on the type: hours (floating point, min = 0.5) for <code>time_delay</code>, block height (min = next block height) for <code>block_height</code>, or Unix timestamp (min = now + 60 seconds) for <code>timestamp</code>.</p>'
},
urlString: '/v1/services/accelerator/auto-accelerate',
showConditions: [''],
showJsExamples: showJsExamplesDefaultFalse,
codeExample: {
default: {
codeTemplate: {
curl: `%{1}" "[[hostname]][[baseNetworkUrl]]/api/v1/services/accelerator/auto-accelerate`, //custom interpolation technique handled in replaceCurlPlaceholder()
commonJS: ``,
esModule: ``
},
codeSampleMainnet: {
esModule: [],
commonJS: [],
curl: ['txInput=ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29&type=time_delay&value=0.5'],
headers: 'X-Mempool-Auth: stacksats',
response: `HTTP/1.1 200 OK`,
},
}
}
},
{
options: { officialOnly: true },
type: 'endpoint',
category: 'accelerator-private',
httpRequestMethod: 'GET',
fragment: 'accelerator-auto-accelerate-history',
title: 'GET Auto-Acceleration History',
description: {
default: '<p>Returns the user\'s auto-acceleration requests history.</p><p>Possible status values: <code>tracking</code>, <code>accelerated</code>, <code>confirmed</code>, <code>canceled</code>.</p>'
},
urlString: '/v1/services/accelerator/auto-accelerate/history',
showConditions: [''],
showJsExamples: showJsExamplesDefaultFalse,
codeExample: {
default: {
codeTemplate: {
curl: `/api/v1/services/accelerator/auto-accelerate/history`,
commonJS: ``,
esModule: ``
},
codeSampleMainnet: {
esModule: [],
commonJS: [],
curl: [],
headers: 'X-Mempool-Auth: stacksats',
response: `[
{
"id": 15,
"txid": "ee13ebb99632377c15c94980357f674d285ac413452050031ea6dcd3e9b2dc29",
"status": "accelerated",
"added": 1706378712,
"trigger_type": "time_delay",
"trigger_value": 0.5
},
{
"id": 14,
"txid": "c5840e89173331760e959a190b24e2a289121277ed7f8a095fe289b37cee9fde",
"status": "confirmed",
"added": 1706378704,
"trigger_type": "block_height",
"trigger_value": 827670
},
{
"id": 13,
"txid": "178b5b9b310f0d667d7ea563a2cdcc17bc8cd15261b58b1653860a724ca83458",
"status": "tracking",
"added": 1706378684,
"trigger_type": "next_block",
"trigger_value": null
}
]`,
},
}
}
},
{
options: { officialOnly: true },
type: 'endpoint',
category: 'accelerator-private',
httpRequestMethod: 'POST',
fragment: 'accelerator-auto-accelerate-cancel',
title: 'POST Cancel Auto-Acceleration (Pro)',
description: {
default: '<p>Sends a request to cancel an auto-acceleration in the <code>tracking</code> status.<br>You can retrieve eligible auto-acceleration <code>txid</code> using the history endpoint GET <code>/api/v1/services/accelerator/auto-accelerate/history</code>.</p>'
},
urlString: '/v1/services/accelerator/auto-accelerate/cancel',
showConditions: [''],
showJsExamples: showJsExamplesDefaultFalse,
codeExample: {
default: {
codeTemplate: {
curl: `%{1}" "[[hostname]][[baseNetworkUrl]]/api/v1/services/accelerator/auto-accelerate/cancel`, //custom interpolation technique handled in replaceCurlPlaceholder()
commonJS: ``,
esModule: ``
},
codeSampleMainnet: {
esModule: [],
commonJS: [],
curl: ['txid=178b5b9b310f0d667d7ea563a2cdcc17bc8cd15261b58b1653860a724ca83458'],
headers: 'X-Mempool-Auth: stacksats',
response: `HTTP/1.1 200 OK`,
},
}
}
},
];
export const faqData = [

View file

@ -3,7 +3,7 @@
<div class="header">
<div class="logo-container">
<app-svg-images name="officialMempoolSpace" viewBox="0 0 125 126"></app-svg-images>
<app-svg-images name="mempoolSquare" viewBox="0 0 125 126"></app-svg-images>
</div>
<h1>The Mempool Open Source Project</h1>
</div>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff