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

remove check of existing EnableRewards value set #3244

Merged
merged 2 commits into from
Nov 20, 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
6 changes: 0 additions & 6 deletions crates/pallet-subspace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ pub mod pallet {
pub enum Error<T> {
/// Solution range adjustment already enabled.
SolutionRangeAdjustmentAlreadyEnabled,
/// Rewards already active.
RewardsAlreadyEnabled,
/// Iterations are not multiple of number of checkpoints times two
NotMultipleOfCheckpoints,
/// Proof of time slot iterations must increase as hardware improves
Expand Down Expand Up @@ -1116,10 +1114,6 @@ impl<T: Config> Pallet<T> {
fn do_enable_rewards_at(
enable_rewards_at: EnableRewardsAt<BlockNumberFor<T>>,
) -> DispatchResult {
if EnableRewards::<T>::get().is_some() {
return Err(Error::<T>::RewardsAlreadyEnabled.into());
Copy link
Member

Choose a reason for hiding this comment

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

If you remove the case that triggers it, then also remove corresponding enum variant from Error, though I don't know if we need to maintain variant indices in SCALE encoding, maybe @vedhavyas knows

Copy link
Member

Choose a reason for hiding this comment

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

Its fine to remove the error variant.
Shouldn't be any scale issue within the runtime.
I dont see any usages of this variant outside runtime

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO we can remove the whole ability to set/reset rewards and solution range adjustment shortly.

}

match enable_rewards_at {
EnableRewardsAt::Height(block_number) => {
// Enable rewards at a particular block height (default to the next block after
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: Cow::Borrowed("subspace"),
impl_name: Cow::Borrowed("subspace"),
authoring_version: 0,
spec_version: 0,
spec_version: 1,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
Loading