Skip to content

Commit

Permalink
Merge branch 'main' into halloween-checkpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 1, 2022
2 parents f8b2736 + bbbd56d commit 12fbd63
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 32 deletions.
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ zebrad (rc):
- [ ] zebrad `Cargo.toml`
- [ ] `zebra-network` protocol user agent: https://github.com/ZcashFoundation/zebra/blob/main/zebra-network/src/constants.rs
- [ ] `README.md`
- [ ] `book/src/user/install.md`

crates (pre-release):
- [ ] zebra-* `Cargo.toml`s
Expand All @@ -59,7 +58,7 @@ You can use `fastmod` to interactively find and replace versions.

For example, you can do something like:
```
fastmod --extensions rs,toml,md --fixed-strings '1.0.0-rc.0' '1.0.0-rc.1' zebrad README.md book/src/user/install.md zebra-network/src/constants.rs
fastmod --extensions rs,toml,md --fixed-strings '1.0.0-rc.0' '1.0.0-rc.1' zebrad README.md zebra-network/src/constants.rs
fastmod --extensions rs,toml,md --fixed-strings '1.0.0-beta.15' '1.0.0-beta.16' zebra-*
fastmod --extensions rs,toml,md --fixed-strings '0.2.30' '0.2.31' tower-batch tower-fallback
```
Expand Down Expand Up @@ -118,7 +117,7 @@ After you have the version increments, the updated checkpoints and the updated c

