Skip to content

fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins#2563

Merged
shamardy merged 6 commits intodevfrom
bugfix/2048-unexpected-end-error
Aug 4, 2025
Merged

fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins#2563
shamardy merged 6 commits intodevfrom
bugfix/2048-unexpected-end-error

Conversation

@shamardy
Copy link
Collaborator

Resolves #2048

This pull request addresses a critical UnexpectedEnd error that caused swap failures for several UTXO-based coins, including Namecoin (NMC), Cheetahcoin (CHTA), and eCash (XEC).

The Problem

The root cause was an overly broad conditional logic within the BlockHeader::deserialize function. This single function attempted to parse multiple different block header formats using if conditions based on the block version number. This led to two primary failure modes:

1. Incorrect KAWPOW Parsing

Coins like CHTA use the same version number as Ravencoin (0x30000000) for their KAWPOW implementation but do not include the extra header fields (n_height, n_nonce_u64, mix_hash) that RVN does. The deserializer was incorrectly attempting to read these non-existent fields for CHTA, causing a stream read to fail with UnexpectedEnd.

2. Brittle AuxPow Detection

The logic for detecting Auxiliary Proof-of-Work (AuxPow) headers relied on a hardcoded list of exact version numbers. The correct method is to check for a specific bit flag (1 << 8) in the version field, as the base version can change. This made the check fragile and prone to failure if a block with a different base version but an active AuxPow flag was encountered.

The Solution

This patch refactors the deserialization logic to be more precise and robust:

1. Specialized KAWPOW Logic

  • A new CoinVariant::RVN has been added in mm2src/mm2_bitcoin/serialization/src/reader.rs
  • The deserialization logic in mm2src/mm2_bitcoin/chain/src/block_header.rs now explicitly checks reader.coin_variant().is_rvn() before attempting to parse RVN-specific header fields
  • This ensures that other coins using the KAWPOW version number are not parsed incorrectly

2. Correct AuxPow Detection

  • The check for AuxPow headers has been changed from a hardcoded matches! macro to the correct bitmask check: (version & AUXPOW_VERSION_FLAG) != 0
  • This aligns with the merged mining specification and correctly identifies all AuxPow-enabled blocks

3. Added Debug Utility Test

  • A new, ignored test, test_scan_and_deserialize_block_headers, has been added to mm2src/coins/utxo/utxo_tests.rs
  • This powerful utility allows developers to quickly scan the blockchain of any UTXO coin to pinpoint the exact block height where deserialization fails
  • This will significantly speed up debugging similar issues in the future

Impact

These changes resolve the swap failures for the affected coins and make the UTXO header deserialization logic significantly more robust and maintainable.

shamardy added 3 commits July 31, 2025 14:21
… coins

Swaps for coins like NMC, CHTA, and XEC were failing with an
`UnexpectedEnd` error during MTP steps. This was due to
overly broad conditional logic in `BlockHeader::deserialize` which
misinterpreted block header structures based on version numbers.

This commit corrects the logic in two ways:

1.  The check for AuxPow headers is changed from a hardcoded list of
    versions to the correct bitmask check (`version & (1 << 8)`). This
    is the proper way to detect AuxPow and makes the logic robust against
    base version changes.

2.  KAWPOW header parsing is now specialized to apply only to Ravencoin.
    A `CoinVariant::RVN` is introduced, and the deserializer now checks
    for this variant before attempting to read RVN-specific fields. This
    prevents conflicts with other coins (like CHTA) that use the same
    version number but have a different header structure.

A utility test for scanning and debugging block headers has also been
added to assist with future diagnostics.
@shamardy shamardy marked this pull request as ready for review July 31, 2025 11:32
@mariocynicys mariocynicys self-requested a review July 31, 2025 15:35
@smk762 smk762 requested a review from cipig August 1, 2025 04:09
- In `utxo_tests.rs`:
  - Remove an unreachable `break` condition from the header scanning loop.
  - Reformat the panic message in the `test_scan_and_deserialize_block_headers` utility to improve terminal readability by reordering and removing extra indentation.

