Content
@
0 reply
0 recast
2 reactions
horsefacts
@horsefacts.eth
Optimizing my first serious L2 contracts has been a journey: 1) Dev: your intuitions are all wrong now. 2) Testnet: cheap L2 gas, cheap L1 calldata. Many tools overestimate L2 gas and it can outweigh calldata unlike IRL. 3) Mainnet: cheap L2 gas, L1 calldata is 20-100x testnet cost. Calldata costs dominate everything.
5 replies
6 recasts
22 reactions
Phil Liao
@philipliao
Thoughts on optimizing for L1 calldata now and then after 4844, L1 calldata costs plummet? Rewrite?
1 reply
0 recast
0 reaction
frangio
@frangio
Internal calls are not affected by L1 DA costs so it doesn't necessarily make sense to design the whole interface for optimal calldata use. Add a calldata-optimized interface as a secondary set of functions that invoke unoptimized functions. By decoupling this way you don't have to rewrite everything when costs change.
2 replies
0 recast
5 reactions
horsefacts
@horsefacts.eth
+1 to this, kind of like a router pattern. Also your optimization function may be different. L1 is so expensive it’s pretty much always worth it, on L2 time and effort vs impact is not as clear cut. “Cheap enough now and even cheaper later” might be OK.
0 reply
0 recast
0 reaction
Phil Liao
@philipliao
Beautiful And great to see you here on FC @frangio!
0 reply
0 recast
1 reaction