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

getblock: return the size field #9020

Open
conradoplg opened this issue Nov 14, 2024 · 0 comments
Open

getblock: return the size field #9020

conradoplg opened this issue Nov 14, 2024 · 0 comments
Labels
C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage

Comments

@conradoplg
Copy link
Collaborator

conradoplg commented Nov 14, 2024

Motivation

To match zcashd we need to return the size field to the getblock RPC.

Specifications

No response

Complex Code or Requirements

Be aware that the naive approach might have very poor performance. Look into alternatives (can it be computed on the fly from existing data?), with the last resort adding a new column to the database.

An idea: the block header and txs are stored serialized in the database. The block size can be computed from those, without requiring a serialization roundtrip, which would already save time (deserialization is expensive). This would require adding new State service functions to get the raw block / txs. Also, look whether getting just the size of those from the database is even faster.

Testing

No response

Related Work

No response

@conradoplg conradoplg added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Nov 14, 2024
@github-project-automation github-project-automation bot moved this to New in Zebra Nov 14, 2024
@conradoplg conradoplg changed the title getblock: return size field getblock: return the size field Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage
Projects
Status: New
Development

No branches or pull requests

1 participant