- In `block_header.rs`:
  - Add parentheses to a conditional in the `BlockHeader` deserialization logic to enhance code clarity and consistency.
@shamardy
Copy link
Collaborator Author

shamardy commented Aug 2, 2025

@mariocynicys all your review comments have been addressed :)

mariocynicys
mariocynicys previously approved these changes Aug 2, 2025
Copy link
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks

@shamardy shamardy merged commit c93adea into dev Aug 4, 2025
18 of 24 checks passed
@shamardy shamardy deleted the bugfix/2048-unexpected-end-error branch August 4, 2025 13:04
dimxy pushed a commit that referenced this pull request Aug 4, 2025
* dev:
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563)
@cipig
Copy link

cipig commented Aug 4, 2025

i got an "UnexpectedEnd" error when i called recover_funds_of_swap on this swap on maker:

{
   "error_events" : [
      "StartFailed",
      "NegotiateFailed",
      "TakerFeeValidateFailed",
      "MakerPaymentTransactionFailed",
      "MakerPaymentDataSendFailed",
      "MakerPaymentWaitConfirmFailed",
      "TakerPaymentValidateFailed",
      "TakerPaymentWaitConfirmFailed",
      "TakerPaymentSpendFailed",
      "TakerPaymentSpendConfirmFailed",
      "MakerPaymentWaitRefundStarted",
      "MakerPaymentRefundStarted",
      "MakerPaymentRefunded",
      "MakerPaymentRefundFailed",
      "MakerPaymentRefundFinished"
   ],
   "events" : [
      {
         "event" : {
            "data" : {
               "lock_duration" : 7800,
               "maker_amount" : "0.0007",
               "maker_coin" : "PIVX",
               "maker_coin_htlc_pubkey" : "0315d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732",
               "maker_coin_start_block" : 4903981,
               "maker_payment_confirmations" : 5,
               "maker_payment_lock" : 1747549945,
               "maker_payment_requires_nota" : false,
               "maker_payment_trade_fee" : {
                  "amount" : "0.001",
                  "coin" : "PIVX",
                  "paid_from_trading_vol" : false
               },
               "my_persistent_pub" : "0315d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732",
               "p2p_privkey" : null,
               "secret" : "c8a43ef5478519895e8affdde0ec99e9c3a0ef6ab9ceb7324d72863c21c4b02c",
               "secret_hash" : "cd9e7193fbf9b6d75ae7b3026f394f55dd6f4b6c",
               "started_at" : 1747534345,
               "taker" : "a27ba503d8d87636f289090f536d6c724ae76b16861e4241e07131fc52ab4025",
               "taker_amount" : "0.00081667875464",
               "taker_coin" : "KMD",
               "taker_coin_htlc_pubkey" : "0315d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732",
               "taker_coin_start_block" : 4441578,
               "taker_payment_confirmations" : 3,
               "taker_payment_requires_nota" : false,
               "taker_payment_spend_trade_fee" : {
                  "amount" : "0.00001",
                  "coin" : "KMD",
                  "paid_from_trading_vol" : true
               },
               "uuid" : "be42d8c0-127c-4df5-800b-4de8318e1bf5"
            },
            "type" : "Started"
         },
         "timestamp" : 1747534345973
      },
      {
         "event" : {
            "data" : {
               "maker_coin_htlc_pubkey" : "03a27ba503d8d87636f289090f536d6c724ae76b16861e4241e07131fc52ab4025",
               "maker_coin_swap_contract_addr" : null,
               "taker_coin_htlc_pubkey" : "03a27ba503d8d87636f289090f536d6c724ae76b16861e4241e07131fc52ab4025",
               "taker_coin_swap_contract_addr" : null,
               "taker_payment_locktime" : 1747542145,
               "taker_pubkey" : "000000000000000000000000000000000000000000000000000000000000000000"
            },
            "type" : "Negotiated"
         },
         "timestamp" : 1747534361977
      },
      {
         "event" : {
            "data" : null,
            "type" : "MakerPaymentInstructionsReceived"
         },
         "timestamp" : 1747534363986
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "2c46c0cde1777107c58af82dc4e67ad6309589ac5226a932989412905ef996c7",
               "tx_hex" : "0400008085202f8901160660cb900ba86531faed0545967b1e61b35b8d942b1fb5ff67f15887c7af68020000006a473044022060e535195b3349aa0dcd951b5531dc44c9d6e31ac1461228d4d592585eea8e8602201d1f824c280853cdf02189c0f5e63837d9742f6d705b16b93bddc4a43e389788012103a27ba503d8d87636f289090f536d6c724ae76b16861e4241e07131fc52ab4025ffffffff02e8030000000000001976a914ca1e04745e8ca0c60d8c5881531d51bec470743f88accc8a5a08000000001976a914ae0200524d21d348b479b30e7b93d72451fdc55688ac193a2968000000000000000000000000000000"
            },
            "type" : "TakerFeeValidated"
         },
         "timestamp" : 1747534363987
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "90e5e1199e20a5116409907756b1a6f90dcfb852fc9dced0989edfe5c5b646a2",
               "tx_hex" : "0100000001041f6dc7ec3064ff6ed5239aa979efb9866dce9693266a4321003a4f5e61c69e020000006a47304402203f9e6e763473cdd06a4a0851036f3be9cb05a6ae13e886387a62553136725ee502201edff1dccc307c848afcac493a4526c0807874120a41ad6d0feb8ba97c968e3401210315d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732ffffffff03701101000000000017a914a07d020c701d6a1f4ae33a92804725a19c3dbbf1870000000000000000166a14cd9e7193fbf9b6d75ae7b3026f394f55dd6f4b6c61e06b7c110000001976a9141462c3dd3f936d595c9af55978003b27c250441f88ac1c422968"
            },
            "type" : "MakerPaymentSent"
         },
         "timestamp" : 1747534364111
      },
      {
         "event" : {
            "data" : {
               "tx_hash" : "44d8f4c0c12ca83d81a4c1a57a29371d245857e964f0d197023a2e637c4d62cf",
               "tx_hex" : "0400008085202f8901c796f95e9012949832a92652ac899530d67ae6c42df88ac5077177e1cdc0462c010000006a47304402205fc888cc95d53c649712c24d18be626e752c01fc3c5a350dc3deab101845eecf02205d3b6cbd7c1d6143d4f8c9975a28a5a1ad46be611c0b7e18f89c017227aa1f68012103a27ba503d8d87636f289090f536d6c724ae76b16861e4241e07131fc52ab4025ffffffff03033f01000000000017a914c61e4c6c0ee6faa4ccdfff6c937a3e8d487fc736870000000000000000166a14cd9e7193fbf9b6d75ae7b3026f394f55dd6f4b6ce1475908000000001976a914ae0200524d21d348b479b30e7b93d72451fdc55688acc93b2968000000000000000000000000000000"
            },
            "type" : "TakerPaymentReceived"
         },
         "timestamp" : 1747534800903
      },
      {
         "event" : {
            "type" : "TakerPaymentWaitConfirmStarted"
         },
         "timestamp" : 1747534800903
      },
      {
         "event" : {
            "data" : {
               "error" : "maker_swap:1063] !taker_coin.wait_for_confirmations: rpc_clients:139] Tx 44d8f4c0c12ca83d81a4c1a57a29371d245857e964f0d197023a2e637c4d62cf was not found on chain after 10 tries, error: client:909] JsonRpcError { client_info: \"coin: KMD\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: 8958571, method: \"blockchain.transaction.get\", params: [String(\"44d8f4c0c12ca83d81a4c1a57a29371d245857e964f0d197023a2e637c4d62cf\"), Bool(true)] }, error: Response(electrum1.cipig.net:10001, Object({\"code\": Number(2), \"message\": String(\"daemon error: DaemonError({'code': -5, 'message': 'No information available about transaction'})\")})) }"
            },
            "type" : "TakerPaymentWaitConfirmFailed"
         },
         "timestamp" : 1747537487087
      },
      {
         "event" : {
            "data" : {
               "wait_until" : 1747553645
            },
            "type" : "MakerPaymentWaitRefundStarted"
         },
         "timestamp" : 1747537487089
      },
      {
         "event" : {
            "type" : "MakerPaymentRefundStarted"
         },
         "timestamp" : 1747537487090
      },
      {
         "event" : {
            "data" : {
               "error" : "maker_swap:1315] !maker_coin.send_maker_refunds_payment: utxo_common:1958] HTLC spend fee 100000 is greater than transaction output 70000"
            },
            "type" : "MakerPaymentRefundFailed"
         },
         "timestamp" : 1747550467167
      },
      {
         "event" : {
            "type" : "Finished"
         },
         "timestamp" : 1747550467172
      }
   ],
   "gui" : "mympm",
   "maker_amount" : "0.0007",
   "maker_coin" : "PIVX",
   "maker_coin_usd_price" : null,
   "mm_version" : "2.4.0-beta_f56917b",
   "my_order_uuid" : "f98ab227-29c9-4574-a5f9-528e0ddd5b45",
   "success_events" : [
      "Started",
      "Negotiated",
      "MakerPaymentInstructionsReceived",
      "TakerFeeValidated",
      "MakerPaymentSent",
      "TakerPaymentReceived",
      "TakerPaymentWaitConfirmStarted",
      "TakerPaymentValidatedAndConfirmed",
      "TakerPaymentSpent",
      "TakerPaymentSpendConfirmStarted",
      "TakerPaymentSpendConfirmed",
      "Finished"
   ],
   "taker_amount" : "0.00081667875464",
   "taker_coin" : "KMD",
   "taker_coin_usd_price" : null,
   "type" : "Maker",
   "uuid" : "be42d8c0-127c-4df5-800b-4de8318e1bf5"
}

the error message is simply "error" : "rpc:198] RPC call failed: lp_swap:1519] saved_swap:130] maker_swap:1698] utxo_standard:453] client:1117] UnexpectedEnd" ... the log shows the same

idk if that is the same as what the PR fixes or not
anyway, coin was PIVX and it wouldn't make sense to try recover anyway since the initial error on refund was maker_swap:1315] !maker_coin.send_maker_refunds_payment: utxo_common:1958] HTLC spend fee 100000 is greater than transaction output 70000, so will be the same this time

@shamardy
Copy link
Collaborator Author

shamardy commented Aug 4, 2025

idk if that is the same as what the PR fixes or not

The UnexpectedEnd can happen for other coins, this PR fixed Namecoin (NMC), Cheetahcoin (CHTA), and eCash (XEC) that were specifically mentioned in the issue and maybe some others. UnexpectedEnd is basically problems in block headers deserializations, now I have a utility test that can uncover the reason (the bad block) quickly. I will copy this #2563 (comment) to the original issue.

dimxy pushed a commit that referenced this pull request Aug 12, 2025
* dev:
  chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581)
  fix(utxo): deserialize sapling root for PIVX block headers (#2572)
  improvement(dep-stack): security bumps (#2562)
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563)
dimxy pushed a commit that referenced this pull request Aug 12, 2025
* dev:
  chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581)
  fix(utxo): deserialize sapling root for PIVX block headers (#2572)
  improvement(dep-stack): security bumps (#2562)
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563)

# Conflicts:
#	mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
dimxy pushed a commit that referenced this pull request Aug 13, 2025
* dev:
  fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (#2580)
  fix(clippy): fix clippy warnings for #2565 (#2589)
  fix(Trezor): fix utxo and eth calls due to firmware changes (#2565)
  fix(utxo): calculate min_trading_vol based on fixed tx fees (#2564)
  feat(protocol): [0] solana support (#2586)
  fix(utxo): fix header deserialization; guard AuxPoW (#2583)
  chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581)
  fix(utxo): deserialize sapling root for PIVX block headers (#2572)
  improvement(dep-stack): security bumps (#2562)
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563)
dimxy pushed a commit that referenced this pull request Aug 15, 2025
* dev: (24 commits)
  fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (#2580)
  fix(clippy): fix clippy warnings for #2565 (#2589)
  fix(Trezor): fix utxo and eth calls due to firmware changes (#2565)
  fix(utxo): calculate min_trading_vol based on fixed tx fees (#2564)
  feat(protocol): [0] solana support (#2586)
  fix(utxo): fix header deserialization; guard AuxPoW (#2583)
  chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581)
  fix(utxo): deserialize sapling root for PIVX block headers (#2572)
  improvement(dep-stack): security bumps (#2562)
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563)
  feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (#2499)
  feat(utxo): add new fixed txfee option for DINGO-like coins (#2454)
  ci(pull-requests): review notification bot (#2468)
  improvement(walletconnect): return the `pairing_topic` in `new_connection` response (#2538)
  bless clippy (#2560)
  refactor(toolchain): use latest available stable compiler (#2557)
  feat(wallet): implement unified offline private key export API (#2542)
  improve note for docker test start failure (#2550)
  fix(DOCS): add note for macos to fix docker containers startup failure (#2544)
  refactor(toolchain): general stabilization for stable rust (#2528)
  ...

# Conflicts:
#	mm2src/coins/eth.rs
#	mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs
#	mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs
#	mm2src/coins/eth/eth_tests.rs
#	mm2src/coins/eth/eth_withdraw.rs
#	mm2src/coins/eth/v2_activation.rs
#	mm2src/coins/nft.rs
#	mm2src/coins/qrc20.rs
#	mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs
#	mm2src/mm2_main/src/rpc/lp_commands/one_inch/rpcs.rs
#	mm2src/mm2_main/src/rpc/lp_commands/tokens.rs
#	mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
dimxy pushed a commit that referenced this pull request Aug 19, 2025
* dev:
  improvement(`static mut`s): `static mut` removal (#2590)
  fix(orders): set subscription on kickstart and skip GC of own pubkeys (#2597)
  fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (#2580)
  fix(clippy): fix clippy warnings for #2565 (#2589)
  fix(Trezor): fix utxo and eth calls due to firmware changes (#2565)
  fix(utxo): calculate min_trading_vol based on fixed tx fees (#2564)
  feat(protocol): [0] solana support (#2586)
  fix(utxo): fix header deserialization; guard AuxPoW (#2583)
  chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (#2581)
  fix(utxo): deserialize sapling root for PIVX block headers (#2572)
  improvement(dep-stack): security bumps (#2562)
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (#2563)
  feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (#2499)
  feat(utxo): add new fixed txfee option for DINGO-like coins (#2454)
  ci(pull-requests): review notification bot (#2468)
  improvement(walletconnect): return the `pairing_topic` in `new_connection` response (#2538)
  bless clippy (#2560)
  refactor(toolchain): use latest available stable compiler (#2557)
  feat(wallet): implement unified offline private key export API (#2542)
  chore(release): v2.3.0-beta (#2284)

# Conflicts:
#	mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Aug 21, 2025
* dev: (28 commits)
  fix build script failing to find .git/HEAD (GLEECBTC#2601)
  refactor(EVM): rename fn, fix timeouts, add activation req validation (GLEECBTC#2543)
  improvement(`static mut`s): `static mut` removal (GLEECBTC#2590)
  fix(orders): set subscription on kickstart and skip GC of own pubkeys (GLEECBTC#2597)
  fix(ordermatch): ignore loop-back; clear on null root; reject stale keep-alives (GLEECBTC#2580)
  fix(clippy): fix clippy warnings for GLEECBTC#2565 (GLEECBTC#2589)
  fix(Trezor): fix utxo and eth calls due to firmware changes (GLEECBTC#2565)
  fix(utxo): calculate min_trading_vol based on fixed tx fees (GLEECBTC#2564)
  feat(protocol): [0] solana support (GLEECBTC#2586)
  fix(utxo): fix header deserialization; guard AuxPoW (GLEECBTC#2583)
  chore(rust 1.89): make CI clippy/fmt pass (wasm32, all-targets) (GLEECBTC#2581)
  fix(utxo): deserialize sapling root for PIVX block headers (GLEECBTC#2572)
  improvement(dep-stack): security bumps (GLEECBTC#2562)
  fix(utxo): correct block header deserialization for AuxPow and KAWPOW coins (GLEECBTC#2563)
  feat(wallet-connect): impl BTC (UTxO) activation via WalletConnect (GLEECBTC#2499)
  feat(utxo): add new fixed txfee option for DINGO-like coins (GLEECBTC#2454)
  ci(pull-requests): review notification bot (GLEECBTC#2468)
  improvement(walletconnect): return the `pairing_topic` in `new_connection` response (GLEECBTC#2538)
  bless clippy (GLEECBTC#2560)
  refactor(toolchain): use latest available stable compiler (GLEECBTC#2557)
  ...

# Conflicts:
#	mm2src/coins/eth.rs
#	mm2src/coins/eth/eth_rpc.rs
#	mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs
#	mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs
#	mm2src/coins/eth/eth_withdraw.rs
#	mm2src/coins/eth/v2_activation.rs
#	mm2src/coins/lightning.rs
#	mm2src/coins/lp_coins.rs
#	mm2src/coins/nft.rs
#	mm2src/coins/qrc20.rs
#	mm2src/coins/siacoin.rs
#	mm2src/coins/tendermint/tendermint_token.rs
#	mm2src/coins/test_coin.rs
#	mm2src/coins/utxo/bch.rs
#	mm2src/coins/utxo/qtum.rs
#	mm2src/coins/utxo/slp.rs
#	mm2src/coins/utxo/utxo_standard.rs
#	mm2src/coins/z_coin.rs
#	mm2src/coins_activation/src/bch_with_tokens_activation.rs
#	mm2src/coins_activation/src/erc20_token_activation.rs
#	mm2src/coins_activation/src/eth_with_token_activation.rs
#	mm2src/coins_activation/src/init_erc20_token_activation.rs
#	mm2src/coins_activation/src/init_token.rs
#	mm2src/coins_activation/src/platform_coin_with_tokens.rs
#	mm2src/coins_activation/src/slp_token_activation.rs
#	mm2src/coins_activation/src/tendermint_with_assets_activation.rs
#	mm2src/coins_activation/src/token.rs
#	mm2src/mm2_main/src/lp_swap.rs
#	mm2src/mm2_main/src/lp_swap/check_balance.rs
#	mm2src/mm2_main/src/lp_swap/maker_swap.rs
#	mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs
#	mm2src/mm2_main/src/lp_swap/swap_v2_rpcs.rs
#	mm2src/mm2_main/src/lp_swap/taker_swap.rs
#	mm2src/mm2_main/src/lp_swap/trade_preimage.rs
#	mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs
#	mm2src/mm2_main/src/rpc/lp_commands/legacy.rs
#	mm2src/mm2_main/src/rpc/lp_commands/lr_swap.rs
#	mm2src/mm2_main/src/rpc/lp_commands/lr_swap/lr_impl.rs
#	mm2src/mm2_main/src/rpc/lp_commands/one_inch/errors.rs
#	mm2src/mm2_main/src/rpc/lp_commands/one_inch/rpcs.rs
#	mm2src/mm2_main/src/rpc/lp_commands/tokens.rs
#	mm2src/mm2_main/tests/docker_tests/docker_tests_common.rs
#	mm2src/mm2_main/tests/docker_tests/docker_tests_inner.rs
#	mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
#	mm2src/mm2_main/tests/integration_tests_common/mod.rs
#	mm2src/trading_api/src/one_inch_api/client.rs
dimxy pushed a commit that referenced this pull request Oct 15, 2025
… coins (#2563)

This commit fixes the `UnexpectedEnd` error that caused swap failures for several UTXO-based coins, including Namecoin (NMC), Cheetahcoin (CHTA), and eCash (XEC). It also adds `test_scan_and_deserialize_block_headers` as a utility ignored test to debug similar deserialization errors in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants