LAUNCH-BLOCKER: TimeCurve.sol exceeds EIP-170 24KB cap (28,454 bytes) — DeployDev fails on Anvil #72
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#72
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?
Found Monday 2026-04-27 morning while attempting to verify #61 fix on live Anvil stack. Hard blocker for #61, #65, #66, #67, #71 verification AND mainnet deploy.
Repro
Stack reaches
=== Deploy (DeployDev) ===then exits 1. Per/tmp/yieldomega_deploy_dev.log:Direct measurement
Cap is 24,576. Overage is ~3,878 to 4,207 bytes depending on optimizer setting.
--optimizer-runs 1(used byscripts/start-local-anvil-stack.shto fit local) doesn't help. Higher runs makes it slightly larger here.Likely cause
contracts/src/TimeCurve.solgit history:Most likely culprit is
d36cccbaddingbuyFor(which TimeCurveBuyRouter calls) plus the surrounding storage / gate logic, with6d52ce6andcf6fe19adding more on top. Sunday baseline (9a183b9end of day) was probably already over but I didn't run a full stack on Sunday — only verified at source level for #55/#56. Forge tests pass (191/191) because they don't enforce EIP-170 (Anvil's--code-size-limitdefaults disable it for tests).Impact
482a25afix can't be tested because the deploy itself fails before the proxy address resolution code path even runs.Mitigations the team may want to consider
--code-size-limitAnvil flag for local testing as a stop-gap so QA can keep moving on #61, BUT this does not fix mainnetbuyFor, WarBow CL8Y gates, signoff flags) for inlining opportunities or shared internal helpersTimeCurveBuyRouterintegration so the router does more of the work and TimeCurve stays minimalI'll wait for direction before re-running the stack — running with
--code-size-limitAnvil flag would let me move on #61 verification, but I want to make sure that's the right call given mainnet timing.cc @PlasticDigits
mentioned in issue #67
mentioned in issue #63
@PlasticDigits good catch on the MegaETH 512 KB limit — appreciated.
Reframing #72: this is not a mainnet launch-blocker, it's a local-Anvil-only verification block. TimeCurve at 28,454 bytes is well under MegaETH's 524,288 byte cap.
What's needed is just the Anvil --code-size-limit flag in scripts/start-local-anvil-stack.sh (and likely contracts/script/anvil_rich_state.sh) so local DeployDev matches MegaETH semantics. Mainnet deploy is unaffected.
Dropping the LAUNCH-BLOCKER label framing — happy for you to relabel as 'local-stack tooling fix' or similar. Apologies for the alarm — should have thought of MegaETH's raised limit before filing as LB.
Standing by for the Anvil flag fix; will resume #61 / #65 / #66 / #67 / #71 verification on the live stack as soon as deploy goes through.
Implemented in
21a4d5c(main): Anvil inscripts/start-local-anvil-stack.shnow passes--code-size-limit 0x6000(EIP-170 / MegaETH–mainnet parity).contracts/script/anvil_rich_state.shdocuments the same requirement when the RPC is started manually. Mainnet deploy is unchanged.mentioned in commit
49cdad4e89@Brouie Resolution: the “above EIP-170 24 KiB” failure on default Anvil does not imply a MegaETH mainnet deploy blocker.
MegaEVM limits (authoritative): Contract limits — 524,288 bytes (512 KiB) max deployed runtime bytecode; 548,864 bytes (536 KiB) max initcode (`MAX_CONTRACT_SIZE` + `ADDITIONAL_INITCODE_SIZE`).
Nested calls: MegaEVM uses 98/100 gas forwarding to child frames (stricter depth attenuation than Ethereum’s 63/64), documented here: Gas forwarding.
Repo check (from current `contracts/out/*.json` after `forge build`, commit `
49cdad4`): TimeCurve ~11,168 B deployed, RabbitTreasury ~11,077 B — orders of magnitude under 512 KiB. Re-verify anytime with `cd contracts && forge build --sizes`.Docs updated in main: `docs/contracts/foundry-and-megaeth.md` (MegaEVM vs EIP-170 / Anvil, verification commands, gas forwarding), `contracts/README.md`, `docs/research/megaeth.md`, test map `docs/testing/invariants-and-business-logic.md`, `skills/README.md`, contributor guardrail `.cursor/skills/yieldomega-guardrails/SKILL.md`.
Checklist for you: (1) Re-run local stack; if Anvil still rejects bytecode, raise `anvil --code-size-limit` or treat as L1-style tooling only. (2) Confirm MegaETH RPC `eth_estimateGas` on deep composer txs (Kumbaya + `buyFor`) given 98/100 forwarding. (3) Skim Contract limits if limits change in a future network upgrade.
Closing as invalid for MegaETH launch (environment mismatch: EIP-170 / Anvil vs MegaEVM limits); reopen if we add an Ethereum L1 deployment target where EIP-170 matters.
Update: Local Anvil in
scripts/start-local-anvil-stack.shnow uses--code-size-limit 0x80000(512 KiB = 524288 bytes), matching MegaEVM max deployed bytecode instead of the previous EIP-1700x6000(24576 bytes).contracts/script/anvil_rich_state.shcomments aligned.Landed in commit on
main(anvil 512 KiB code size fix).mentioned in issue #75
mentioned in issue #259
mentioned in commit
77bbb5429f