Skip to content

Commit dc1531f

Browse files
committed
rpc: align getblock with zcashd behaviour
1 parent 80ea07b commit dc1531f

17 files changed

Lines changed: 625 additions & 44 deletions

CHANGELOG.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to Zebra are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org).
77

8+
## Unreleased
9+
10+
### Performance Regression
11+
12+
The `getblock()` change described below will impact lightwalletd operators who
13+
back it with Zebra. The initial sync performance will drop unless you change
14+
the `getblock()` call to use `verbosity=3`. See below for details.
15+
16+
### Changed
17+
18+
- The `getblock()` RPC now supports all the fields also returned by `getblockheader()`.
19+
The old partial support is now moved to `verbosity=3`; it might be useful for
20+
lightwalletd if you want to keep the same initial sync performance as before
21+
(you will need to changed lightwalletd source code to use `verbosity=3`)
22+
823
## [Zebra 2.0.0-rc.0](https://github.com/ZcashFoundation/zebra/releases/tag/v2.0.0-rc.0) - 2024-10-11
924

1025
This version is a release candidate for the Zcash NU6 network upgrade on the Mainnet. While this version does not yet include the NU6 Mainnet activation height or current protocol version, all required functionality and tests are in place.
@@ -58,7 +73,7 @@ by syncing Zebra from scratch, or by using the `copy-state` command to create a
5873
command, first make a copy Zebra's Testnet configuration with a different cache directory path, for example, if Zebra's configuration is at the
5974
default path, by running `cp ~/.config/zebrad.toml ./zebrad-copy-target.toml`, then opening the new configuration file and editing the
6075
`cache_dir` path in the `state` section. Once there's a copy of Zebra's configuration with the new state cache directory path, run:
61-
`zebrad copy-state --target-config-path "./zebrad-copy-target.toml" --max-source-height "2975999"`, and then update the original
76+
`zebrad copy-state --target-config-path "./zebrad-copy-target.toml" --max-source-height "2975999"`, and then update the original
6277
Zebra configuration to use the new state cache directory.
6378

6479
### Added
@@ -104,7 +119,7 @@ Thank you to everyone who contributed to this release, we couldn't make Zebra wi
104119
- Support for custom Testnets and Regtest is greatly enhanced.
105120
- Windows is now back in the second tier of supported platforms.
106121
- The end-of-support time interval is set to match `zcashd`'s 16 weeks.
107-
- The RPC serialization of empty treestates matches `zcashd`.
122+
- The RPC serialization of empty treestates matches `zcashd`.
108123

109124
### Added
110125

@@ -170,11 +185,11 @@ Thank you to everyone who contributed to this release, we couldn't make Zebra wi
170185

171186
## [Zebra 1.6.1](https://github.com/ZcashFoundation/zebra/releases/tag/v1.6.1) - 2024-04-15
172187

173-
This release adds an OpenAPI specification for Zebra's RPC methods and startup logs about Zebra's storage usage and other database information.
188+
This release adds an OpenAPI specification for Zebra's RPC methods and startup logs about Zebra's storage usage and other database information.
174189

175190
It also includes:
176191
- Bug fixes and improved error messages for some zebra-scan gRPC methods
177-
- A performance improvement in Zebra's `getblock` RPC method
192+
- A performance improvement in Zebra's `getblock` RPC method
178193

179194
### Added
180195

zebra-rpc/src/constants.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ use jsonrpc_core::{Error, ErrorCode};
1111
/// <https://github.com/s-nomp/node-stratum-pool/blob/d86ae73f8ff968d9355bb61aac05e0ebef36ccb5/lib/pool.js#L459>
1212
pub const INVALID_PARAMETERS_ERROR_CODE: ErrorCode = ErrorCode::ServerError(-1);
1313

14+
/// The RPC error code used by `zcashd` for missing blocks, when looked up
15+
/// by hash.
16+
pub const INVALID_ADDRESS_OR_KEY_ERROR_CODE: ErrorCode = ErrorCode::ServerError(-5);
17+
1418
/// The RPC error code used by `zcashd` for missing blocks.
1519
///
1620
/// `lightwalletd` expects error code `-8` when a block is not found:

0 commit comments

Comments
 (0)