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.
Motivation
To match zcashd we need to return the
size
field to thegetblock
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