Skip to content

Junius/fix scheduled coldkey swap back unit test#707

Merged
distributedstatemachine merged 14 commits intofeat/scheduled_coldkey_swap_backfrom
junius/fix_scheduled_coldkey_swap_back_unit_test
Aug 3, 2024
Merged

Junius/fix scheduled coldkey swap back unit test#707
distributedstatemachine merged 14 commits intofeat/scheduled_coldkey_swap_backfrom
junius/fix_scheduled_coldkey_swap_back_unit_test

Conversation

@open-junius
Copy link
Contributor

Description

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

Copy link
Collaborator

@distributedstatemachine distributedstatemachine left a comment

Choose a reason for hiding this comment

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

Please see comments

.saturating_add(T::DbWeight::get().writes(527)), DispatchClass::Operational, Pays::No))]
pub fn swap_coldkey(
origin: OriginFor<T>,
old_coldkey: T::AccountId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are you changing the signature of the the swap_coldkey function ? Does the scheduler require it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the extrinsic is just for root. we can't get the old_coldkey from Origin. No Origin can be both root and signed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not related to scheduler.

Copy link
Collaborator

Choose a reason for hiding this comment

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

makes sense, and the scheduler has root origin ? Just want to be 100% sure only root or the scheduler can call it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scheduler just accepts the call and trigger it later. scheduler not attach any origin. the root origin is from schedule_swap_coldkey function, subtensor pallet use frame_system::RawOrigin::Root.into() as origin.

T::Scheduler::schedule(
DispatchTime::At(when),
None,
63,
frame_system::RawOrigin::Root.into(),
bound_call,
)

@distributedstatemachine distributedstatemachine merged commit 16b097c into feat/scheduled_coldkey_swap_back Aug 3, 2024
@distributedstatemachine distributedstatemachine deleted the junius/fix_scheduled_coldkey_swap_back_unit_test branch August 3, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants