[codex] add evm-only staking precompile#3616
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## codex/sei-v3-evm-only-scaffold #3616 +/- ##
==================================================================
- Coverage 58.09% 57.98% -0.11%
==================================================================
Files 2142 2152 +10
Lines 174282 175820 +1538
==================================================================
+ Hits 101247 101951 +704
- Misses 64070 64684 +614
- Partials 8965 9185 +220
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR SummaryHigh Risk Overview The executor now runs registered precompiles through a new adapter ( Staking implements create/delegate/redelegate/undelegate and queries, stores module-like state as JSON in the storage-backed store, moves payable value to a deterministic escrow address (usei-aligned, no wei remainder), and runs end-block logic for validator-set changes and mature unbonding/redelegation (returning stake from escrow). Shared helpers live under Reviewed by Cursor Bugbot for commit d9d66a8. Bugbot is set up for automated code reviews on this repo. Configure here. |
| return err | ||
| } | ||
| return insertRedelegationQueue(store, completionTime, delegator, srcValidator, dstValidator) | ||
| } |
There was a problem hiding this comment.
MaxEntries never enforced
Medium Severity
params() and defaults expose MaxEntries (7), but addUnbondingDelegation and addRedelegation always append queue entries without comparing len(record.Entries) to that limit. Undelegate/redelegate can create unbounded entry lists, unlike Cosmos staking where excess entries are rejected.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 917aa28. Configure here.
| } | ||
| if err := setValidator(ctx.Store, validator); err != nil { | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
Duplicate consensus pubkeys allowed
High Severity
createValidator only rejects duplicate operator addresses. Two validators can register the same ConsensusPubkey under different operator addresses, and end-block logic can emit multiple ValidatorUpdate values sharing one pubkey with different power.
Reviewed by Cursor Bugbot for commit 917aa28. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d9d66a8. Configure here.
| return nil, err | ||
| } | ||
| if !ok { | ||
| return nil, errValidatorMissing |
There was a problem hiding this comment.
Validator hex case breaks lookups
Medium Severity
Validator operator keys are stored with EIP-55 checksummed Hex() from the creator, but delegate, redelegate, and undelegate look up validators using the raw string argument without normalizing case. The same EVM operator with a lowercase hex string fails with validator not found even when the validator exists.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit d9d66a8. Configure here.


Summary
Adds the first SDK-free custom precompile for the evm-only executor: staking at
0x0000000000000000000000000000000000001005.This PR wires custom precompile execution into the evm-only executor, stores precompile module-like state as storage owned by the precompile address, and adds an end-block hook for staking validator-set updates and delayed redelegation/undelegation completion. It also keeps staking token handling explicitly usei-only for the evm-only path.
Details
giga/evmonly/precompiles/util.Validation
go test ./giga/evmonly/...