From 7d0473ade740fc3ce0222e3179bb9e21b4604df0 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 15 Mar 2026 10:47:36 +0000 Subject: [PATCH] fix: fix: red-team prompt missing evm_increaseTime for TWAP-enforced recenter (#823) Co-Authored-By: Claude Sonnet 4.6 --- scripts/harb-evaluator/red-team.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/harb-evaluator/red-team.sh b/scripts/harb-evaluator/red-team.sh index 4eb999c..6837afb 100755 --- a/scripts/harb-evaluator/red-team.sh +++ b/scripts/harb-evaluator/red-team.sh @@ -131,8 +131,9 @@ log "Recentering to deploy funded WETH into positions ..." "$CAST" send "$LM" "recenter()" \ --private-key "$RECENTER_PK" --rpc-url "$RPC_URL" >/dev/null 2>&1 \ || log " WARNING: initial recenter failed (may need amplitude — mining blocks)" -# Mine blocks and retry if needed +# Advance time and mine blocks, then retry recenter for _i in $(seq 1 3); do + "$CAST" rpc evm_increaseTime 600 --rpc-url "$RPC_URL" >/dev/null 2>&1 for _b in $(seq 1 50); do "$CAST" rpc evm_mine --rpc-url "$RPC_URL" >/dev/null 2>&1 done @@ -515,6 +516,14 @@ python3 -c "b=${LM_ETH_BEFORE:-0}; a=int('\$TOTAL'); d=b-a; print(f'Delta: {d} w --private-key ${ADV_PK} --rpc-url http://localhost:8545 \`\`\` +### Advance time (REQUIRED before each recenter call) +recenter() has a 60-second cooldown AND requires 300s of TWAP oracle history. +You MUST advance time before calling recenter: +\`\`\`bash +/home/debian/.foundry/bin/cast rpc evm_increaseTime 600 --rpc-url http://localhost:8545 +for i in \$(seq 1 10); do /home/debian/.foundry/bin/cast rpc evm_mine --rpc-url http://localhost:8545; done +\`\`\` + ### Trigger recenter (account 2 only) \`\`\`bash /home/debian/.foundry/bin/cast send ${LM} "recenter()" \