- [ ] Make sure the PR with the new checkpoint hashes is already merged, or make it part of the changelog PR
- [ ] Push the version increments and the updated changelog into a branch
(name suggestion, example: `v100-rc0-release`)
(name suggestion, example: `v1.0.0-rc.X`)
- [ ] Create a release PR by adding `&template=release-checklist.md` to the
comparing url ([Example](https://github.com/ZcashFoundation/zebra/compare/v100-alpha0-release?expand=1&template=release-checklist.md)).
- [ ] Add the list of deleted changelog entries as a comment to make reviewing easier.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continous-integration-os.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
os: [ubuntu-latest, macos-latest]
rust: [1.63, beta]
rust: [stable, beta]
exclude:
- os: macos-latest
rust: beta
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/continous-integration-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ jobs:
matrix:
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
os: [ubuntu-latest, macos-latest]
# Rust 1.64 hangs when downloading the Zcash Parameters on GitHub Actions runners
rust: [1.63, beta]
rust: [stable, beta]
exclude:
# TODO: re-enable beta Rust tests on ubuntu (#4929)
- os: ubuntu-latest
rust: beta
# We're excluding macOS for the following reasons:
# - the concurrent macOS runner limit is much lower than the Linux limit
# - macOS is slower than Linux, and shouldn't have a build or test difference with Linux
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jobs:

- uses: actions-rs/[email protected]
with:
# Rust 1.64 hangs when downloading the Zcash Parameters on GitHub Actions runners
toolchain: 1.63
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Rust files
id: changed-files-rust
uses: tj-actions/[email protected].0
uses: tj-actions/[email protected].2
with:
files: |
**/*.rs
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Workflow files
id: changed-files-workflows
uses: tj-actions/[email protected].0
uses: tj-actions/[email protected].2
with:
files: |
.github/workflows/*.yml
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
- [Contents](#contents)
- [About](#about)
- [Using Zebra](#using-zebra)
- [Beta Releases](#beta-releases)
- [Release Candidates](#release-candidates)
- [Getting Started](#getting-started)
- [Build and Run Instructions](#build-and-run-instructions)
- [Build Instructions](#build-instructions)
- [Configuring JSON-RPC for lightwalletd](#configuring-json-rpc-for-lightwalletd)
- [Optional Features](#optional-features)
- [System Requirements](#system-requirements)
Expand Down Expand Up @@ -88,9 +88,10 @@ To run `zebrad`, follow the instructions to compile `zebrad`
for your platform:

1. Install [`cargo` and `rustc`](https://www.rust-lang.org/tools/install).
- Zebra requires Rust 1.63, due to [a compiler performance regression in Rust 1.64](https://github.com/ZcashFoundation/zebra/issues/5091).
Zebra is also tested with the latest `stable` Rust version.
Earlier versions are not supported or tested. Any Zebra release can remove support for older Rust versions, without any notice.
- Zebra is tested with the latest `stable` Rust version.
Earlier versions are not supported or tested.
Any Zebra release can remove support for older Rust versions, without any notice.
(Rust 1.59 and earlier are definitely not supported, due to missing features.)
2. Install Zebra's build dependencies:
- **libclang:** the `libclang`, `libclang-dev`, `llvm`, or `llvm-dev` packages, depending on your package manager
- **clang** or another C++ compiler: `g++`, `Xcode`, or `MSVC`
Expand Down Expand Up @@ -231,8 +232,7 @@ There are a few bugs in Zebra that we're still working on fixing:
for a short period of time because Zebra will quickly find out that it's
still not close to the tip.

- Zebra requires Rust 1.63, due to [a compiler performance regression in Rust 1.64](https://github.com/ZcashFoundation/zebra/issues/5091)
- If Zebra fails downloading the Zcash parameters, use [the Zcash parameters download script](https://github.com/zcash/zcash/blob/master/zcutil/fetch-params.sh) instead. This script might be needed on macOS, even with Rust 1.63.
- If Zebra fails downloading the Zcash parameters, use [the Zcash parameters download script](https://github.com/zcash/zcash/blob/master/zcutil/fetch-params.sh) instead. This script might be needed on macOS, even with Rust stable.
- No Windows support [#3801](https://github.com/ZcashFoundation/zebra/issues/3801)
- We used to test with Windows Server 2019, but not anymore; see issue for details

Expand Down
9 changes: 0 additions & 9 deletions book/src/user/supported-platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ ensures that each tier 1 platform builds and passes tests after each change.

For the full requirements, see [Tier 1 platform policy](platform-tier-policy.md#tier-1-platform-policy) in the Platform Tier Policy.

| platform | os | notes | rust | artifacts
| -------|-------|-------|-------|-------
| `x86_64-unknown-linux-gnu` | [Debian 11](https://www.debian.org/releases/bullseye/) | 64-bit | [1.63](https://github.com/rust-lang/rust/releases) | Docker

### Temporarily Unsupported

Zcash parameter downloads currently [hang when built with Rust 1.64 and later](https://github.com/ZcashFoundation/zebra/issues/5091).
Those Rust versions are unsupported until that bug is fixed.

| platform | os | notes | rust | artifacts
| -------|-------|-------|-------|-------
| `x86_64-unknown-linux-gnu` | [Debian 11](https://www.debian.org/releases/bullseye/) | 64-bit | [latest stable release](https://github.com/rust-lang/rust/releases) | Docker
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - runtime: is our runtime environment
#
# This stage implements cargo-chef for docker layer caching
FROM rust:1.63-bullseye as chef
FROM rust:bullseye as chef
RUN cargo install cargo-chef --locked
WORKDIR /opt/zebrad

Expand Down
2 changes: 1 addition & 1 deletion docker/zcash-params/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This steps implement cargo-chef for docker layer caching
# This image is for caching Zcash Sprout and Sapling parameters
FROM rust:1.63-bullseye as chef
FROM rust:bullseye as chef
RUN cargo install cargo-chef --locked
WORKDIR /opt/zebrad

Expand Down
2 changes: 1 addition & 1 deletion zebra-rpc/src/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use zebra_state::{OutputIndex, OutputLocation, TransactionLocation};
use crate::queue::Queue;

#[cfg(feature = "getblocktemplate-rpcs")]
mod get_block_template_rpcs;
pub mod get_block_template_rpcs;

#[cfg(feature = "getblocktemplate-rpcs")]
pub use get_block_template_rpcs::{GetBlockTemplateRpc, GetBlockTemplateRpcImpl};
Expand Down
1 change: 1 addition & 0 deletions zebra-rpc/src/methods/get_block_template_rpcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::methods::{
GetBlockHash, MISSING_BLOCK_ERROR_CODE,
};

pub mod config;
pub(crate) mod types;

/// getblocktemplate RPC method signatures.
Expand Down
17 changes: 17 additions & 0 deletions zebra-rpc/src/methods/get_block_template_rpcs/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//! Mining config
use serde::{Deserialize, Serialize};

use zebra_chain::transparent::Address;

/// Mining configuration section.
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields, default)]
pub struct Config {
/// The address used for miner payouts.
/// Currently, Zebra only supports transparent addresses.
///
/// Zebra sends mining fees and miner rewards to this address in the
/// `getblocktemplate` RPC coinbase transaction.
pub miner_address: Option<Address>,
}
1 change: 1 addition & 0 deletions zebrad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ default-run = "zebrad"
[features]
# In release builds, don't compile debug logging code, to improve performance.
default = ["release_max_level_info"]
getblocktemplate-rpcs = ["zebra-rpc/getblocktemplate-rpcs"]

# Production features that activate extra dependencies

Expand Down
4 changes: 4 additions & 0 deletions zebrad/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ pub struct ZebradConfig {

/// RPC configuration
pub rpc: zebra_rpc::config::Config,

#[cfg(feature = "getblocktemplate-rpcs")]
/// Mining configuration
pub mining: zebra_rpc::methods::get_block_template_rpcs::config::Config,
}
12 changes: 12 additions & 0 deletions zebrad/tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,18 @@ fn stored_configs_works() -> Result<()> {
.expect("read_dir call failed")
.flatten()
{
// ignore files starting with getblocktemplate prefix
// if we were not built with the getblocktemplate-rpcs feature.
#[cfg(not(feature = "getblocktemplate-rpcs"))]
if config_file
.file_name()
.into_string()
.expect("all files names should be string convertible")
.starts_with("getblocktemplate-")
{
continue;
}

let run_dir = testdir()?;
let stored_config_path = config_file_full_path(config_file.path());

Expand Down
72 changes: 72 additions & 0 deletions zebrad/tests/common/configs/getblocktemplate-v1.0.0-rc.0.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Default configuration for zebrad.
#
# This file can be used as a skeleton for custom configs.
#
# Unspecified fields use default values. Optional fields are Some(field) if the
# field is present and None if it is absent.
#
# This file is generated as an example using zebrad's current defaults.
# You should set only the config options you want to keep, and delete the rest.
# Only a subset of fields are present in the skeleton, since optional values
# whose default is None are omitted.
#
# The config format (including a complete list of sections and fields) is
# documented here:
# https://doc.zebra.zfnd.org/zebrad/config/struct.ZebradConfig.html
#
# zebrad attempts to load configs in the following order:
#
# 1. The -c flag on the command line, e.g., `zebrad -c myconfig.toml start`;
# 2. The file `zebrad.toml` in the users's preference directory (platform-dependent);
# 3. The default config.

[consensus]
checkpoint_sync = true
debug_skip_parameter_preload = false

[mempool]
eviction_memory_time = '1h'
tx_cost_limit = 80000000

[metrics]

[mining]

[network]
crawl_new_peer_interval = '1m 1s'
initial_mainnet_peers = [
'dnsseed.z.cash:8233',
'dnsseed.str4d.xyz:8233',
'mainnet.seeder.zfnd.org:8233',
'mainnet.is.yolo.money:8233',
]
initial_testnet_peers = [
'dnsseed.testnet.z.cash:18233',
'testnet.seeder.zfnd.org:18233',
'testnet.is.yolo.money:18233',
]
listen_addr = '0.0.0.0:8233'
network = 'Mainnet'
peerset_initial_target_size = 25

[rpc]
debug_force_finished_sync = false
parallel_cpu_threads = 1

[state]
cache_dir = 'cache_dir'
delete_old_database = true
ephemeral = false

[sync]
checkpoint_verify_concurrency_limit = 800
download_concurrency_limit = 50
full_verify_concurrency_limit = 20
parallel_cpu_threads = 0

[tracing]
buffer_limit = 128000
force_use_color = false
use_color = true
use_journald = false

0 comments on commit 12fbd63

Please sign in to comment.