Content pfp
Content
@
https://opensea.io/collection/evm-6
0 reply
0 recast
2 reactions

horsefacts ๐Ÿš‚ pfp
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
5 recasts
21 reactions

Phil Liao pfp
Phil Liao
@philipliao.eth
Thoughts on optimizing for L1 calldata now and then after 4844, L1 calldata costs plummet? Rewrite?
1 reply
0 recast
0 reaction

frangio pfp
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 ๐Ÿš‚ pfp
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 pfp
Phil Liao
@philipliao.eth
Beautiful And great to see you here on FC @frangio!
0 reply
0 recast
1 reaction