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

project configs #233

Merged
merged 211 commits into from
Nov 24, 2023
Merged

project configs #233

merged 211 commits into from
Nov 24, 2023

Conversation

f-gate
Copy link
Member

@f-gate f-gate commented Oct 1, 2023

supersedes: old pr.

High level change log

  • Introduction of fields refund_locations, FundingPath, Jury and refunded_funds to Project.
  1. The use of refund locations allows us to specify refund locations other than local and other than the contributors, this allows us to unify the refund logic and remove FundingType.
  2. FundingPath Is used as a indicator of where the funds are coming from the two avaliable types so far are TakeFromReserved and WaitForFunding. This allows us to specify logic for any kind of funding instead of restricting ourselfs by the FundingType
  3. Jury Is the key for allowing refunds to take place "fairly" (can be improved) the jury is responsible for voting on disputes, it is set on instantiation of a Project generally in another pallet.
  • Removal of FundingType
  • No confidence logic has been completely removed from pallet-proposals bar a migration. This means that apis will break on this upgrade. There is a new extrinsic called raise_dispute which then is voted upon using pallet-disputes. Once this passes (or fails) the result is returned back to pallet-proposals which allows the funding party to call for a refund using the refund extrinsic.
  • The introduction of TransferStatus field on each milestone which has the available types Refunded and Withdrawn, it also conatins the BlockNumber this happened on.
  • General refactor of pallet-proposals tests. Due to the removal of FundingType and introduction of FundingPath a major refactor was required.
  • Added bounds to IntoProposal which allows for error handling in the pallets which call the method instead of inside the pallet-proposals implementation. This has much room for improvement.
  • Introduction of the Locality<AccountId> type so we can easily unify refunds in refund_locations
  • pallet-disputes has been implemented into the runtime and linked up with pallet-proposals this implementation was dependant on the Jury changes, fellowship-pallet etc.
  • New tests for all the shiny refund and dispute logic.
  • The PointerBasedJurySelector type see Tests for PointerBasedJurySelector #276.

Extrinsic changes

Removed

raise_vote_of_no_confidence
vote_vote_of_no_confidence_round
finalise_vote_of_no_confidence
thanks @mshankarrao

Added

/// Attempt a refund of 
/// Will only refund milestones that have can_refund set to true.
 pub fn refund(
            origin: OriginFor<T>,
            project_key: ProjectKey,
        )
// Raise a dispute using the handle DisputeRaiser in the Config.
pub fn raise_dispute(
            origin: OriginFor<T>,
            project_key: ProjectKey,
            milestone_keys: BoundedVec<MilestoneKey, T::MaxMilestonesPerProject>,
          )
/// Vote on a dispute that already 
/// If all votes are unanimous and everyone has voted, the dispute is autofinalised
pub fn vote_on_dispute(
            origin: OriginFor<T>,
            dispute_key: T::DisputeKey,
            is_yay: bool,
        )
/// Force a dispute to fail.
/// Must be called by T::ForceOrigin
/// We have a seperate force_fail and force_succeed extrinsics as the two paths may be of vastly different weight.
pub fn force_fail_dispute(
    origin: OriginFor<T>,
    dispute_key: T::DisputeKey,
)
/// Force a dispute to pass.
/// Must be called by T::ForceOrigin.
pub fn force_succeed_dispute(
    origin: OriginFor<T>,
    dispute_key: T::DisputeKey,
)
/// Extend a given dispute by T::VotingTimeLimit.
/// This can only be called once and must be called by a member of the jury.
pub fn extend_dispute(origin: OriginFor<T>, dispute_key: T::DisputeKey)

Migrations

pallet_proposals::MigrateToV7
pallet_fellowship::MigrateInitial

Api changes

With the removal of the no confidence logic one needs to navigate the new pallet-dispute extrinsic. Unfortunately this is a massively breaking change and may require you to restructure your api logic so apologies in advance.
Any questions just drop me a message and we can get on a call.

@f-gate f-gate marked this pull request as ready for review November 24, 2023 13:34
@samelamin samelamin force-pushed the only-project-config branch 2 times, most recently from abf4775 to 71b03fd Compare November 24, 2023 14:32
@f-gate f-gate merged commit a78759c into main Nov 24, 2023
2 checks passed
@f-gate f-gate deleted the only-project-config branch November 24, 2023 23:16
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