stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 672 forks source link

Feature: rpc blockbyheight #5445

Closed rdeioris closed 1 day ago

rdeioris commented 1 week ago

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

rdeioris commented 1 week ago

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)

hstove commented 2 days ago

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

rdeioris commented 2 days ago

@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.