Feat/p3 staking - #65
Open
robertocarlous wants to merge 3 commits into
Open
Conversation
… storage (InfiniteZeroFoundation#37) Convert MIN_STAKE and UNBONDING_PERIOD from constants to DAO-settable storage with onlyOwner setters. Add unenforced per-model stake bounds (modelMinStakeBounds) and concurrent-registration cap storage (maxConcurrentRegistrationsPerStakeUnit) — stored at platform level, enforcement in task contracts is follow-up work. Implement jailValidator (slasher-callable, extends but never shortens) and reactivate (explicit operator re-entry after jail expires and stake >= floor). Fix _syncValidatorStatus to never auto-return from Jailed — only reactivate() can clear that status. Shrink __gap from [50] to [46] for the 4 new slots.
…rt bounds (InfiniteZeroFoundation#37) 26 tests: setMinStake/setUnbondingPeriod (onlyOwner, zero-revert, storage update, no retroactive effect on in-flight withdrawals); setModelStakeBounds (round-trip, min>max revert, no effect on staking); setMaxConcurrent (round-trip, no effect on staking); full jail lifecycle (stake → jail → early reactivate fails → warp past jail → StakeBelowFloor → top-up → reactivate succeeds → isValidatorActive true); extend-never-shorten jail; jailValidator guards (onlySlasher, zero address, zero duration, blacklisted).
…finiteZeroFoundation#37) Issue InfiniteZeroFoundation#37 explicitly asks this to be documented. Stake gates eligibility only — selection above the floor is random. Weighting is rejected because it concentrates work in whales, weakens the cross-validator median, and creates a centralisation feedback loop inconsistent with DIN's federated model.
Collaborator
Author
|
Hi @umeradl Pls can you check this |
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
Governable parameters (§5a): MIN_STAKE and UNBONDING_PERIOD converted from compile-time constants to DAO-settable storage variables. Values are set to their existing defaults (10 DIN, 7 days) in initialize() so behaviour is unchanged on fresh deploy. New setters: setMinStake() and setUnbondingPeriod(), both onlyOwner and guarded against zero values. minStake() updated from pure to view. Changing UNBONDING_PERIOD does not retroactively affect any in-flight pending withdrawal whose withdrawAvailableAt was already computed.
Inert stake-bounds storage (§5b): Added modelMinStakeBounds mapping (keyed by model ID, stores min/max uint256) and maxConcurrentRegistrationsPerStakeUnit (uint256). Both are stored at the platform level and settable by the owner now; wiring them into task-contract GI registration enforcement is explicit follow-up work.
Real jailing (§5c): jailValidator(address, uint64 duration, bytes32 reason) — callable by registered slasher contracts, sets status to Jailed, extends an existing jail but never shortens it. reactivate() — explicit operator call after jail expires and stake is at or above the current floor; no silent auto-return to Active. Fixed _syncValidatorStatus to always return early when status is Jailed — only reactivate() can clear that state.