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

Migration pallet #190

Merged
merged 3 commits into from
Oct 3, 2024
Merged

Migration pallet #190

merged 3 commits into from
Oct 3, 2024

Conversation

olegnn
Copy link
Collaborator

@olegnn olegnn commented Sep 12, 2024

No description provided.

@olegnn olegnn requested a review from lovesh September 12, 2024 15:57
/// Burns the free `DOCK` balance of the sender and emits an event containing the supplied recipient `cheqd` address.
/// By submitting this transaction, you agree to the Terms and Conditions.
#[pallet::weight(SubstrateWeight::<T::DbWeight>::migrate())]
pub fn migrate(origin: OriginFor<T>, cheqd_address: String) -> DispatchResultWithPostInfo {
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't it decided that people can migrate specified balance and not entire balance?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The last decision was to migrate the full balance.

dock_account,
cheqd_account,
dock_tokens_amount,
accepted_terms_and_conditions: true,
Copy link
Member

Choose a reason for hiding this comment

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

When would this be false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Never; this fact should just be mentioned at the event.
Alternatively, we could have this flag as a transaction parameter, and only emit an event in case it was set to true.

Copy link
Member

Choose a reason for hiding this comment

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

Whats the significance then? And if its a transaction parameter, how would the transaction behave on different values of it? Isn't calling migrate implying that caller accepts the terms?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was asked to add this field by @mike-parkhill. I guess that it has a demonstrative meaning.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I still don't understand what its demonstrating.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see you're argument that we may not need it. But, it makes the acceptance explicit rather than implicit which is generally easier to defend if we ever get called on it.

Going through the migration page we're building will make it mandatory as part of the flow, but for blockchain clients who want to submit it themselves we still need to get them to show they accept the terms and conditions somehow. This was my suggestion for how to do that. I'm open to other suggestions that achieve the same thing.

Copy link
Member

@lovesh lovesh Sep 18, 2024

Choose a reason for hiding this comment

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

With blockchain, the acceptance is always implicit, no? Eg. when you make a transfer txn, its understood that you can't ask the chain to revert that transfer. Secondly there is no way to do that txn while not accepting the terms and its not known what we would do differently if we allowed that.

Anyway, I don't think its a major problem so if it makes you feel safer or more compliant, we can go ahead with this.

pub struct Pallet<T>(_);

#[pallet::call]
impl<T: Config> Pallet<T> {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a need of a flag which prevents people from migrating unless we officially start the migration?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought we could publish the upgrade containing this pallet along with the migration start.

@olegnn olegnn merged commit e594602 into master Oct 3, 2024
4 checks passed
olegnn added a commit that referenced this pull request Oct 15, 2024
olegnn added a commit that referenced this pull request Oct 15, 2024
lovesh pushed a commit that referenced this pull request Oct 15, 2024
lovesh pushed a commit that referenced this pull request Oct 15, 2024
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.

3 participants