Challenge - 5 Problems
Rollup Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Optimistic Rollup Fraud Proof Simulation
Consider the following simplified Python code simulating an optimistic rollup fraud proof check. What is the output when the code runs?
Blockchain / Solidity
def optimistic_rollup_check(state, new_state): # Fraud proof triggers if new_state is less than state if new_state < state: return "Fraud detected" else: return "State accepted" print(optimistic_rollup_check(100, 90))
Attempts:
2 left
💡 Hint
Think about the condition that triggers fraud detection in optimistic rollups.
✗ Incorrect
The function checks if the new state is less than the current state. Since 90 < 100, it returns 'Fraud detected'.
🧠 Conceptual
intermediate1:30remaining
Difference in Verification Time Between Rollups
Which statement correctly describes the verification time difference between Optimistic Rollups and ZK Rollups?
Attempts:
2 left
💡 Hint
Recall how each rollup type handles transaction verification.
✗ Incorrect
ZK Rollups generate cryptographic proofs that verify transactions instantly, while Optimistic Rollups assume transactions are valid and only verify if a fraud proof is submitted, causing delay.
🔧 Debug
advanced1:30remaining
Identify the Error in ZK Rollup Proof Generation Code
What error will the following Python code raise when simulating a ZK Rollup proof generation?
Blockchain / Solidity
def generate_zk_proof(data): # Simulate proof generation proof = data / 0 return proof print(generate_zk_proof(10))
Attempts:
2 left
💡 Hint
Look at the operation dividing by zero.
✗ Incorrect
Dividing any number by zero in Python raises a ZeroDivisionError.
📝 Syntax
advanced1:00remaining
Syntax Error in Optimistic Rollup Challenge Period Code
Which option contains the correct syntax to define a function that returns the challenge period length in days?
Blockchain / Solidity
def challenge_period(): return 7
Attempts:
2 left
💡 Hint
Check for colons and indentation in function definitions.
✗ Incorrect
Option C correctly includes the colon after the function name and indents the return statement properly.
🚀 Application
expert2:00remaining
Calculate Final State After Batch Processing in ZK Rollup
Given the following Python code simulating batch state updates in a ZK Rollup, what is the final state printed?
Blockchain / Solidity
def zk_rollup_batch(states): final_state = 0 for s in states: final_state += s * 2 return final_state batch_states = [1, 3, 5] print(zk_rollup_batch(batch_states))
Attempts:
2 left
💡 Hint
Multiply each state by 2 and add them all up.
✗ Incorrect
The function doubles each state and sums them: (1*2)+(3*2)+(5*2) = 2+6+10 = 18.