Skip to content

Commit fd17cd7

Browse files
committed
test: Restore state from two blk files
Add an extra blk file moving the state restoration from 127 blocks to 250. This requires CI to download over ~256MB per test run which, admittedly, is a bit much. The existence of this test does help me sleep better though, as ensures that the block validation rules (especially the difficulty mechanism) haven't changed, and that the wallet state is synced after applying this many blocks.
1 parent 7aae316 commit fd17cd7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

neptune-core/tests/consensus_rules_unchanged.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn genesis_block_hasnt_changed_testnet_0() {
4040
);
4141
}
4242

43-
/// test: Verify that first ~120 blocks on main net are still considered valid,
43+
/// test: Verify that first ~250 blocks on main net are still considered valid,
4444
/// and that a global state can be restored from it.
4545
#[tokio::test(flavor = "multi_thread")]
4646
async fn can_restore_from_real_mainnet_data_with_reorganizations() {
@@ -183,7 +183,7 @@ async fn can_restore_from_real_mainnet_data_with_reorganizations() {
183183

184184
logging::tracing_logger();
185185

186-
let expected_blk_files = ["blk0.dat"];
186+
let expected_blk_files = ["blk0.dat", "blk1.dat"];
187187

188188
let network = Network::Main;
189189
let cli = GenesisNode::default_args_with_network_and_devnet_wallet(network).await;
@@ -212,8 +212,9 @@ async fn can_restore_from_real_mainnet_data_with_reorganizations() {
212212
.await
213213
.unwrap();
214214
let restored_block_height = state.chain.light_state().header().height;
215+
println!("restored_block_height: {restored_block_height}");
215216
assert_eq!(
216-
BlockHeight::new(bfe!(127)),
217+
BlockHeight::new(bfe!(250)),
217218
restored_block_height,
218219
"Expected block height not reached in state-recovery. Reached: {restored_block_height}"
219220
);

0 commit comments

Comments
 (0)