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

Merged
merged 34 commits into from
Nov 20, 2024
Merged

Conversation

rdeioris
Copy link
Contributor

@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
@saralab saralab requested review from jcnelson and obycode November 12, 2024 15:48
@rdeioris rdeioris changed the title Feat/rpc blockbyhash blockbyheight develop Feature: rpc blockbyheight Nov 13, 2024
@rdeioris
Copy link
Contributor 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
@rdeioris rdeioris requested a review from hstove November 18, 2024 08:26
hstove
hstove previously approved these changes Nov 18, 2024
@hstove hstove requested a review from obycode November 18, 2024 17:50
hstove
hstove previously approved these changes Nov 19, 2024
jcnelson
jcnelson previously approved these changes Nov 19, 2024
@rdeioris rdeioris force-pushed the feat/rpc_blockbyhash_blockbyheight_develop branch from 4b578f9 to 5647bc9 Compare November 19, 2024 21:43
@rdeioris
Copy link
Contributor Author

@rdeioris just some small conflicts to resolve, and then we'll re-approve before merging

The rebase took me a while, sorry for the noise. It should be good now.

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.

LGTM, thanks!

BTW, just as a side note, typically it's better to fix conflicts via a merge commit instead of a rebase. It's easier for you and easier for reviewers, too. Rebases are cleaner and probably fine for just a commit or two, but once there are a bunch of commits it just gets unwieldy.

@hstove hstove added this pull request to the merge queue Nov 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2024
@hstove hstove enabled auto-merge November 20, 2024 19:51
@hstove hstove added this pull request to the merge queue Nov 20, 2024
Merged via the queue into develop with commit 819440b Nov 20, 2024
1 check passed
@aldur aldur deleted the feat/rpc_blockbyhash_blockbyheight_develop branch November 25, 2024 12:28
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Dec 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants