Layer-2 Solidity interview: what’s a sane event-logging + monitoring setup without bloating L1 data fees?
Yesterday I got asked something in interview that sounded simple but I realized I only had a “blog answer” for it.
If you’re shipping Solidity on Layer-2s (Optimism / Arbitrum / zkSync), how do you design efficient logging and monitoring so you can debug incidents and prove what happened later — without spamming events and quietly increasing user costs?
I know events are cheaper than storage, but the interviewer pushed on tradeoffs:
What do you log on-chain vs what do you rely on off-chain indexing (The Graph / subgraphs / custom indexers)?
Do you treat events like a stable “API” (small schema, long-lived), or do teams log more aggressively on critical paths (withdrawals, upgrades, liquidations)?
How do you handle the cases where users say “my tx failed” — because if it reverted, you don’t even get logs to read.
If you’ve built production contracts, I’d love a real answer: what’s your default event schema mindset, what do you index, what do you alert on, and what would you avoid emitting even on L2?