By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
The Blockchain Trilemma states that a public network can at most excel in two of three properties—Scalability, Security, and Decentralization—but improving one usually hurts the others. In practice this means a fast, cheap chain may become more centralized or less secure, while a highly secure, fully decentralized chain may struggle to process many transactions per second. A concrete illustration is a Uniswap V3 swap on Ethereum: the protocol is fully decentralized and secure, but during peak demand (e.g., a token launch) gas fees skyrocket, showing the scalability side of the trilemma.
// Minimal L2‑friendly contract (uses immutable storage to save gas) contract Counter { uint256 public immutable start; // set once at deployment → cheaper reads uint256 private _value; constructor(uint256 _start) { start = _start; } function inc() external { _value += 1; // cheap state change } function value() external view returns (uint256) { return start + _value; // compute on‑chain, no extra storage } }
immutable
constant
bash npx hardhat compile
@eth-optimism/contracts
bash npx hardhat run scripts/deploy.js --network optimism-goerli
optimism.io/api/v1/data-availability
ethers.js
gasPrice
js const provider = new ethers.providers.JsonRpcProvider(OPTIMISM_GOERLI_RPC); const contract = new ethers.Contract(address, abi, provider); await contract.inc({ gasPrice: ethers.utils.parseUnits('2', 'gwei') });
Mistake: Deploying a heavy‑loop contract on an Optimistic Rollup and assuming the same gas limit as L1. Correction: L2s often have tighter block‑gas caps; refactor loops into batch calls or use merkle‑tree proofs to stay within limits.
Mistake: Relying on tx.origin for access control (e.g., require(tx.origin == owner)). Correction: Use msg.sender and role‑based libraries (OpenZeppelin’s AccessControl) because tx.origin can be spoofed through a malicious contract, breaking security.
tx.origin
require(tx.origin == owner)
msg.sender
AccessControl
Mistake: Ignoring data‑availability attacks on rollups (e.g., assuming the data is always on‑chain). Correction: Verify that the rollup’s data‑availability layer is “full” (e.g., Celestia) or add a fallback proof‑of‑fraud mechanism.
Mistake: Treating an L2 as fully decentralized because it inherits L1 security. Correction: Remember that the sequencer (the entity that orders L2 transactions) can be a central point of failure; monitor its uptime and consider multi‑sequencer designs.
Mistake: Hard‑coding gas limits in contract calls, which become obsolete after a network upgrade. Correction: Query the provider for eth_maxPriorityFeePerGas or use estimateGas each time to stay adaptive.
eth_maxPriorityFeePerGas
estimateGas
Expect you to discuss latency (challenge period vs instant finality), proof generation cost, and data‑availability requirements.
“When would you prefer a side‑chain over a rollup?”
Look for answers about custom VM execution, lower security guarantees, and the need for fast finality (e.g., gaming).
“How does delegatecall affect decentralization?”
delegatecall
Interviewers want to see you understand that delegatecall lets a proxy contract execute code from another contract, which can centralize upgrade logic and become a single point of failure if the implementation is compromised.
“What is a ‘sequencer‑downtime’ scenario and how do you mitigate it?”
Scenario: A contract uses tx.origin to restrict withdrawals to the contract owner. Answer: Dangerous – a malicious contract can trick the owner into calling it, making tx.origin the attacker’s address, thus bypassing the check.
Scenario: Your dApp runs on an Optimistic Rollup but you notice users’ transactions are pending for 7 days. Answer: The 7‑day pending time is the fraud‑proof challenge period; users must wait for it to expire before the state is considered final.
Scenario: You see a rollup that publishes only transaction hashes on‑chain, not full calldata. Answer: This is a data‑availability risk – if the off‑chain data is lost, the rollup’s state cannot be reconstructed, compromising security.
ReentrancyGuard
baseFee
tip
eth_gasPrice
SafeMath
tokensReceived
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.