Skip to content

Feat/p3 staking - #65

Open
robertocarlous wants to merge 3 commits into
InfiniteZeroFoundation:developfrom
robertocarlous:feat/p3-staking
Open

Feat/p3 staking#65
robertocarlous wants to merge 3 commits into
InfiniteZeroFoundation:developfrom
robertocarlous:feat/p3-staking

Conversation

@robertocarlous

Copy link
Copy Markdown
Collaborator

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.

… 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.
@robertocarlous

Copy link
Copy Markdown
Collaborator Author

Hi @umeradl

Pls can you check this

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.

1 participant