Specify a retrospective soft fork implemented in zcashd v2.1.1-1 that limits the nTime field

of a block relative to its median-time-past.
Correct the definition of median-time-past for the first PoWMedianBlockSpan blocks in a chain.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2020-02-06 22:40:00 +00:00
parent ed6baf0fef
commit 0d582758dd
1 changed files with 20 additions and 3 deletions

View File

@ -873,6 +873,7 @@ electronic commerce and payment, financial privacy, proof of work, zero knowledg
\newcommand{\activationHeight}{\term{activation block height}}
\newcommand{\activationHeights}{\terms{activation block height}}
\newcommand{\genesisBlock}{\term{genesis block}}
\newcommand{\medianTimePast}{\term{median-time-past}}
\newcommand{\transaction}{\term{transaction}}
\newcommand{\transactions}{\terms{transaction}}
\newcommand{\Transaction}{\titleterm{Transaction}}
@ -9032,6 +9033,11 @@ the consensus protocol.
Let $\ThresholdBits$ be as defined in \crossref{diffadjustment}, and let $\PoWMedianBlockSpan$
be the constant defined in \crossref{constants}.
\defining{Define the \medianTimePast of a \block to be the median (as defined in \crossref{diffadjustment})
of the $\nTimeField$ fields of the \emph{preceding} $\PoWMedianBlockSpan$ \blocks (or all
preceding \blocks if there are fewer than $\PoWMedianBlockSpan$). The \medianTimePast of a
\genesisBlock is not defined.}
\vspace{2ex}
\begin{consensusrules}
\item The \blockVersionNumber{} \MUST be greater than or equal to $4$.
@ -9039,8 +9045,11 @@ be the constant defined in \crossref{constants}.
$\ThresholdBits(\BlockHeight)$.
\item The \block{} \MUST pass the difficulty filter defined in \crossref{difficulty}.
\item $\solution$ \MUST represent a \validEquihashSolution as defined in \crossref{equihash}.
\item $\nTimeField$ \MUST be strictly greater than the median time of the previous
$\PoWMedianBlockSpan$ \blocks.
\item For each \block other than the \genesisBlock, $\nTimeField$ \MUST be strictly greater
than the \medianTimePast of that \block.
\item For each \block at \blockHeight $2$ or greater on the production network, or \blockHeight
$653606$ or greater on the test network, $\nTimeField$ \MUST be less than or equal to
the \medianTimePast of that \block plus $90 \mult 60$ seconds.
\item The size of a \block{} \MUST be less than or equal to $2000000$ bytes.
\saplingonwarditem{$\hashFinalSaplingRoot$ \MUST be $\LEBStoOSPOf{256}{\rt}$ where
$\rt$ is the \merkleRoot of the \Sapling{} \noteCommitmentTree for the final
@ -9078,6 +9087,10 @@ rejected by this rule at a given point in time may later be accepted.
the median of the timestamps of the past $\PoWMedianBlockSpan$ \blocks. The
Bitcoin Developer Reference \cite{Bitcoin-Block} was previously in error on this point,
but has now been corrected.
\item The rule limiting $\nTimeField$ to be no later than $90 \mult 60$ seconds after the
\medianTimePast is a retrospective consensus change, applied as a soft fork in
\zcashd v2.1.1-1. It had not been violated by any \block from the given \blockHeights
in the consensus \blockchains of either the production or test networks.
\overwinter{
\item There are no changes to the \blockVersionNumber or format for \Overwinter.
}
@ -10251,6 +10264,10 @@ Peter Newell's illustration of the Jubjub bird, from \cite{Carroll1902}.
\historyentry{2020.1.0}{2020-02-06}
\begin{itemize}
\item Specify a retrospective soft fork implemented in \zcashd v2.1.1-1 that
limits the $\nTimeField$ field of a \block relative to its \medianTimePast.
\item Correct the definition of \medianTimePast for the first $\PoWMedianBlockSpan$
\blocks in a \blockchain.
\item Add acknowledgements to Henry de Valence, Deirdre Connolly, Chelsea Komlo,
and Zancas Wilcox.
\item Add an acknowledgement to Trail of Bits for their security audit.
@ -13165,7 +13182,7 @@ the cost of batched verification is therefore
\listtheorems{theorem,lemma}
}
\needspace{30ex}
\phantompart{Index}{index}
\begin{flushleft}