From b3fda0bfac598e31ff69f435018b87ec586b6255 Mon Sep 17 00:00:00 2001 From: jolestar Date: Tue, 24 Sep 2024 13:38:18 +0800 Subject: [PATCH] [bitcoin] temporary pause the ordinals protocol (#2679) --- frameworks/bitcoin-move/doc/bitcoin.md | 9 +++++++ frameworks/bitcoin-move/sources/bitcoin.move | 25 ++++++++++++-------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/frameworks/bitcoin-move/doc/bitcoin.md b/frameworks/bitcoin-move/doc/bitcoin.md index e5f8e01ae3..9023f4126a 100644 --- a/frameworks/bitcoin-move/doc/bitcoin.md +++ b/frameworks/bitcoin-move/doc/bitcoin.md @@ -139,6 +139,15 @@ The reorg is too deep, we need to stop the system and fix the issue + + + + +
const ORDINAL_PAUSE_HEIGHT: u64 = 861150;
+
+ + + ## Function `genesis_init` diff --git a/frameworks/bitcoin-move/sources/bitcoin.move b/frameworks/bitcoin-move/sources/bitcoin.move index b01812c6bf..563f58b91b 100644 --- a/frameworks/bitcoin-move/sources/bitcoin.move +++ b/frameworks/bitcoin-move/sources/bitcoin.move @@ -37,6 +37,8 @@ module bitcoin_move::bitcoin{ /// https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki const BIP_34_HEIGHT:u64 = 227835; + const ORDINALS_PAUSE_HEIGHT:u64 = 861150; + struct UTXONotExistsEvent has copy, drop{ outpoint: OutPoint, } @@ -162,16 +164,19 @@ module bitcoin_move::bitcoin{ idx = idx + 1; }; - - let seal_outs = bitcoin_move::inscription_updater::process_tx(pending_block, tx, &mut input_utxos); - let seal_outs_len = vector::length(&seal_outs); - if (seal_outs_len > 0) { - let seal_out_idx = 0; - while (seal_out_idx < seal_outs_len) { - let seal_out = vector::pop_back(&mut seal_outs); - let (output_index, utxo_seal) = utxo::unpack_seal_out(seal_out); - simple_multimap::add(&mut output_seals, output_index, utxo_seal); - seal_out_idx = seal_out_idx + 1; + //temporary pause the ordinals process for the performance reason + let skip_ordinals = block_height >= ORDINALS_PAUSE_HEIGHT && network::is_mainnet() && rooch_framework::chain_id::is_main(); + if(!skip_ordinals){ + let seal_outs = bitcoin_move::inscription_updater::process_tx(pending_block, tx, &mut input_utxos); + let seal_outs_len = vector::length(&seal_outs); + if (seal_outs_len > 0) { + let seal_out_idx = 0; + while (seal_out_idx < seal_outs_len) { + let seal_out = vector::pop_back(&mut seal_outs); + let (output_index, utxo_seal) = utxo::unpack_seal_out(seal_out); + simple_multimap::add(&mut output_seals, output_index, utxo_seal); + seal_out_idx = seal_out_idx + 1; + }; }; };