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

Improve referenda precompile logs #2113

Merged
merged 13 commits into from Feb 21, 2023
Merged

Conversation

tgmichel
Copy link
Contributor

What does it do?

  • Changes existing referenda precompile logs to match pallet-referenda events:
    • SubmittedAt and SubmittedAfter now include the referendumIndex instead the blockNumber.
    • DecisionDepositPlaced and DecisionDepositRefunded now include index, caller and amount. Note: records extra db read.
  • Adds SubmissionDepositRefunded log to refund_submission_deposit precompile. Note: records extra db read.

What important points reviewers should know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@tgmichel tgmichel added A0-pleasereview Pull request needs code review. B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. not-breaking Does not need to be mentioned in breaking changes labels Feb 20, 2023
@tgmichel tgmichel mentioned this pull request Feb 20, 2023
19 tasks
Copy link
Collaborator

@crystalin crystalin left a comment

Choose a reason for hiding this comment

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

Looks good on the principle. I'd like someone else to review the code

Copy link
Contributor

@4meta5 4meta5 left a comment

Choose a reason for hiding this comment

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

the refunded Events should emit deposit.who instead of caller to match the substrate events

this tells us the recipient of the refunded deposit instead of the caller (they can be different)

Feel free to dismiss this review once addressed to merge this PR for the release

@tgmichel tgmichel requested a review from 4meta5 February 21, 2023 10:39
@tgmichel tgmichel merged commit 0866b3c into master Feb 21, 2023
@tgmichel tgmichel deleted the tgm-fix-referenda-precompile-logs branch February 21, 2023 13:13
@notlesh notlesh added D1-audited👍 PR contains changes to fund-managing 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 26, 2023
imstar15 pushed a commit to OAK-Foundation/moonbeam that referenced this pull request May 16, 2023
* Fix `submit_at` `submit_after`

* Fix `place_decision_deposit`

* Fix `refund_decision_deposit`

* fmt

* Add `refund_submission_deposit` log

* Add `refund_submission_deposit` log test

* fmt

* Comments

* Improve referendum index test for `submit_at/after`

* clippy

* Fix ts tests

* Address suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview Pull request needs code review. B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants