Skip to content

Conversation

@JoseSK999
Copy link
Contributor

@JoseSK999 JoseSK999 commented Jun 22, 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-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

Description

I have added a new required method to ChainStore that allows fetching the header directly from the height, which is supported out of the box with FlatChainStore.

I also made the flat store Index impl be under its own module, enforcing we always use the API. Then I refactored get_block_header_by_index into the inner get_disk_header, which is more concise. This also ensures our heights are checked to be 31-bits.

EDIT: save_roots_for_block now returns error if we don't have the respective header, which makes the behavior more consistent. (same for the load function)

@JoseSK999 JoseSK999 force-pushed the get-header-by-height branch from b8618ac to 4f144ff Compare June 22, 2025 18:26
@Davidson-Souza Davidson-Souza added enhancement New feature or request code quality Generally improves code readability and maintainability performance This is a performance-related issue labels Jun 23, 2025
I have added a new required method to `ChainStore` that allows fetching the header directly from the height, which is supported out of the box with `FlatChainStore`.

I also made the flat store `Index` impl be under its own module, enforcing we always use the API. Then I refactored `get_block_header_by_index` into the inner `get_disk_header`, which is more concise. This also ensures our heights are checked to be 31-bits.

`save_roots_for_block` now returns error if we don't have the respective header, which makes the behavior more consistent.
@JoseSK999 JoseSK999 force-pushed the get-header-by-height branch from 4f144ff to 53522ab Compare June 24, 2025 11:32
@jaoleal
Copy link
Collaborator

jaoleal commented Jun 24, 2025

ACK 53522ab

Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

ACK 53522ab

@Davidson-Souza Davidson-Souza merged commit b548b79 into vinteumorg:master Jun 24, 2025
10 checks passed
@JoseSK999 JoseSK999 deleted the get-header-by-height branch June 26, 2025 14:08
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 enhancement New feature or request performance This is a performance-related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants