feat: add slippage floor validation for RocketPool STAKE and SWAP#21
feat: add slippage floor validation for RocketPool STAKE and SWAP#21ajag408 wants to merge 6 commits into
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR hardens the project's supply chain and CI/CD pipelines by adding runner hardening and Socket firewall checks across all GitHub Actions jobs, modernizing pnpm installation via corepack, and updating code ownership rules. Additionally, it introduces an 80% slippage-floor validation constraint in RocketPoolValidator to protect against low-slippage STAKE and LI.FI swaps, backed by comprehensive test coverage. ChangesSupply-Chain & CI/CD Hardening
RocketPoolValidator Slippage-Floor Protection
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary by CodeRabbit
New Features
Tests
Chores
minTokensOuton STAKE and_minAmountOuton SWAP in the RocketPool validatorminTokensOut > 0(STAKE) and validated_receiver(SWAP) — a compromised upstream could setminTokensOut = 1 weion a 1 ETH stake and pass validation, exposing the transaction to MEV sandwich extractionWhat changed
src/validators/evm/rocketpool/rocketpool.validator.tsSLIPPAGE_FLOOR_BPSconstant, slippage check invalidateStake,_minAmountOut > 0+ slippage check invalidateLifiSwapReceiver(with Single/Multiple variant handling)src/validators/evm/rocketpool/rocketpool.validator.test.tsSecurity context
Addresses the slippage parameter manipulation gap identified in the Shield security review. Unlike the
args.amountvalidation (Phase 6), this fix is independently shippable because both the input (tx.value/fromAmount) and output floor (minTokensOut/_minAmountOut) are already present in the transaction calldata.Threat model: requires a compromised upstream API (consistent with Shield's threat model). The validator remains fail-closed — unknown LI.FI function selectors are blocked, not bypassed.
Test plan
_minAmountOutblocked on SWAPfromAmountsumming, slippage floormain)