Skip to content

Commit

Permalink
Modify migration to disable collator rotation by default (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpolaczyk authored Oct 31, 2023
1 parent 9c9df19 commit 8f95799
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions runtime/dancebox/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ where
min_orchestrator_collators: old_config.min_orchestrator_collators,
max_orchestrator_collators: old_config.max_orchestrator_collators,
collators_per_container: old_config.collators_per_container,
full_rotation_period: 24,
full_rotation_period: 0,
};
frame_support::storage::unhashed::put(CONFIGURATION_ACTIVE_CONFIG_KEY, &new_config);

Expand All @@ -267,7 +267,7 @@ where
min_orchestrator_collators: old_config.min_orchestrator_collators,
max_orchestrator_collators: old_config.max_orchestrator_collators,
collators_per_container: old_config.collators_per_container,
full_rotation_period: 24,
full_rotation_period: 0,
};
new_pending_configs.push((session_index, new_config));
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/dancebox/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3631,12 +3631,12 @@ fn test_migration_config_full_rotation_period() {
min_orchestrator_collators: 2,
max_orchestrator_collators: 5,
collators_per_container: 2,
full_rotation_period: 24,
full_rotation_period: 0,
};
assert_eq!(Configuration::config(), expected_active);

let expected_pending = vec![
(2225, pallet_configuration::HostConfiguration { max_collators: 99, min_orchestrator_collators: 2, max_orchestrator_collators: 5, collators_per_container: 2, full_rotation_period: 24 }), (2226, pallet_configuration::HostConfiguration { max_collators: 100, min_orchestrator_collators: 2, max_orchestrator_collators: 5, collators_per_container: 2, full_rotation_period: 24 })
(2225, pallet_configuration::HostConfiguration { max_collators: 99, min_orchestrator_collators: 2, max_orchestrator_collators: 5, collators_per_container: 2, full_rotation_period: 0 }), (2226, pallet_configuration::HostConfiguration { max_collators: 100, min_orchestrator_collators: 2, max_orchestrator_collators: 5, collators_per_container: 2, full_rotation_period: 0 })
];
assert_eq!(Configuration::pending_configs(), expected_pending);
});
Expand Down

0 comments on commit 8f95799

Please sign in to comment.