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

API: New algod endpoint /v2/block/{round}/header omits transactions and cert from response #6163

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

nullun
Copy link
Contributor

@nullun nullun commented Nov 4, 2024

Retrieve just the block header information without the transactions and cert data. This reduces the response size and response time, but still includes block details such as the proposer and any incentive rewards.

With the introduction of consensus incentives, various people have asked how they can obtain this new data per block without also including all the transaction data in the response. This was considered a useful option, so thought I'd have a go at implementing it. Support for both json and msgpack is available, and a very simple test was included.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 56.24%. Comparing base (eff5fb4) to head (c84546f).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
daemon/algod/api/server/v2/handlers.go 0.00% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6163      +/-   ##
==========================================
- Coverage   56.29%   56.24%   -0.05%     
==========================================
  Files         494      494              
  Lines       69958    69978      +20     
==========================================
- Hits        39381    39360      -21     
- Misses      27907    27939      +32     
- Partials     2670     2679       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Please fix the test, otherwise LGTM

daemon/algod/api/server/v2/test/handlers_test.go Outdated Show resolved Hide resolved
@nullun nullun requested a review from algorandskiy November 5, 2024 10:19
Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

I guess it is better to round trip a header from a mock in the test but LGTM

@algorandskiy algorandskiy requested a review from gmalouf November 5, 2024 17:34
@nullun nullun changed the title API: New algod endpoint /v2/header/{round}/header omits transactions and cert from response API: New algod endpoint /v2/block/{round}/header omits transactions and cert from response Nov 14, 2024
@algorandskiy algorandskiy merged commit a6123b6 into algorand:master Nov 18, 2024
20 checks passed
@nullun nullun deleted the feature/api-block-header branch November 19, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants