KeeperHub / KeeperHub/keeperhub
fix(execute): protocol action route silently ignores `simulate` and broadcasts real transactions
- Dominant language
- TypeScript
- Stars
- 24
- Forks
- 93
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 266
Description
**Expected**
`simulate: true` behaves uniformly across `/api/execute/*`. On `contract-call` it works: returns `wouldRevert` / `revertReason` / `gasEstimate`, nothing broadcast.
**Actual**
`POST /api/execute/{protocol}/{action}` (e.g. `aave-v3/supply`) has no simulate support. `simulate: true` in the body is accepted without complaint, and a call that passes gas estimation broadcasts for real.
This is a serious trap for LLM agents specifically: an agent learns "dry-run with `simulate: true` first" on `contract-call`, generalizes it to the protocol route, and its "dry run" moves real funds with a success response. Silently accepting a safety flag is worse than not having it.
**Repro** (WARNING: broadcasts if it passes gas estimation — use a throwaway org)
```bash
curl -s -X POST https://app.keeperhub.com/api/execute/aave-v3/supply \
-H "Authorization: Bearer $KH_KEY" -H "Content-Type: application/json" \
-d '{"chainId":11155111,"asset":"0x","amount":"","onBehalfOf":"0x","referralCode":"0","simulate":true}'
# -> real execution despite simulate:true
```
**Proposed fix**
In `app/api/execute/[...slug]/route.ts`:
- preferably: implement `simulate` for protocol actions with the same semantics as `contract-call`;
- at minimum: strict-parse the body and return 400 `"simulate is not supported on protocol actions"` when the flag is present.
Docs: prominent warning on the protocol-actions page until parity ships.
Severity: funds-risk. Observed on `app.keeperhub.com`, 2026-08-04.
Contributor guide
Research direction
Start in app/api/execute/[...slug]/route.ts and compare protocol-action handling with the existing contract-call simulate behavior. Verify that simulate: true cannot broadcast a real transaction: either protocol actions provide the same simulation fields or return the specified 400 response. Check the protocol-actions documentation for the required warning until parity exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, blockchain, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100