Skip to content

Commit

Permalink
adds TODOs for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Jun 7, 2024
1 parent 0d35fc3 commit 0d1f434
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zebra-rpc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{

/// How long to wait between calls to `getbestblockhash` when it returns an error or the block hash
/// of the current chain tip in the process that's syncing blocks from Zebra.
const POLL_DELAY: Duration = Duration::from_millis(100);
const POLL_DELAY: Duration = Duration::from_millis(200);

/// Syncs non-finalized blocks in the best chain from a trusted Zebra node's RPC methods.
#[derive(Debug)]
Expand Down
14 changes: 13 additions & 1 deletion zebrad/tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,14 @@ async fn trusted_chain_sync_handles_forks_correctly() -> Result<()> {
.await?
.map_err(|err| eyre!(err))?;

// Submit some blocks on the best chain
// TODO:
// - Submit blocks while checking that `ChainTipChange` shows the chain growing before submitting the next block
// - Submit several blocks before checking that `ChainTipChange` has the latest block hash and is a `TipAction::Reset`
// - Check that `getblock` RPC returns the same block as the read state for every height
// - Submit more blocks with an older block template (and a different nonce so the hash is different) to trigger a chain reorg
// - Check that `ChainTipChange` isn't being updated until the best chain changes
// - Check that the first `ChainTipChange` `TipAction` is a `TipAction::Reset`
// - Check that `getblock` RPC returns the same block as the read state for every height

child.kill(false)?;
let output = child.wait_with_output()?;
Expand All @@ -3208,5 +3215,10 @@ async fn trusted_chain_sync_handles_forks_correctly() -> Result<()> {

output.assert_failure()?;

// TODO:
// - Start another Zebra testchild on Testnet or Mainnet
// - Wait for it to start syncing blocks from the network
// - Check that `LatestChainTip` is being updated with the newly synced finalized blocks

Ok(())
}

0 comments on commit 0d1f434

Please sign in to comment.