Skip to content

fix: implement getblock and getblockheader compliant with core#657

Open
qlrd wants to merge 4 commits intogetfloresta:masterfrom
qlrd:fix/getblockheader
Open

fix: implement getblock and getblockheader compliant with core#657
qlrd wants to merge 4 commits intogetfloresta:masterfrom
qlrd:fix/getblockheader

Conversation

@qlrd
Copy link
Collaborator

@qlrd qlrd commented Oct 3, 2025

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-node
  • floresta-rpc
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

Description and Notes

Fix #655

How to verify the changes you have done?

Add a verbose paramenter to getblockheader command so it will comply with core wheather to return a "raw" blockheader (as a hexadecimal string) or a "verbose" blockheader (as a json object).

Due to this, it was also needed to fix getblock rpc method so it can, now, use verbosity levels 0 up to 2.

@qlrd qlrd mentioned this pull request Oct 3, 2025
15 tasks
Copy link
Collaborator

@jaoleal jaoleal left a comment

Choose a reason for hiding this comment

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

I know that this is draft and the CI is broken but heres some early thougths

@Davidson-Souza Davidson-Souza added code quality Generally improves code readability and maintainability RPC Changes something with our JSON-RPC interface labels Oct 4, 2025
@qlrd qlrd force-pushed the fix/getblockheader branch 5 times, most recently from c469ea6 to d80d2a8 Compare October 10, 2025 00:50
@qlrd qlrd force-pushed the fix/getblockheader branch 5 times, most recently from 6c516c7 to 14f7841 Compare October 17, 2025 01:12
@qlrd qlrd marked this pull request as ready for review October 17, 2025 03:59
@qlrd qlrd requested a review from jaoleal October 17, 2025 03:59
@qlrd qlrd force-pushed the fix/getblockheader branch 2 times, most recently from 4a203b9 to 2a0ef75 Compare October 21, 2025 00:37
@Davidson-Souza
Copy link
Member

Needs rebase

@qlrd qlrd force-pushed the fix/getblockheader branch 3 times, most recently from a8fda04 to 4bcae5d Compare October 22, 2025 14:55
@qlrd qlrd force-pushed the fix/getblockheader branch 5 times, most recently from cf053b0 to 1a77099 Compare December 3, 2025 15:53
@qlrd qlrd force-pushed the fix/getblockheader branch 3 times, most recently from 94eb268 to 6f6d1e2 Compare December 4, 2025 14:10
@qlrd qlrd changed the title Fix/getblockheader fix: implement getblock and getblockheader compliant with core Dec 4, 2025
@qlrd qlrd force-pushed the fix/getblockheader branch from 6f6d1e2 to 28b5b9f Compare December 4, 2025 15:00
qlrd added 2 commits December 4, 2025 13:38
This commit add a `verbose` paramenter to `getblockheader` command so it
will comply with core wheather to return a "raw" blockheader (as a
hexadecimal string) or a "verbose" blockheader (as a json object).

Fix getfloresta#655
This commit add a test that should result in a proper
`serde_json::Value<GetBlockHeaderResVerbose>`.
@qlrd qlrd force-pushed the fix/getblockheader branch from 28b5b9f to 3953d6e Compare December 4, 2025 16:38
qlrd added 2 commits December 4, 2025 13:38
…ock` rpc

This commit add a cycle of connections and mining to the
`getblockheader`/`getblock` tesst so it can check the blocks/
blockheaders for 102 different heights.
@qlrd qlrd force-pushed the fix/getblockheader branch from 3953d6e to 757a88c Compare December 4, 2025 16:39
@qlrd qlrd requested a review from Davidson-Souza December 4, 2025 16:57
@Davidson-Souza
Copy link
Member

@qlrd there's some duplicate work with #722, could you take a look on that one and help us getting it thought? Then you can rebase this one and use the new trait

@qlrd
Copy link
Collaborator Author

qlrd commented Dec 4, 2025

@qlrd there's some duplicate work with #722, could you take a look on that one and help us getting it thought? Then you can rebase this one and use the new trait

sure

@moisesPompilio
Copy link
Collaborator

Need rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Generally improves code readability and maintainability RPC Changes something with our JSON-RPC interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement getblockheader

4 participants