bitcoin-canister icon indicating copy to clipboard operation
bitcoin-canister copied to clipboard

feat(watchdog)!: add `health_status_v2` endpoint

Open mducroux opened this issue 1 month ago • 1 comments

DEFI-2494

The following commit introduced an unexpected breaking change on the health_status endpoint: https://github.com/dfinity/bitcoin-canister/commit/2e9d8929996592182003a03244e1adf065273e90 . This is because new Dogecoin providers were added to the bitcoin_block_api enum.

This PR reverts the addition of Dogecoin providers in the bitcoin_block_api enum and introduces a new health_status_v2 endpoint to the canister which enabled adding new explorers in the future without introducing breaking changes to the health_status_v2 endpoint.

This PR ensures that no breaking changes are introduced to the health_status endpoint compared to the version of the Watchdog canister that is currently running in production.

However, this PR introduces a breaking change in the config endpoint by changing the type of the explorer field from bitcoin_block_api to text, which is acceptable since it is a debug endpoint.

mducroux avatar Nov 28 '25 12:11 mducroux

canbench 🏋 (dir: .) f50de497e5d6ca642b696207c2656be2238c6766 2025-11-28 13:41:02 UTC

./canbench_results.yml is up to date 📦 canbench_results_benchmark.csv available in artifacts

~/work/bitcoin-canister/bitcoin-canister/scripts ~/work/bitcoin-canister/bitcoin-canister
~/work/bitcoin-canister/bitcoin-canister
---------------------------------------------------

Benchmark: insert_300_blocks
  total:
    instructions: 418.06 M (0.01%) (change within noise threshold)
    heap_increase: 12 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate (scope):
    calls: 300 (no change)
    instructions: 368.06 M (0.00%) (change within noise threshold)
    heap_increase: 3 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block (scope):
    calls: 300 (no change)
    instructions: 18.30 M (0.00%) (change within noise threshold)
    heap_increase: 1 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block/check_merkle_root (scope):
    calls: 300 (no change)
    instructions: 8.00 M (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block/ensure_unique_transactions (scope):
    calls: 300 (no change)
    instructions: 8.47 M (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_header (scope):
    calls: 300 (no change)
    instructions: 348.64 M (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: get_metrics
  total:
    instructions: 8.20 M (0.96%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: insert_block_headers
  total:
    instructions: 2.85 B (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_header (scope):
    calls: 100 (no change)
    instructions: 2.81 B (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: insert_block_headers_multiple_times
  total:
    instructions: 10.30 B (0.00%) (change within noise threshold)
    heap_increase: 7 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_header (scope):
    calls: 1000 (no change)
    instructions: 8.99 B (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: insert_block_with_10k_transactions
  total:
    instructions: 1.38 B (0.08%) (change within noise threshold)
    heap_increase: 73 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate (scope):
    calls: 1 (no change)
    instructions: 149.61 M (0.00%) (change within noise threshold)
    heap_increase: 20 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block (scope):
    calls: 1 (no change)
    instructions: 149.50 M (no change)
    heap_increase: 20 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block/check_merkle_root (scope):
    calls: 1 (no change)
    instructions: 70.70 M (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block/ensure_unique_transactions (scope):
    calls: 1 (no change)
    instructions: 78.80 M (no change)
    heap_increase: 20 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_header (scope):
    calls: 1 (no change)
    instructions: 102.96 K (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: insert_block_with_1k_transactions
  total:
    instructions: 114.35 M (0.09%) (change within noise threshold)
    heap_increase: 7 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate (scope):
    calls: 1 (no change)
    instructions: 15.14 M (0.00%) (change within noise threshold)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block (scope):
    calls: 1 (no change)
    instructions: 15.03 M (no change)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block/check_merkle_root (scope):
    calls: 1 (no change)
    instructions: 7.12 M (no change)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_block/ensure_unique_transactions (scope):
    calls: 1 (no change)
    instructions: 7.91 M (no change)
    heap_increase: 2 pages (no change)
    stable_memory_increase: 0 pages (no change)

  validate_header (scope):
    calls: 1 (no change)
    instructions: 102.96 K (0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Benchmark: pre_upgrade_with_many_unstable_blocks
  total:
    instructions: 5.36 B (-0.18%) (change within noise threshold)
    heap_increase: 4088 pages (no change)
    stable_memory_increase: 1792 pages (no change)

  serialize_blocktree_flatten (scope):
    calls: 1 (no change)
    instructions: 188.08 K (1.62%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

  serialize_blocktree_serialize_seq (scope):
    calls: 1 (no change)
    instructions: 1.93 B (-0.56%) (change within noise threshold)
    heap_increase: 2039 pages (no change)
    stable_memory_increase: 0 pages (no change)

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 7 | regressed 0 | improved 0 | new 0 | unchanged 7]
    change:   [max +1.04M | p75 +91.01K | median +23.84K | p25 +548 | min -9.57M]
    change %: [max +0.96% | p75 +0.08% | median 0.01% | p25 0.00% | min -0.18%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 7 | regressed 0 | improved 0 | new 0 | unchanged 7]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 7 | regressed 0 | improved 0 | new 0 | unchanged 7]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

github-actions[bot] avatar Nov 28 '25 13:11 github-actions[bot]