Description
Admin fee changes in fees.rs apply immediately on the next block, letting an admin front-run their own change against pending bets. Add a two-step commit-reveal: admin commits a hash of the new fee config first, then after a minimum delay reveals it. Bets in the delay window are settled under the old config.
Requirements and Context
- Commit stores
BytesN<32> hash and the committed_at ledger
- Reveal verifies preimage and applies after
min_delay_ledgers
- Re-commit overwrites pending commit
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b feature/fee-config-commit-reveal
- Implement changes
contracts/predictify-hybrid/src/fees.rs
contracts/predictify-hybrid/src/tests/fee_config_commit_reveal_tests.rs
- Test and commit
cargo test -p predictify-hybrid fee_config_commit_reveal
- Cover edge cases
- Include test output and notes in the PR
Example commit message
feat: add commit-reveal scheme for FeeConfigManager updates
Acceptance Criteria
Guidelines
- Validate auth, overflow, and storage TTL/archival
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
Admin fee changes in
fees.rsapply immediately on the next block, letting an admin front-run their own change against pending bets. Add a two-step commit-reveal: admin commits a hash of the new fee config first, then after a minimum delay reveals it. Bets in the delay window are settled under the old config.Requirements and Context
BytesN<32>hash and thecommitted_atledgermin_delay_ledgersSuggested Execution
contracts/predictify-hybrid/src/fees.rscontracts/predictify-hybrid/src/tests/fee_config_commit_reveal_tests.rscargo test -p predictify-hybrid fee_config_commit_revealExample commit message
Acceptance Criteria
Guidelines