Skip to content

Conversation

@fjahr
Copy link
Contributor

@fjahr fjahr commented Mar 13, 2024

The getblockheader RPC with its true/false verbosity options returns the same content as getblock with verbosity 0/1. So this is an opportunity to remove some code very cleanly, as demonstrated here.

I looked for other issues or PRs that suggested this but wasn't successful, obviously let me know if I missed something.

Just looking for conceptual feedback for now. When that is positive I will first run getblockheader through a depecation cycle. If it is negative I will suggest some deduplication between the two RPCs instead.

The getblockheader RPC with it's true/false verbosity options return the same result as getblock with verbosity 0/1, so it can be cleanly removed.
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 13, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@theStack
Copy link
Contributor

The getblockheader RPC with its true/false verbosity options returns the same content as getblock with verbosity 0/1.

I don't think that's the case. The following two commands on mainnet return different results:

$ ./src/bitcoin-cli getblockheader $(./src/bitcoin-cli getblockhash 830000) false
$ ./src/bitcoin-cli getblock $(./src/bitcoin-cli getblockhash 830000) 0

(What is a little confusing though is that the submitheader RPC doesn't care if there is more than 80 bytes passed, so feeding in a full block works as well. Context for other reviewers: #29478 (comment))

@fjahr
Copy link
Contributor Author

fjahr commented Mar 13, 2024

Hm, weird, the docs are the same word for word as well. (Never mind, misread) I will need to dig a bit deeper and suggest some less drastic change/clarifications.

@fjahr fjahr closed this Mar 13, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants