Skip to content
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

feat: Add stub for Bitcoin headers endpoint #297

Merged
merged 9 commits into from
May 21, 2024

Conversation

dragoljub-duric
Copy link
Contributor

@dragoljub-duric dragoljub-duric commented May 15, 2024

As stated in here, 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 we will implement specified function.

Copy link

github-actions bot commented May 15, 2024

canbench 🏋 (dir: .)

No significant performance changes 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: 561.77 M (-0.00%) (change within noise threshold)
    heap_increase: 6 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

Benchmark: get_metrics
  total:
    instructions: 87.00 M (-0.00%) (change within noise threshold)
    heap_increase: 0 pages (no change)
    stable_memory_increase: 0 pages (no change)

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

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

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

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

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

@dragoljub-duric dragoljub-duric marked this pull request as ready for review May 15, 2024 10:08
@dragoljub-duric dragoljub-duric requested a review from a team as a code owner May 15, 2024 10:08
Copy link
Collaborator

@ielashi ielashi left a comment

Choose a reason for hiding this comment

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

Looks good! Some minor nitpicks. Also, I'd avoid linking to private documentation in the PR description as external readers can't access them. You can instead link to the public documentation: dfinity/interface-spec#298

interface/src/lib.rs Show resolved Hide resolved
canister/src/api/get_block_headers.rs Outdated Show resolved Hide resolved
canister/src/main.rs Show resolved Hide resolved
canister/src/api/get_block_headers.rs Show resolved Hide resolved
@ielashi ielashi changed the title feat: Add Bitcoin Headers Endpoint feat: Add stub for Bitcoin headers endpoint May 16, 2024
@dragoljub-duric dragoljub-duric requested a review from ielashi May 21, 2024 09:55
@dragoljub-duric dragoljub-duric merged commit 4d420e1 into master May 21, 2024
25 checks passed
@dragoljub-duric dragoljub-duric deleted the EXC-1618-add-no-op-bitcoin-headers-endpoint branch May 21, 2024 12:22
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.

2 participants