Skip to content

Commit 8663b36

Browse files
committed
fix: scan old relay after redeploy
1 parent 5abd9e8 commit 8663b36

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

observer/observer.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from eth_account._utils.signing import to_standard_v
1414
from eth_account.messages import _hash_eip191_message, encode_defunct
1515
from eth_keys.datatypes import Signature as EthSignature
16+
from eth_utils.address import to_checksum_address
1617
from py_flare_common.b58 import flare_b58_encode_check
1718
from py_flare_common.fsp.epoch.epoch import RewardEpoch
1819
from py_flare_common.fsp.messaging import (
@@ -262,6 +263,24 @@ async def get_signing_policy_events(
262263
}
263264
)
264265

266+
_relay_patch_sps = await w.eth.get_logs(
267+
{
268+
"address": [
269+
to_checksum_address("0x92a6E1127262106611e1e129BB64B6D8654273F7"),
270+
to_checksum_address("0x97702e350CaEda540935d92aAf213307e9069784"),
271+
to_checksum_address("0x57a4c3676d08Aa5d15410b5A6A80fBcEF72f3F45"),
272+
to_checksum_address("0x67a916E175a2aF01369294739AA60dDdE1Fad189"),
273+
],
274+
"fromBlock": start_block,
275+
"toBlock": end_block,
276+
"topics": [
277+
"0x"
278+
+ config.contracts.Relay.events["SigningPolicyInitialized"].signature
279+
],
280+
}
281+
)
282+
block_logs.extend(_relay_patch_sps)
283+
265284
for log in block_logs:
266285
sig = log["topics"][0]
267286

@@ -501,6 +520,33 @@ async def observer_loop(config: Configuration) -> None:
501520
"toBlock": block,
502521
}
503522
)
523+
_relay_patch_sps = await w.eth.get_logs(
524+
{
525+
"address": [
526+
to_checksum_address(
527+
"0x92a6E1127262106611e1e129BB64B6D8654273F7"
528+
),
529+
to_checksum_address(
530+
"0x97702e350CaEda540935d92aAf213307e9069784"
531+
),
532+
to_checksum_address(
533+
"0x57a4c3676d08Aa5d15410b5A6A80fBcEF72f3F45"
534+
),
535+
to_checksum_address(
536+
"0x67a916E175a2aF01369294739AA60dDdE1Fad189"
537+
),
538+
],
539+
"fromBlock": block,
540+
"toBlock": block,
541+
"topics": [
542+
"0x"
543+
+ config.contracts.Relay.events[
544+
"SigningPolicyInitialized"
545+
].signature
546+
],
547+
}
548+
)
549+
block_logs.extend(_relay_patch_sps)
504550

505551
tx_messages = []
506552
event_messages = []

0 commit comments

Comments
 (0)