From d804e1b8a5cb8913e4e4aef943cca5722c7d7acb Mon Sep 17 00:00:00 2001 From: Raffaele <151576068+raffaele-oplabs@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:22:04 +0100 Subject: [PATCH] fix runbook (#95) --- .../automated/triage_detection_stalled.ipynb | 35 ++-------- .../triage_potential_attack_event.ipynb | 67 +++++-------------- 2 files changed, 22 insertions(+), 80 deletions(-) diff --git a/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_detection_stalled.ipynb b/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_detection_stalled.ipynb index 06014a7..ec1f19c 100644 --- a/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_detection_stalled.ipynb +++ b/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_detection_stalled.ipynb @@ -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", @@ -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", @@ -215,7 +190,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.6" + "version": "3.12.5" } }, "nbformat": 4, diff --git a/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_potential_attack_event.ipynb b/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_potential_attack_event.ipynb index 5e3e4ba..b093d99 100644 --- a/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_potential_attack_event.ipynb +++ b/op-monitorism/faultproof_withdrawals/runbooks/automated/triage_potential_attack_event.ipynb @@ -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", @@ -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", @@ -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" ] }