Skip to content

Commit

Permalink
Set epoch length in testloop
Browse files Browse the repository at this point in the history
  • Loading branch information
staffik committed Dec 23, 2024
1 parent 9b1e675 commit 85d8837
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion chain/chunks/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl ShardedTransactionPool {
/// the new shard layout.
/// It works by emptying the pools for old shard uids and re-inserting the
/// transactions back to the pool with the new shard uids.
/// TODO check if this logic works in resharding V3
/// TODO(resharding) check if this logic works in resharding V3
pub fn reshard(&mut self, old_shard_layout: &ShardLayout, new_shard_layout: &ShardLayout) {
tracing::debug!(
target: "resharding",
Expand Down
2 changes: 1 addition & 1 deletion chain/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ impl Client {
// layout is changing we need to reshard the transaction pool.
// TODO make sure transactions don't get added for the old shard
// layout after the pool resharding
// TODO check if this logic works in resharding V3
// TODO(resharding) check if this logic works in resharding V3
if self.epoch_manager.is_next_block_epoch_start(&block_hash).unwrap_or(false) {
let new_shard_layout =
self.epoch_manager.get_shard_layout_from_prev_block(&block_hash);
Expand Down
1 change: 1 addition & 0 deletions integration-tests/src/test_loop/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ impl TestLoopBuilder {
let genesis = self.genesis.as_ref().unwrap();
let epoch_config_store = self.epoch_config_store.as_ref().unwrap();
let mut client_config = ClientConfig::test(true, 600, 2000, 4, is_archival, true, false);
client_config.epoch_length = genesis.config.epoch_length;
client_config.max_block_wait_delay = Duration::seconds(6);
client_config.state_sync_enabled = true;
client_config.state_sync_external_timeout = Duration::milliseconds(100);
Expand Down
13 changes: 4 additions & 9 deletions integration-tests/src/test_loop/tests/resharding_v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ fn call_burn_gas_contract(
receiver_ids: Vec<AccountId>,
gas_burnt_per_call: Gas,
) -> LoopActionFn {
// Must be less than epoch length, otherwise transactions won't be checked.
const TX_CHECK_BLOCKS_AFTER_RESHARDING: u64 = 5;
const CALLS_PER_BLOCK_HEIGHT: usize = 5;

Expand Down Expand Up @@ -952,8 +953,7 @@ fn test_resharding_v3_delayed_receipts_right_child() {
ReceiptKind::Delayed,
))
.allow_negative_refcount(true)
// TODO(resharding): test should work without changes to num_rpcs and track_all_shards
.num_rpcs(0)
// TODO(resharding): test should work without changes to track_all_shards
.track_all_shards(true)
.build();
test_resharding_v3_base(params);
Expand Down Expand Up @@ -981,9 +981,6 @@ fn test_resharding_v3_split_parent_buffered_receipts_base(base_shard_layout_vers
vec![account_in_left_child],
ReceiptKind::Buffered,
))
// TODO(resharding): test should work without changes to num_rpcs and track_all_shards
.num_rpcs(0)
.track_all_shards(true)
.build();
test_resharding_v3_base(params);
}
Expand Down Expand Up @@ -1071,8 +1068,7 @@ fn test_resharding_v3_outgoing_receipts_from_splitted_shard() {
vec![receiver_account],
5 * TGAS,
))
// TODO(resharding): test should work without changes to num_rpcs and track_all_shards
.num_rpcs(0)
// TODO(resharding): test should work without changes to track_all_shards
.track_all_shards(true)
.build();
test_resharding_v3_base(params);
Expand Down Expand Up @@ -1146,8 +1142,7 @@ fn test_resharding_v3_yield_resume() {
vec![account_in_left_child, account_in_right_child],
ReceiptKind::PromiseYield,
))
// TODO(resharding): test should work without changes to num_rpcs and track_all_shards
.num_rpcs(0)
// TODO(resharding): test should work without changes to track_all_shards
.track_all_shards(true)
.build();
test_resharding_v3_base(params);
Expand Down

0 comments on commit 85d8837

Please sign in to comment.