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

Feature: rpc blockbyheight #5445

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

rdeioris
Copy link

@rdeioris rdeioris commented Nov 11, 2024

Description

Hi, this is my initial attempt at approaching the codebase by covering an issue out of the critical path. This patch
adds a new RPC call: /v3/blocks/height/{block_height} as specified in issue #4358

Applicable issues

Additional info (benefits, drawbacks, caveats)

The endpoint is fork-safe as it allows to specify an additional query_string (?tip=x) that will force the search in the MARF for a specific tip block hash

Checklist

  • [x ] Test coverage for new or modified code paths
  • [x ] Changelog is updated
  • [ x] Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • [x ] New integration test(s) added to bitcoin-tests.yml

@rdeioris rdeioris requested review from a team as code owners November 11, 2024 12:12
@rdeioris rdeioris changed the title Feat/rpc blockbyhash blockbyheight develop Feature: rpc blockbyheight Nov 13, 2024
@rdeioris
Copy link
Author

Updated the pull request for including only the /v3/blocks/height endpoint with the fix for using the MARF for querying from a secific tip. The patch is now less invasive (basically it is self-contained)

docs/rpc-endpoints.md Outdated Show resolved Hide resolved
@jcnelson jcnelson self-requested a review November 14, 2024 14:50
jcnelson
jcnelson previously approved these changes Nov 14, 2024
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM. Just need to get CI to pass.

Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

@rdeioris I see you've updated rpc-endpoints.md, but please also update docs/rpc/openapi.yaml with this new endpoint. Thanks!

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

This looks good, just flagged a couple of typos. I also second Hank's request to update the openapi.yml.

stackslib/src/net/api/tests/getblockbyheight.rs Outdated Show resolved Hide resolved
stackslib/src/net/api/tests/getblockbyheight.rs Outdated Show resolved Hide resolved
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.

4 participants