Repository navigation
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
PR SummaryLow Risk Overview The layouts are trimmed to state that on-chain paths actually read: validators keyed by operator address (consensus-address indexes removed except Updates a gov TODO in Reviewed by Cursor Bugbot for commit 0ca730f. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Docs-only change that trims the giga staking, distribution and slashing storage proposal to the structures an on-chain path reads, keys validators by operator, and moves redelegation entries into the queue. The slot arithmetic checks out (delegations at slot 7, Validator at 15 slots, ValidatorPower in one slot) and nothing blocks; codex's reading found nothing, which agrees on blockers, and I added two small notes of my own on consistency.
Non-blocking
1 finding on the changed lines, as inline comments.
1 nit, not posted on the code
docs/giga-storage/staking-design-rationale.md:116— "lastValidatorsholds at most 100" hard-codes what is really the governance parammaxValidators, which this doc cites by name elsewhere (e.g. the gov bonded-set section).
seidroid review · decision approve · session 3fc622a813e64131ba020b173b848d11 · turn resp_claude_844c6b5607de47300dd446bcec06b634 · item b644107725d75583a1373502f44e976a
Findings: 0 blocking | 1 non-blocking | 1 posted inline
90fa425 to
717798f
Compare
|
This PR is too large for Bugbot to review. It changes 60,519 lines and 3,888,374 characters. Split the change into smaller pull requests to get a review. |
Draft storage layouts for the EVM-only staking, distribution and slashing precompiles, and the rationale behind them, taken from ffd15bb, which is not merged on its own. - staking-design-rationale.md: the proposal, built from three principles (Solidity slot layout, V2 structures for migration, rewards undesigned) - StakingStorage, DistributionStorage, SlashingStorage: draft layouts - Sets.sol: dependency-free AddressSet/UintSet with EnumerableSet's layout
… reads - Drop the consensus address: validators are keyed by operator in staking, distribution and slashing. 0x22 is keyed by the ed25519 key, for the duplicate-key check and key lookups; slashing's 0x03 relation is dropped. - Drop the enumeration sets read only by queries (0x37, unbonding and redelegations by delegator) or by entry slashing (0x33, 0x35). - Keep redelegation entries in the redelegation queue, with a per-triple count for maxEntries. - Store the bonded set as one ValidatorPower array instead of a mapping and a set. - Update the rationale doc to match, including which queue entries the FIFO clamp delays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mapping value grows at its end and needs no reserved slots. A struct inside another, a top-level struct with variables after it, and an array element cannot grow at their end; say what each can do instead, and add an open question on validatorSlashEvents, the one array of structs kept for good. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validator is a mapping value, so it grows at its end and needs no __gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alues and sets in the growth rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only queries walk signing infos, so the slashing layout keeps no enumeration of them, as the rule for enumerations says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
717798f to
01eba02
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4726 +/- ##
==========================================
- Coverage 61.41% 61.40% -0.01%
==========================================
Files 2066 2066
Lines 160953 160953
==========================================
- Hits 98849 98841 -8
- Misses 62099 62107 +8
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
V2's staking precompile serves a validator's delegations to contracts, and a set of them cannot be filled after launch, since a mapping's keys cannot be listed from its slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Adds the staking, distribution and slashing storage proposal from ffd15bb, which is not merged on its own, and simplifies it to the structures an on-chain path reads. Docs only, plus one comment in gov's
electorate.go.The first commit is the proposal as Danno Ferrin wrote it; the commits after it make the changes below.
0x22is keyed by the ed25519 key, for the duplicate-key check and for resolving a key consensus names.0x33,0x35, and unbonding delegations and redelegations by delegator.0x37is kept asdelegationsByValidator, a set of each validator's delegators. V2's staking precompile serves it to contracts asvalidatorDelegations, and a set cannot be filled after launch.ValidatorPower[]instead of a mapping and a set.Validatordrops its__gapand takes 15 slots: a mapping value grows at its end, so it needs no reserved slots.ValidatorSlashEventgets auint256[8] __gap, sincevalidatorSlashEventsis kept for good.Stack
Replaces #4713. Each PR's base is the one above it; review and merge from the top.
🤖 Generated with Claude Code