Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Introduce add_memo for Crowdloans #2728

Merged
7 commits merged into from
Mar 27, 2021
Merged

Introduce add_memo for Crowdloans #2728

7 commits merged into from
Mar 27, 2021

Conversation

shawntabrizi
Copy link
Member

@shawntabrizi shawntabrizi commented Mar 26, 2021

This PR introduces an additional extrinsic where a user can place some additional "memo" to a crowdloan contribution they have made.

The main reason to use this is to specify some other account that should receive the token distribution for a crowdloan you participated in.

cc @JoshOrndorff @xlc @jacogr

@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Mar 26, 2021
@JoshOrndorff
Copy link
Contributor

This approach satisfies Moonbeam's needs 👍

Out of curiosity, what's the advantage of having a separate extrinsic as opposed to including the memo with the original contribution?

cc @girazoki

@shawntabrizi
Copy link
Member Author

shawntabrizi commented Mar 26, 2021

Every contribution would require the memo, taking up space in the tx and causing larger fees. Also in terms of separation of concerns, we have written tests for and audited code as it was. Creating a new function isolates new code and how it can interact with the system.

@shawntabrizi shawntabrizi added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Mar 26, 2021
@tolak
Copy link

tolak commented Mar 27, 2021

Nice job shawn, I think some community also need this features. There is a scenario that two third party community contribute to one parachain crowdloan, the community may distribute their own community token to user who participated this auction, then they can add memo to identify which user belong to their community that can get community token reward.

Besides, is it possible to include memo as an argument in extrinsic contribute and put it into event RawEvent::Contributed rather than save it into child trie? Or maybe need a query extrinsic to get the memo of a contribution.

@shawntabrizi
Copy link
Member Author

@tolak why would this information need to be in an event?

I already mentioned why this information is not coupled directly with a contribute extrinsic.

@tolak
Copy link

tolak commented Mar 27, 2021

@shawntabrizi Maybe for the client who wants to catch memo just like ParaId, Account and Amount by event without query the child trie. I am not sure if we already have interface for client to get the memo of a contribution.

@shawntabrizi
Copy link
Member Author

shawntabrizi commented Mar 27, 2021

@tolak is this a hypothetical request, or you actually need this?

I will add it because I don't see a big reason not to, but i dont suspect people will use it. Getting the data from the child trie is how it should be used at the end of a crowdloan.

@shawntabrizi
Copy link
Member Author

bot merge

@ghost
Copy link

ghost commented Mar 27, 2021

Trying merge.

@ghost ghost merged commit f963394 into master Mar 27, 2021
@ghost ghost deleted the shawntabrizi-crowdloan-memo branch March 27, 2021 16:36
shawntabrizi added a commit that referenced this pull request Mar 27, 2021
* Add memo, but don't use it yet

* add_memo

* add weights

* Update lib.rs

* Update crowdloan.rs

* add event
rphmeier pushed a commit that referenced this pull request Mar 27, 2021
* Check that Para is Registered before Accepting a Bid (#2656)

* Check that para is registered before accepting a bid

* Update lib.rs

* Update lib.rs

* remove println

* fix benchmarks

* Update runtime/common/src/auctions.rs

Co-authored-by: Kian Paimani <[email protected]>

Co-authored-by: Kian Paimani <[email protected]>

* Parachain Onboarding Extras (#2713)

* clear_lease

* schedule upgrade and downgrade

* fix compile

* comments

* Fix Crowdloan Withdraw Requirements (#2723)

* prevent crowdloan withdraw from being griefed

* Update crowdloan.rs

* Update runtime/common/src/crowdloan.rs

* Update runtime/common/src/crowdloan.rs

* Introduce `add_memo` for Crowdloans (#2728)

* Add memo, but don't use it yet

* add_memo

* add weights

* Update lib.rs

* Update crowdloan.rs

* add event

* Handle Onboarding in Current Lease Period (#2731)

* Lease out current period and trigger onboard

* Add test for trigger_onboard

* patch and add benchmark

* finish benchmarks

* Use result instead of panic for test_registrar

* nits

* bump spec +2

* Remove Parachains Stuff from Westend (#2689)

* Remove Parachains Stuff from Westend

* remove unused weights

* clean up genesis

Co-authored-by: Kian Paimani <[email protected]>
@gui1117 gui1117 added D1-audited 👍 PR contains changes to critical logic that has been properly reviewed and externally audited. and removed D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Apr 12, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D1-audited 👍 PR contains changes to critical logic that has been properly reviewed and externally audited.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants