-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stacks block commitments incorrectly assign change outputs as pox transfers #496
Comments
Thanks @aulneau, we're looking into this. |
Unfortunately I do not have a bitcoin node set up -- I'm using the hiro platform for any bitcoin specific predicates |
@aulneau @lgalabru I've deployed this fix to our dev infrastructure. I made this predicate: {
"name": "Test Block Commitment Fix",
"uuid": "08652ee3-733d-4a27-9442-09b0f142b501",
"chain": "bitcoin",
"version": 1,
"networks": {
"mainnet": {
"if_this": { "scope": "stacks_protocol", "operation": "block_committed" },
"end_block": 829848,
"then_that": {
"http_post": {
"url": "...",
"authorization_header": ""
}
},
"start_block": 829847,
"include_proof": false,
"include_inputs": true,
"include_outputs": true,
"include_witness": false,
"expire_after_occurrence": null
}
}
}
and got this output for the block commitment: "stacks_operations": [
{
"block_committed": {
"block_hash": "0x5b7e468df57b9d0208b67ffd3bc145a48e200270afb94fc8b11d910760276a01",
"mining_address_post_commit": "1UiW61F9xnBnnC1J69aPJhFm3ZXvZEkCm",
"mining_sats_left": 626173985,
"pox_cycle_index": 74,
"pox_cycle_length": 2200,
"pox_cycle_position": 997,
"pox_sats_burnt": 501000,
"pox_sats_transferred": []
}
}
] We should have this fix pushed to the platform on the next release! |
### Description Fixes #496 ### Checklist - [X] All tests pass - [ ] Tests added in this PR (if applicable)
### Description Fixes #496 ### Checklist - [X] All tests pass - [ ] Tests added in this PR (if applicable)
🎉 This issue has been resolved in version 1.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [1.3.1](hirosystems/chainhook@v1.3.0...v1.3.1) (2024-02-14) ### Bug Fixes * add event index to transaction events ([#495](hirosystems/chainhook#495)) ([2d2760d](hirosystems/chainhook@2d2760d)), closes [#417](hirosystems/chainhook#417) [#387](hirosystems/chainhook#387) * correctly determine PoX vs PoB block commitments ([#499](hirosystems/chainhook#499)) ([6816e76](hirosystems/chainhook@6816e76)), closes [#496](hirosystems/chainhook#496)
Describe the bug
For the block commitments predicate, burn related pox blocks are incorrectly assigning change outputs as pox transfer events:
Here is the entire output for a block commitment event for block 829847, and the related transaction: https://mempool.space/tx/151bc0d6ced51f3f7675f0caa60769543f2ec5962f0fe271c14b8c5feca466cf
https://gist.github.com/aulneau/f612837d61cbcc8e12d6d0a4c9ef8c63
seems possible this condition is incorrect:
chainhook/components/chainhook-sdk/src/indexer/bitcoin/mod.rs
Line 514 in 489b014
or maybe this logic?
chainhook/components/chainhook-sdk/src/indexer/bitcoin/mod.rs
Lines 551 to 557 in 489b014
The text was updated successfully, but these errors were encountered: