Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hweawer committed Feb 13, 2025
1 parent 3f5ae8f commit 57f3ad0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/metrics/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def format(self, record: logging.LogRecord) -> str:
handler.setFormatter(JsonFormatter())

logging.basicConfig(
level=logging.INFO,
level=logging.CRITICAL,
handlers=[handler],
)
62 changes: 32 additions & 30 deletions src/scrap_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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')
2 changes: 1 addition & 1 deletion src/services/bunker_cases/abnormal_cl_rebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit 57f3ad0

Please sign in to comment.