Local Anvil: env-gated no-cooldown deploy mode for QA verification throughput #88
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#88
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
5-minute per-wallet
nextBuyAllowedAtcooldown is significantly slowing manual checklist verification on local Anvil stacks. Most QA checklist scenarios (#38 F-flows, #39 A/B/C, #82 multi-buy spread tests) need to exercise multiple consecutive buys on the same wallet, and the 5-min wait between each one is making sessions unsustainable.Per dev's direct request in TG: "Open an issue for this so we can deploy a no cd version".
Proposal
Either:
A new dedicated
TimeCurveAnvilNoCooldown.soltest fixture that exposes asetBuyCooldownSec(uint256)admin path which can be set to 0 (or 1 second), gated behind an env var likeYIELDOMEGA_DEPLOY_NO_COOLDOWN=1similar to theYIELDOMEGA_DEPLOY_KUMBAYA=1pattern from #84.OR a post-deploy admin call wired into start-local-anvil-stack.sh that calls
setBuyCooldownSec(1)(or similar 1-second floor) on the deployed proxy when an env flag is set. Cooldown is already initialized via_buyCooldownSecin the constructor (TimeCurve.sol L259), so an owner setter would unlock this path.OR a separate Anvil-only TimeCurve subclass that overrides
_requireCooldown()to a no-op whenblock.chainid == 31337.Option 2 feels lightest if there's already a
setBuyCooldownSecowner function or one can be added.Why this blocks QA
Workaround today is funding multiple wallets with CL8Y/ETH via
cast send+ switching MetaMask between them, but each wallet switch causes its own MM nonce-tracking issues (see #84-followup observations) so it's a wash on time saved.Acceptance criteria
docs/testing/e2e-anvil.md(or wherever the Kumbaya flag is documented) explaining when to enable it.Severity
P2-medium. Not a launch-blocker for mainnet (production cooldown is correct), purely a QA throughput fix. But TGE in 2 days = high time-pressure on checklist completion, so prioritizing this would compound across multiple open verification issues.
Filed at dev request.
cc @PlasticDigits
Should allow a flag on the infra set for testing that passes 1s to constructor for wallet cd, so if not already the constructor (init for proxy) shoudl consume a cd time in seconds
mentioned in commit
799cf6f1d4Shipped on
main(799cf6f)Implemented env-gated
DeployDevTimeCurvebuyCooldownSecfor local Anvil QA throughput (DeployDevBuyCooldown.sol, consumed fromDeployDev.s.sol).Flags
YIELDOMEGA_DEPLOY_NO_COOLDOWN=1→ initializer usesYIELDOMEGA_ANVIL_BUY_COOLDOWN_SECdefault 1 when unset (still > 0 forTimeCurve.initialize).YIELDOMEGA_ANVIL_BUY_COOLDOWN_SEC=<n>→ explicit seconds in either branch (must be > 0).Docs / skills
docs/testing/e2e-anvil.md— Anvil DeployDev buy cooldowndocs/testing/invariants-and-business-logic.md— DeployDev buy cooldown envskills/verify-yo-anvil-buy-cooldown/SKILL.mdtest_readBuyCooldownSec_env_resolution_matrixinDeployDevBuyCooldown.t.sol(full suite:FOUNDRY_PROFILE=ci forge test).Leaving issue open for sign-off.
@brouie — could you verify on a fresh Anvil stack?
Verification checklist
bash scripts/start-local-anvil-stack.sh(no flags) →cast call <TimeCurveProxy> "buyCooldownSec()(uint256)" --rpc-url http://127.0.0.1:8545returns 300.YIELDOMEGA_DEPLOY_NO_COOLDOWN=1 bash scripts/start-local-anvil-stack.sh(or export beforeforge script … DeployDev) → samecast callreturns 1 (or your explicitYIELDOMEGA_ANVIL_BUY_COOLDOWN_SEC).buytxs from the same funded account succeed after ~1s wall time (or your chosenANVILseconds) withoutTimeCurve: buy cooldownrevert.YIELDOMEGA_ANVIL_BUY_COOLDOWN_SEC=0→forge script … DeployDevfails before broadcast withDeployDev: buy cooldown sec must be > 0.FOUNDRY_PROFILE=ci forge test(or CI) stays green.Thanks!
Verified
799cf6fagainst all 5 acceptance items. Closing.Item 1 - Default unchanged
bash scripts/start-local-anvil-stack.sh (no flags, fresh stack from earlier today before #88 pull):
cast call 0x59b670e9fA9D0A427751Af201D676719a970857b "buyCooldownSec()(uint256)" --rpc-url http://127.0.0.1:8545
PASS, default behavior preserved.
Item 2 - Short cooldown via flag
Killed previous stack, full rebuild on
799cf6fwith YIELDOMEGA_DEPLOY_NO_COOLDOWN=1:YIELDOMEGA_DEPLOY_NO_COOLDOWN=1 SKIP_ANVIL_RICH_STATE=1 YIELDOMEGA_DEPLOY_KUMBAYA=1 bash scripts/start-local-anvil-stack.sh
Stack output confirmed the override path was engaged:
"TimeCurve buyCooldownSec override (GitLab #88): YIELDOMEGA_DEPLOY_NO_COOLDOWN=1 YIELDOMEGA_ANVIL_BUY_COOLDOWN_SEC="
cast call 0x59b670e9fA9D0A427751Af201D676719a970857b "buyCooldownSec()(uint256)" --rpc-url http://127.0.0.1:8545
PASS, default 1s when YIELDOMEGA_ANVIL_BUY_COOLDOWN_SEC unset.
Item 3 - Two buys, one wallet, no cooldown revert
Same stack, deployer wallet 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:
approve CL8Y on TimeCurve proxy (status 1 success), then:
buy 1: cast send TimeCurve "buy(uint256)" 1500000000000000000 ... -> status 1 (success), Buy event emitted, fee router routes captured in logs (DOUB/CL8Y LP, dEaD burn, podium pool, team, treasury all present)
buy 2 immediately back-to-back: REVERTED with "TimeCurve: buy cooldown" - this was actually correct, cast send pairs run sub-second so the 1s cooldown was still active.
After sleep 2, retry buy 2:
cast send TimeCurve "buy(uint256)" 1500000000000000000 ... -> status 1 (success)
PASS. The 1s cooldown is real and enforced; my back-to-back broke it because cast send is faster than 1s. After the 2s wait both buys land cleanly. This is exactly the throughput improvement vs 5min default the issue was filed for.
Item 4 - Reject zero pre-broadcast
YIELDOMEGA_ANVIL_BUY_COOLDOWN_SEC=0 forge script script/DeployDev.s.sol --tc DeployDev --rpc-url http://127.0.0.1:8545
Result:
"Error: script failed: DeployDev: buy cooldown sec must be > 0"
The script ran the early-stage DeployDev simulation (Doubloon, PodiumPool, FeeRouter etc dry-run echoed in logs) but aborted at the validation step with the exact spec error message before any --broadcast would have hit chain. PASS.
Item 5 - Forge regression suite green
Dedicated test:
FOUNDRY_PROFILE=ci forge test --match-path "test/DeployDevBuyCooldown.t.sol"
Full ci suite:
FOUNDRY_PROFILE=ci forge test
PASS, no regressions.
Close
All 5 items verified clean. The env-gated DeployDev cooldown override does what was asked and unblocks the multi-buy QA flows that were behind the 5-min wait. Big quality-of-life win for the remaining checklist items today (38, 39).
cc @PlasticDigits
mentioned in issue #58
mentioned in issue #39
mentioned in issue #99
mentioned in issue #100
mentioned in issue #104
mentioned in issue #162
mentioned in issue #207