chore: Upgrade bitcoin to version 0.32.2
Upgrade bitcoin library to version 0.32.2. Notable changes are:
- A number of types now use new type instead of primitive types like u32.
U256is no longer exported from bitcoin, and insteadprimitive-types::U256is used when it is needed.- Because of changes to
Addresstype, we have to useassume_checkedwhen it is needed. - Dependency on
getrandom(due tosecp256k1dependency) now requirescustomflag to be used. - Some other miscellaneous type and name changes.
canbench 🏋 (dir: .)
Significant performance change detected! ⚠️
./canbench_results.yml is up to date ✅
~/work/bitcoin-canister/bitcoin-canister/scripts ~/work/bitcoin-canister/bitcoin-canister
~/work/bitcoin-canister/bitcoin-canister
---------------------------------------------------
Benchmark: insert_300_blocks
total:
instructions: 567.85 M (1.08%) (change within noise threshold)
heap_increase: 7 pages (regressed by 16.67%)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: get_metrics
total:
instructions: 93.35 M (regressed by 7.30%)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: insert_block_headers
total:
instructions: 3.91 B (0.44%) (change within noise threshold)
heap_increase: 1 pages (improved by 50.00%)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: insert_block_headers_multiple_times
total:
instructions: 13.98 B (0.56%) (change within noise threshold)
heap_increase: 7 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
Benchmark: pre_upgrade_with_many_unstable_blocks
total:
instructions: 5.80 B (-0.25%) (change within noise threshold)
heap_increase: 4097 pages (no change)
stable_memory_increase: 1792 pages (no change)
serialize_blocktree (scope):
instructions: 2.37 B (-0.64%) (change within noise threshold)
heap_increase: 2048 pages (no change)
stable_memory_increase: 0 pages (no change)
serialize_blocktree_flatten (scope):
instructions: 201.60 K (no change)
heap_increase: 0 pages (no change)
stable_memory_increase: 0 pages (no change)
serialize_blocktree_serialize_seq (scope):
instructions: 2.37 B (-0.64%) (change within noise threshold)
heap_increase: 2048 pages (no change)
stable_memory_increase: 0 pages (no change)
---------------------------------------------------
As I mentioned on Slack, I'm not sure why we're doing this upgrade. AFAICT it's bringing risk with no particular gain.
As I mentioned on Slack, I'm not sure why we're doing this upgrade. AFAICT it's bringing risk with no particular gain.
Yes, perfectly understood. I made the PR just in case it may become useful in the future should an upgrade is needed. In general, library maintainers could bring bug fixes, enhancements or new features, so we probably don't want to be left behind for too long. The rust library for bitcoin has a changelog that may be useful.
As I mentioned on Slack, I'm not sure why we're doing this upgrade. AFAICT it's bringing risk with no particular gain.
Yes, perfectly understood. I made the PR just in case it may become useful in the future should an upgrade is needed. In general, library maintainers could bring bug fixes, enhancements or new features, so we probably don't want to be left behind for too long. The rust library for bitcoin has a changelog that may be useful.
I see, thanks @ninegua! In that case, would it make sense to mark it as a draft, and the team can take a closer look whenever they have the bandwidth to test this upgrade? I don't the team has the resources to do this soon.
thanks @ninegua , the NET will definitely benefit from this upgrade
FYI: #349 upgraded bitcoin crate to 0.32.4.