From 57f3ad0ee2ae71a585b65645f980d48f13b8e07b Mon Sep 17 00:00:00 2001 From: hweawer Date: Thu, 13 Feb 2025 09:17:39 +0100 Subject: [PATCH] Update --- src/metrics/logging.py | 2 +- src/scrap_script.py | 62 ++++++++++--------- .../bunker_cases/abnormal_cl_rebase.py | 2 +- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/metrics/logging.py b/src/metrics/logging.py index b6d1881ce..4a9270933 100644 --- a/src/metrics/logging.py +++ b/src/metrics/logging.py @@ -26,6 +26,6 @@ def format(self, record: logging.LogRecord) -> str: handler.setFormatter(JsonFormatter()) logging.basicConfig( - level=logging.INFO, + level=logging.CRITICAL, handlers=[handler], ) diff --git a/src/scrap_script.py b/src/scrap_script.py index 660438245..944f16884 100644 --- a/src/scrap_script.py +++ b/src/scrap_script.py @@ -50,24 +50,26 @@ def extract_ref_slot(tx_data, type): if __name__ == "__main__": - #print(f"---AccountingOracle---") - #accounting_address = "0x852deD011285fe67063a08005c71a85690503Cee" + print(f"---AccountingOracle---") + accounting_address = "0x852deD011285fe67063a08005c71a85690503Cee" - #transactions = get_transactions(accounting_address) + transactions = get_transactions(accounting_address, "0xfc7377cd") - #if not transactions: - # print("No submitReportData transactions found!") - # sys.exit(0) + if not transactions: + print("No submitReportData transactions found!") + sys.exit(0) - #print(f"✅ Found {len(transactions)} submitReportData calls") + print(f"✅ Found {len(transactions)} submitReportData calls") - #for tx in transactions: - # tx_hash = tx["hash"] - # refslot = extract_ref_slot(tx["input"], 'accounting') - # print(f"🔹 Tx: {tx_hash} → X: {refslot}") - # os.environ["ORACLE_REFSLOT"] = str(refslot) - # os.environ["DEAMON"] = str(False) - # run_oracle('accounting') + for tx in transactions: + tx_hash = tx["hash"] + decoded_static_values = extract_ref_slot(tx["input"], 'accounting') + refslot = decoded_static_values[0][1] + print(f"🔹 Tx: {tx_hash} → X: {refslot}") + os.environ["ORACLE_REFSLOT"] = str(refslot) + os.environ["DEAMON"] = str(False) + print(decoded_static_values) + run_oracle('accounting') #print(f"---ValidatorExitBusOracle---") #ejector_address = "0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e" @@ -87,20 +89,20 @@ def extract_ref_slot(tx_data, type): # print(decoded_static_values) # run_oracle('ejector') - print(f"---CSFeeOracle---") - csm_oracle_address = "0x4D4074628678Bd302921c20573EEa1ed38DdF7FB" - transactions = get_transactions(csm_oracle_address, "0xade4e312") - if not transactions: - print("No submitReportData transactions found!") - sys.exit(0) + #print(f"---CSFeeOracle---") + #csm_oracle_address = "0x4D4074628678Bd302921c20573EEa1ed38DdF7FB" + #transactions = get_transactions(csm_oracle_address, "0xade4e312") + #if not transactions: + # print("No submitReportData transactions found!") + # sys.exit(0) - print(f"✅ Found {len(transactions)} submitReportData calls") - tx = transactions[0] - tx_hash = tx["hash"] - decoded_static_values = extract_ref_slot(tx["input"], 'csm') - refslot = decoded_static_values[0][1] - print(f"🔹 Tx: {tx_hash} → X: {refslot}") - os.environ["ORACLE_REFSLOT"] = str(refslot) - os.environ["DEAMON"] = str(False) - print(decoded_static_values) - run_oracle('csm') + #print(f"✅ Found {len(transactions)} submitReportData calls") + #tx = transactions[0] + #tx_hash = tx["hash"] + #decoded_static_values = extract_ref_slot(tx["input"], 'csm') + #refslot = decoded_static_values[0][1] + #print(f"🔹 Tx: {tx_hash} → X: {refslot}") + #os.environ["ORACLE_REFSLOT"] = str(refslot) + #os.environ["DEAMON"] = str(False) + #print(decoded_static_values) + #run_oracle('csm') diff --git a/src/services/bunker_cases/abnormal_cl_rebase.py b/src/services/bunker_cases/abnormal_cl_rebase.py index 8538c904f..f490ce5be 100644 --- a/src/services/bunker_cases/abnormal_cl_rebase.py +++ b/src/services/bunker_cases/abnormal_cl_rebase.py @@ -203,7 +203,7 @@ def _calculate_cl_rebase_between_blocks( withdrawn_from_vault = self._get_withdrawn_from_vault_between_blocks(prev_blockstamp, ref_blockstamp) # Finally, we can calculate corrected CL rebase - cl_rebase = Gwei(raw_cl_rebase + validators_count_diff_in_gwei + withdrawn_from_vault) + cl_rebase = Gwei(raw_cl_rebase - validators_count_diff_in_gwei + withdrawn_from_vault) logger.info( {