Make Zebra's tip estimate match zcashd exactly #3954
Labels
A-rpc
Area: Remote Procedure Call interfaces
C-bug
Category: This is a bug
lightwalletd
any work associated with lightwalletd
Motivation
Zebra's chain tip estimate is slightly different to
zcashd
's.We don't think this will cause any issues, but if it does, they will come up in tests like:
Specifications
Here is what the
zcashd
code does:zcashd
has stopped syncing, return the current height: https://github.com/zcash/zcash/blob/6cd5b8792bbe0a3cc1064e1884914415f0c6e7d7/src/rpc/blockchain.cpp#L1068-L1071Zebra APIs
Here's the
SyncStatus
method that returns if we're close to the tip:zebra/zebrad/src/components/sync/status.rs
Lines 46 to 47 in 5d7f986
Here's the buggy
NetworkChainTipHeightEstimator
code. Removing negative times should simplify it a lot.(The bug fix will probably make some tests fail, Janito can help fix them.)
https://github.com/ZcashFoundation/zebra/blob/main/zebra-chain/src/chain_tip/network_chain_tip_height_estimator.rs#L111-L120
Tasks
Here's one way to do this fix:
SyncStatus
tozebra_node_services
SyncStatus
toRpcImpl
, and use it to check if we're close to the tipNetworkChainTipHeightEstimator
to return the current height if the block time is ahead of the current timeRelated Work
This ticket was split out of:
getblockchaininfo
RPC method #3891 (comment)The text was updated successfully, but these errors were encountered: