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

Flow pallet major changes #87

Merged
merged 1 commit into from
Aug 15, 2022
Merged

Flow pallet major changes #87

merged 1 commit into from
Aug 15, 2022

Conversation

vovacha
Copy link
Contributor

@vovacha vovacha commented Aug 12, 2022

Refactoring reasons: SBP-authored issues (storage, error handling), common naming convention (state names, errors, events, etc.)

Flow new features:

  • Added optional start parameter for create_campaign and scheduled campaign activation flow: Add start block to campaign creation  #71
  • Added MinCampaignDeposit (first iteration: 10% of target and 1:1 GAME-to-PLAY conversion). Next iteration with oracles.
  • Added CampaignDurationLimits. Runtime configured using 24 hours - 60 days interval.

Flow refactoring:

  • Campaign settlement logic was rewritten (different approach, no more Finalizing and Reverting states).
  • Removed update_state extrinsic, discussion -> Flow pallet #84 (reply in thread).
  • Complexity for create_campaign reduced: O(log N) -> O(1).
  • Campaign id generation: hash of campaign object instead of hash of nonce (same approach for proposals).
  • Changed type Campaign.created Timestamp -> BlockNumber, discussion -> Unixtime #82 (reply in thread)
  • Removed redundant storage, discussion -> SBP: Storage usage #53 (comment) and SBP: Flow #56
  • Removed redundant errors.
  • Error handling changes due to SBP: Error Handling #54
  • Naming changes (campaign states look similar to proposal states now, event names, storage names, etc.)
  • Benchmarks, tests, mocks.

Signal minor changes:

  • Mostly validation changes and fix for Withdrawal proposal actions.

Discussion:

  • How to handle the old migrations @vasylenko-yevhen ? I've commented it for now.
  • There is no single approach dealing with on_finalize and on_initialize hooks. Currently, Signal uses mostly on_finalize for calculations and Flow, on the contrary on_initialize (probably I'll create a discussion).

TODO:

@vovacha vovacha changed the title Flow pallet major update, minor Signal changes Flow pallet major updates Aug 12, 2022
@vovacha vovacha changed the title Flow pallet major updates Flow pallet major changes Aug 12, 2022
This was linked to issues Aug 12, 2022
@vovacha vovacha requested review from vayesy and 2075 August 12, 2022 18:21
@vovacha vovacha self-assigned this Aug 12, 2022
@vovacha vovacha added the Chain label Aug 12, 2022
@vovacha vovacha marked this pull request as ready for review August 12, 2022 18:22
@vovacha vovacha merged commit 43d3db6 into release-1.1.2 Aug 15, 2022
@vovacha vovacha deleted the feature/flow-changes branch August 15, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flow: Add start block to campaign creation SBP: Flow
2 participants