Skip to content

Commit

Permalink
fixes and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wacban committed Oct 31, 2023
1 parent 7d55c5b commit 3e8fd0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chain/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,16 @@ impl Client {
}

let new_chunks = self.get_chunk_headers_ready_for_inclusion(&epoch_id, &prev_hash);
debug!(target: "client", "{:?} Producing block at height {}, parent {} @ {}, {} new chunks: {:?}", validator_signer.validator_id(),
next_height, prev.height(), format_hash(head.last_block_hash), new_chunks.len(), new_chunks.keys().sorted());
debug!(
target: "client",
validator=?validator_signer.validator_id(),
next_height=next_height,
prev_height=prev.height(),
prev_hash=format_hash(head.last_block_hash),
new_chunks_count=new_chunks.len(),
new_chunks=?new_chunks.keys().sorted().collect_vec(),
"Producing block",
);

// If we are producing empty blocks and there are no transactions.
if !self.config.produce_empty_blocks && new_chunks.is_empty() {
Expand Down
10 changes: 10 additions & 0 deletions integration-tests/src/tests/client/resharding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1390,49 +1390,59 @@ fn test_shard_layout_upgrade_missing_chunks_high_missing_prob_v1() {

// V2, low missing prob

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_low_missing_prob_v2_seed_42() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.1, 42);
}

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_low_missing_prob_v2_seed_43() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.1, 43);
}

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_low_missing_prob_v2_seed_44() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.1, 44);
}

// V2, mid missing prob

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_mid_missing_prob_v2_seed_42() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.5, 42);
}

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_mid_missing_prob_v2_seed_43() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.5, 43);
}

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_mid_missing_prob_v2_seed_44() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.5, 44);
}

// V2, high missing prob

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_high_missing_prob_v2_seed_42() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.9, 42);
}

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_high_missing_prob_v2_seed_43() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.9, 43);
}

#[cfg(feature = "protocol_feature_simple_nightshade_v2")]
#[test]
fn test_shard_layout_upgrade_missing_chunks_high_missing_prob_v2_seed_44() {
test_shard_layout_upgrade_missing_chunks(ReshardingType::V2, 0.9, 44);
Expand Down

0 comments on commit 3e8fd0e

Please sign in to comment.