From d9b941bda733f9ae7ab2a5e60d545be65e239b83 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 2 Dec 2022 11:38:17 +1000 Subject: [PATCH] Document max time field correctly (#5773) --- .../types/get_block_template.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs b/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs index 7daad104b..b3a0576de 100644 --- a/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs +++ b/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs @@ -110,12 +110,19 @@ pub struct GetBlockTemplate { // TODO: use Height type? pub height: u32, + /// > the maximum time allowed + /// + /// + /// /// Zebra adjusts the minimum and current times for testnet minimum difficulty blocks, /// so we need to tell miners what the maximum valid time is. /// /// This field is not in the Zcash RPC reference yet. - /// Currently, miners use `min_time` or `cur_time`, or calculate `max_time` from the - /// fixed 90 minute consensus rule. (Or they just don't check!) + /// + /// Currently, some miners just use `min_time` or `cur_time`. Others calculate `max_time` from the + /// fixed 90 minute consensus rule, or a smaller fixed interval (like 1000s). + /// Some miners don't check the maximum time. This can cause invalid blocks after network downtime, + /// a significant drop in the hash rate, or after the testnet minimum difficulty interval. #[serde(rename = "maxtime")] // TODO: use DateTime32 type? pub max_time: i64,