Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(testloop): set epoch length in testloop #12664

Merged
merged 3 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actual fix

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: 5 additions & 8 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,8 +981,7 @@ 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)
// 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 @@ -1071,8 +1070,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 +1144,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have the issue of track_all_shards must be true, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

.build();
test_resharding_v3_base(params);
Expand Down
Loading