Skip to content

Commit

Permalink
fix runbook (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaele-oplabs authored Nov 5, 2024
1 parent de06809 commit d804e1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "d8621fe4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OptimismPortal2 address: https://etherscan.io/address/0x49048044D57e1C92A77f79988d21Fa8fAF74E97e#readProxyContract\n"
]
}
],
"outputs": [],
"source": [
"if L1_GETH_URL == \"\" or L2_NODE_URL == \"\" or L2_GETH_URL == \"\":\n",
" env_file = \".env\"\n",
Expand Down Expand Up @@ -157,27 +149,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "e32fd923-03ef-41d5-94af-7212ca36bbb9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Last withdrawal event:\n",
"timestamp: 1730746475 \n",
"timestamp: 2024-11-04 18:54:35\n",
"\n",
"Last withdrawal happened: \n",
"at block: https://etherscan.io/block/21116207 \n",
"with transaction hash: https://etherscan.io/tx/0xfeeff7830dd809724133295504cf130f4c7011c2795269d4855ef97937e5d4d9\n",
"Logs can be found at: https://etherscan.io/address/0x49048044D57e1C92A77f79988d21Fa8fAF74E97e#events using filter:0x798f9f13695f8f045aa5f80ed8efebb695f3c7fe65da381969f2f28bf3c60b97\n",
"\n",
"WARNING: Last withdrawal event happened less than 24 hours ago. The monitoring may be stalled\n"
]
}
],
"outputs": [],
"source": [
"result=web3_utility.find_latest_withdrawal_event()\n",
"\n",
Expand Down Expand Up @@ -215,7 +190,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.6"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "d8621fe4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OptimismPortal2 address: https://etherscan.io/address/0x49048044D57e1C92A77f79988d21Fa8fAF74E97e#readProxyContract\n"
]
}
],
"outputs": [],
"source": [
"if L1_GETH_URL == \"\" or L2_NODE_URL == \"\" or L2_GETH_URL == \"\":\n",
" env_file = \".env\"\n",
Expand Down Expand Up @@ -166,18 +158,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "7edae725-621a-4e1c-ba1d-e10f85ba7e02",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Please set up a Txhash\n"
]
}
],
"outputs": [],
"source": [
"\n",
"if Txhash==\"\":\n",
Expand Down Expand Up @@ -206,36 +190,19 @@
" else:\n",
" print(f\"WARNING: l2BlockNumber not present: {l2BlockNumber}\\nTrusted node is not in sync with the chain or the game refer to the block number is not valid.\\n You can verify here: {l2_eth_scan_url}/block/{l2BlockNumber}\")\n",
"\n",
def print_verification_result(title, is_valid, details):
status = "✅ VALID" if is_valid else "❌ INVALID"
print(f"\n{title} - {status}")
print(f"Details: {details}")

if gameData["rootClaim"] == gameData["optimism_outputAtBlock"]:
print_verification_result(
"Game Claim Verification",
True,
f"Root claim matches output at block (Value: {gameData['rootClaim']})"
)
else:
print_verification_result(
"Game Claim Verification",
False,
f"Root claim ({gameData['rootClaim']}) does not match output at block ({gameData['optimism_outputAtBlock']})"
)

if gameData["sentMessages"] == True:
print_verification_result(
"L2 Withdrawal Verification",
True,
"Withdrawal is present on L2"
)
else:
print_verification_result(
"L2 Withdrawal Verification",
False,
"Withdrawal is NOT present on L2"
)
" if gameData[\"rootClaim\"] == gameData[\"optimism_outputAtBlock\"]:\n",
" print(f\"rootClaim: {gameData['rootClaim']} == optimism_outputAtBlock: {gameData['optimism_outputAtBlock']}\")\n",
" print(\"\\nALL GOOD: Game claim is valid\")\n",
" else:\n",
" print(f\"rootClaim: {gameData['rootClaim']} != optimism_outputAtBlock: {gameData['optimism_outputAtBlock']}\")\n",
" print(\"WARNING: game claim is invalid\")\n",
"\n",
" if gameData[\"sentMessages\"] == True:\n",
" print(\"sentMessages: True\")\n",
" print(\"\\nALL GOOD Withdrawal present on L2.\")\n",
" else:\n",
" print(\"sentMessages: False\")\n",
" print(\"\\nWARNING: Withdrawal not present on L2.\")\n",
" print(f\"Can be verified by checking {l2_eth_scan_url}/address/{L2ToL1MessagePasserAddress}#readProxyContract and calling sentMessages function with the withdrawalHash 0x{withDrawalHash}\")\n"
]
}
Expand Down

0 comments on commit d804e1b

Please sign in to comment.