Repository navigation
refactor(contracts): consolidate GRACE_PERIOD into mergefi-common (Fixes #874, #877) - #893
Closed
kleitonbernardino-lab wants to merge 1 commit into
Closed
kleitonbernardino-lab wants to merge 1 commit into
kleitonbernardino-lab wants to merge 1 commit into
Conversation
MergeFi#874, MergeFi#877) Signed-off-by: Kleiton Bernardino <kleiton.bernardino@gmail.com>
|
@kleitonbernardino-lab is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #874, #877.
Consolidates the protocol-level
GRACE_PERIODconstant intomergefi-commonalongside existing shared constants (BPS_DENOMINATOR,MAX_SPONSORS,MAX_RECIPIENTS,MAX_SPONSORS_LIMIT,MAX_FEE_CHANGE_BPS), and documents the architectural rationale for keepingCONTRACT_VERSIONscoped per contract.Rationale
GRACE_PERIOD: A protocol-wide guarantee to sponsors ("permissionless exit is unlocked 14 days after deadline"). Previously declared independently incontracts/escrow/src/lib.rsandcontracts/milestones/src/lib.rs, creating risk of divergence. Moving it tomergefi-commonand re-exporting it aspub use mergefi_common::GRACE_PERIOD;ensures single source of truth while maintaining 100% backward compatibility for callers and internal test references (crate::GRACE_PERIOD,client.get_grace_period()).CONTRACT_VERSION: Evaluated as requested in The three contracts declare GRACE_PERIOD and CONTRACT_VERSION independently instead of in mergefi-common, where the shared constants already live #874/The three contracts declare GRACE_PERIOD and CONTRACT_VERSION independently instead of in mergefi-common, where the shared constants already live #877. Storage schemas evolve independently across contracts (e.g., modifyingEscrowlayout does not necessitate migrations inMilestonesorMaintenancePool). Documented indocs/upgrade-storage-migration-design.mdwhyCONTRACT_VERSIONremains independently declared per contract.Changes
pub const GRACE_PERIOD: u64 = 14 * 24 * 60 * 60;incontracts/common/src/lib.rs.contracts/escrow/src/lib.rsandcontracts/milestones/src/lib.rswithpub use mergefi_common::GRACE_PERIOD;.### Independent Contract Versioningsection todocs/upgrade-storage-migration-design.md.Verification
14 * 24 * 60 * 60= 1,209,600s).get_grace_periodentrypoints return the re-exported constant.