-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getblocktemplate min and max times on testnet #5871
Labels
A-consensus
Area: Consensus rule updates
A-rpc
Area: Remote Procedure Call interfaces
C-bug
Category: This is a bug
I-consensus
Zebra breaks a Zcash consensus rule
Comments
teor2345
added
C-bug
Category: This is a bug
A-consensus
Area: Consensus rule updates
S-needs-triage
Status: A bug report needs triage
P-Medium ⚡
I-consensus
Zebra breaks a Zcash consensus rule
A-rpc
Area: Remote Procedure Call interfaces
labels
Dec 16, 2022
6 tasks
6 tasks
I added some
This diff shows that Zebra's So we might be subtracting rather than adding, or some other wrong calculation. I'll try to fix it tomorrow. |
6 tasks
@teor2345 can you please add an estimate to this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-consensus
Area: Consensus rule updates
A-rpc
Area: Remote Procedure Call interfaces
C-bug
Category: This is a bug
I-consensus
Zebra breaks a Zcash consensus rule
Motivation
On testnet only, there is a 1679 second difference between the
mintime
produced by Zebra andzcashd
for the same height.This amount doesn't seem to correspond to any particular consensus rule.
Specifications
https://zips.z.cash/protocol/protocol.pdf#blockheader
https://zips.z.cash/zip-0205#change-to-difficulty-adjustment-on-testnet
Complex Code or Requirements
Zebra adjusts the
mintime
ormaxtime
on testnet, so the block time range is either for a standard difficulty block, or a minimum difficulty block.Analysis
This is not a minimum difficulty block, so the
maxtime
should get adjusted to 15 minutes after themintime
. But instead it is 93.8 minutes later. But it should be 15m after themintime
for standard difficulty, or 75m (90m-15m) for minimum difficulty.This seems like a bug in Zebra's testnet time adjustment. These comments are also wrong and don't match the spec:
zebra/zebra-state/src/service/read/difficulty.rs
Lines 263 to 267 in 80a6d3c
It is also possible that
zcashd
sets a higher minimum than the time permitted by the consensus rules.Related Work
This was discovered as part of:
Logs
The text was updated successfully, but these errors were encountered: