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

Implement HeaderByHeight in filedao #4229

Open
Liuhaai opened this issue Apr 11, 2024 · 2 comments
Open

Implement HeaderByHeight in filedao #4229

Liuhaai opened this issue Apr 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Liuhaai
Copy link
Member

Liuhaai commented Apr 11, 2024

What would you like to be added

HeaderByHeight, which to be implemented in filedao_v2, should be used instead of GetBlockByHeight in

blk, err := v2.GetBlockByHeight(height)

// Before 
blk, err := v2.GetBlockByHeight(height)
// After 
header, err := v2.HeaderByHeight(height)

Why is this needed

Some queries can be optmized by HeaderByHeight

How important you think this is for IoTeX

  • [] must have
  • [] should have
  • [] nice to have

Additional information

Let us know any background or context that would help us better understand the request (for example the particular use-case that prompted this request)

@Liuhaai Liuhaai added the enhancement New feature or request label Apr 11, 2024
@millken
Copy link
Contributor

millken commented Apr 16, 2024

Currently HeaderByHeight still needs to deseralize the entire block, the cost is the same as GetBlockByHeight.

@Liuhaai
Copy link
Member Author

Liuhaai commented Apr 16, 2024

Currently HeaderByHeight still needs to deseralize the entire block, the cost is the same as GetBlockByHeight.

I see no HeaderByHeight is implemented in filedao_v2. Could you give a snippet why should the whole block be deseralized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants