Skip to content

Commit

Permalink
rpc: align getblock with zcashd behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
conradoplg committed Nov 8, 2024
1 parent 80ea07b commit dc1531f
Show file tree
Hide file tree
Showing 17 changed files with 625 additions and 44 deletions.
23 changes: 19 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to Zebra are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org).

## Unreleased

### Performance Regression

The `getblock()` change described below will impact lightwalletd operators who
back it with Zebra. The initial sync performance will drop unless you change
the `getblock()` call to use `verbosity=3`. See below for details.

### Changed

- The `getblock()` RPC now supports all the fields also returned by `getblockheader()`.
The old partial support is now moved to `verbosity=3`; it might be useful for
lightwalletd if you want to keep the same initial sync performance as before
(you will need to changed lightwalletd source code to use `verbosity=3`)

## [Zebra 2.0.0-rc.0](https://github.com/ZcashFoundation/zebra/releases/tag/v2.0.0-rc.0) - 2024-10-11

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.
Expand Down Expand Up @@ -58,7 +73,7 @@ by syncing Zebra from scratch, or by using the `copy-state` command to create a
command, first make a copy Zebra's Testnet configuration with a different cache directory path, for example, if Zebra's configuration is at the
default path, by running `cp ~/.config/zebrad.toml ./zebrad-copy-target.toml`, then opening the new configuration file and editing the
`cache_dir` path in the `state` section. Once there's a copy of Zebra's configuration with the new state cache directory path, run:
`zebrad copy-state --target-config-path "./zebrad-copy-target.toml" --max-source-height "2975999"`, and then update the original
`zebrad copy-state --target-config-path "./zebrad-copy-target.toml" --max-source-height "2975999"`, and then update the original
Zebra configuration to use the new state cache directory.

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

### Added

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

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

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

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

### Added

Expand Down
4 changes: 4 additions & 0 deletions zebra-rpc/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ use jsonrpc_core::{Error, ErrorCode};
/// <https://github.com/s-nomp/node-stratum-pool/blob/d86ae73f8ff968d9355bb61aac05e0ebef36ccb5/lib/pool.js#L459>
pub const INVALID_PARAMETERS_ERROR_CODE: ErrorCode = ErrorCode::ServerError(-1);

/// The RPC error code used by `zcashd` for missing blocks, when looked up
/// by hash.
pub const INVALID_ADDRESS_OR_KEY_ERROR_CODE: ErrorCode = ErrorCode::ServerError(-5);

/// The RPC error code used by `zcashd` for missing blocks.
///
/// `lightwalletd` expects error code `-8` when a block is not found:
Expand Down
Loading

0 comments on commit dc1531f

Please sign in to comment.