-
Notifications
You must be signed in to change notification settings - Fork 21
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
[FINAL] Adding an endpoint to fetch bitcoin block headers #298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM, leaving final approval from execution to @dsarlis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving on behalf of execution. The API seems reasonable to me and the experimental marker allows us to tweak things if needed in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please synchronize merging with implementation effort.
As stated in [here](dfinity/interface-spec#298), candid interface should look as: ``` type bitcoin_block_header = blob; type get_block_headers_request = record { start_height : nat32; end_height: opt nat32; }; type get_block_headers_result = record { tip_height: nat32; block_headers: vec bitcoin_block_header; }; bitcoin_get_block_headers : (get_block_headers_request) -> (get_block_headers_response); ``` This PR will add no-op endpoint for returning the block headers in the [follow-up](#298) we will implement specified function.
This PR implements `get_block_headers` endpoint as stated in dfinity/interface-spec#298. E2E test will be added in follow-up. Charging cycles, and determining the cost of the endpoint will be added in follow-up. --------- Co-authored-by: Islam El-Ashi <islam.elashi@dfinity.org>
The current Bitcoin integration API does not expose any information about block headers.
This information would be useful to verify blocks (e.g., obtained using HTTPS outcalls) by comparing the Merkle root hash with the root hash in the block header.
This PR introduces a new endpoint
bitcoin_get_block_headers
.The PR also reorganizes some Bitcoin integration related definitions to make things easier to read from top to bottom.