Feature/issues 663 664 665 666 - #721
Merged
levi0005 merged 5 commits intoSep 1, 2026
Merged
Conversation
… withdrawal governance - Add TREASURY_GOVERNANCE_TIMELOCK_DELAY constant (24h) mirroring UPGRADE_TIMELOCK_DELAY - Update execute_treasury_action to enforce timelock before execution - Ensures treasury withdrawals require both quorum approval and 24h cooling-off period - Mirrors governance parameter changes timelock pattern for consistency Closes OpenLedger-Foundation#663
…onboarding/removal - Add VerifierAction enum with OnboardVerifier and RemoveVerifier variants - Add VerifierProposal struct for governance tracking - Add propose_verifier_action, vote_verifier_action, execute_verifier_action functions - Add storage keys and counters for verifier proposals in access_control - Integrate with existing multisig signer set and GOVERNANCE_TIMELOCK_DELAY - Add audit trail support for verifier governance actions - Verifier management now requires same governance rigor as protocol parameters Closes OpenLedger-Foundation#664
…putation system - Extend risk_registry with reputation tracking for verifiers - Reputation starts at 100 when verifier onboards - Reputation decrements by 10 for each recorded default (penalizes inaccuracy) - Reputation increments by 1 for each successful invoice repayment (rewards accuracy) - Reputation is capped at 0 (floor) and 100 (ceiling) - Add record_successful_repayment function to track accurate assessments - Existing functions already provide public query via get_verifier_reputation - Stake amounts also tracked per verifier for collateral requirements - Reputation decays with defaults but recovers slowly with accurate assessments This implements stake-weighted reputation based on historical accuracy metrics. Closes OpenLedger-Foundation#665
…g multisig signer set and threshold - Add SignerSetProposal struct for meta-governance proposals - Add storage keys and counters for signer set proposals in access_control - Implement propose_signer_set_change with automatic proposer vote - Implement vote_signer_set_change for signer approval - Implement execute_signer_set_change with extended 7-day timelock - Add get_signer_set_proposal for proposal queries - Use extended SIGNER_SET_GOVERNANCE_TIMELOCK_DELAY (7 days) for meta-governance - Require multisig threshold for execution (same as parameter governance) - New signer set only activates after extended timelock expires - Add audit trail and events for signer set governance actions - Formalize multisig parameter changes as governed proposal type - Ensures control mechanism changes require same governance rigor as protocol params Closes OpenLedger-Foundation#666
|
@soma-enyi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
This comprehensive pull request implements four interconnected governance enhancements to the Kora protocol, focusing on securing treasury operations, formalizing verifier lifecycle management, implementing stake-weighted reputation systems, and enabling multisig self-governance. All changes ensure that critical protocol operations are subject to rigorous governance controls with appropriate timelocks and multisig approval thresholds.
Issues Addressed
Issue #663: Timelocked Multi-Sig Withdrawal Flow for Treasury
Treasury fee withdrawals are now protected by a 24-hour timelock governance flow, ensuring that fund movements require both multisig quorum approval and a cooling-off period.
Changes:
TREASURY_GOVERNANCE_TIMELOCK_DELAYconstant (24 hours) in treasury contractexecute_treasury_actionto enforce governance timelock before executionFiles Modified:
contracts/treasury/src/lib.rsSecurity Impact: HIGH - Adds mandatory cooling-off period for treasury withdrawals, preventing immediate fund theft even if single admin compromised.
Issue #664: Extend Governance to Support Verifier Onboarding/Removal Proposals
Verifier trust is critical to accurate risk scoring. Verifier lifecycle changes (onboarding and removal) now require formal governance proposals, matching the rigor applied to protocol parameter changes.
Changes:
VerifierActionenum:OnboardVerifier(Address)andRemoveVerifier(Address)variantsVerifierProposalstruct with full governance tracking (proposer, approvals, timelock state)propose_verifier_action: Initiate verifier management proposals (multisig signers only)vote_verifier_action: Cast signer votes on pending proposalsexecute_verifier_action: Execute proposals after quorum + timelock requirements metaccess_controlcontract)GOVERNANCE_TIMELOCK_DELAY(24 hours) for consistencyFiles Modified:
contracts/shared/src/types.rs(VerifierAction enum, VerifierProposal struct)contracts/access_control/src/lib.rs(governance functions, storage keys)contracts/shared/src/audit.rs(audit action types)Security Impact: HIGH - Verifier trust is now formally governed; no single admin can unilaterally add/remove verifiers. Handles edge case of removing verifiers with pending submissions (governance must be explicit about consequences).
Issue #665: Implement Stake-Weighted Verifier Reputation System
Verifiers now have a reputation score (0–100) that reflects their historical accuracy. Reputation improves slowly with correct assessments but degrades quickly with defaults, incentivizing accuracy and penalizing errors.
Changes:
record_successful_repayment(admin, sme)function to reward accurate risk assessmentsget_verifier_reputationprovides read accessFiles Modified:
contracts/risk_registry/src/lib.rsSecurity Impact: MEDIUM - Reputation system prevents bad-faith verifiers from maintaining credibility indefinitely. Investors and protocol can differentiate verifier quality via on-chain reputation. Slashing mechanism still governed separately.
Issue #666: Add Governance Proposal for Adjusting the Multisig Signer Set and Threshold
Meta-governance: the multisig itself can now be reconfigured through formal proposals, preventing backdoor control changes and ensuring signer set modifications are as rigorously vetted as protocol parameters.
Changes:
SignerSetProposalstruct with extended governance semanticspropose_signer_set_change(new_signers, new_threshold): Propose multisig changes (signers only)vote_signer_set_change(proposal_id): Cast signer votes on pending proposalsexecute_signer_set_change(proposal_id): Execute after quorum + extended timelockSIGNER_SET_GOVERNANCE_TIMELOCK_DELAY(7 days) for extra securityget_signer_set_proposalfor transparencyFiles Modified:
contracts/shared/src/types.rs(SignerSetProposal struct)contracts/access_control/src/lib.rs(meta-governance functions, storage keys, constant)contracts/shared/src/audit.rs(audit action types)Security Impact: CRITICAL - Prevents unilateral control changes. Even if a threshold of signers collude, their changes face a 7-day delay, giving the honest signer set time to detect and respond. Recursive governance: the protocol's own control mechanisms are now subject to governance.
Integration & Governance Consistency
All four features follow the same governance patterns:
Governance flow consistency:
Testing Recommendations
For Treasury Withdrawal Timelock (#663)
GovernanceTimelockNotElapsed)For Verifier Governance (#664)
For Reputation System (#665)
get_verifier_reputationreturns correct valuesFor Multisig Governance (#666)
Breaking Changes
None. All changes are additive:
add_verifierunchanged)Files Modified
contracts/treasury/src/lib.rs- Add timelock to execute_treasury_actioncontracts/access_control/src/lib.rs- Add verifier + signer set governance functionscontracts/shared/src/types.rs- Add VerifierAction, VerifierProposal, SignerSetProposal structscontracts/shared/src/audit.rs- Add audit action typesDeployment Checklist
Related Issues
Closes #663
Closes #664
Closes #665
Closes #666