Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to fraud detector being unable to start #1271

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.8-slim
RUN pip3 install --no-cache-dir web3==5.31.4
RUN pip3 install --no-cache-dir web3==6.11.1
COPY boba_community/fraud-detector/fraud-detector.py /
COPY boba_community/fraud-detector/packages/jsonrpclib /jsonrpclib
COPY /packages/contracts/artifacts/contracts/L1/rollup/StateCommitmentChain.sol/StateCommitmentChain.json /contracts/StateCommitmentChain.json
Expand Down
14 changes: 7 additions & 7 deletions boba_community/fraud-detector/fraud-detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def status(*args):
while True:
try:
rpc[1] = Web3(Web3.HTTPProvider(os.environ['L1_NODE_WEB3_URL']))
assert (rpc[1].isConnected())
assert (rpc[1].is_connected())
break
except:
logger.info ("Waiting for L1...")
Expand All @@ -99,7 +99,7 @@ def status(*args):
while True:
try:
rpc[2] = Web3(Web3.HTTPProvider(os.environ['L2_NODE_WEB3_URL']))
assert (rpc[2].isConnected())
assert (rpc[2].is_connected())
break
except:
logger.info ("Waiting for L2...")
Expand All @@ -111,7 +111,7 @@ def status(*args):
while True:
try:
rpc[3] = Web3(Web3.HTTPProvider(os.environ['VERIFIER_WEB3_URL']))
assert (rpc[3].isConnected())
assert (rpc[3].is_connected())
break
except:
logger.info ("Waiting for verifier...")
Expand Down Expand Up @@ -181,17 +181,17 @@ def doEvent(event, force_L2):
match = "**** SCC/VERIFIER MISMATCH ****"

if l2SR:
l2SR_str = Web3.toHex(l2SR)
l2SR_str = Web3.utils.toHex(l2SR)
else:
l2SR_str = " -- "
log_str = "{} {} {} {} {} {}".format(rCount, event.blockNumber, Web3.toHex(sr), l2SR_str, Web3.toHex(vfSR), match)
log_str = "{} {} {} {} {} {}".format(rCount, event.blockNumber, Web3.utils.toHex(sr), l2SR_str, Web3.utils.toHex(vfSR), match)
matchedLock.acquire()
if match != "":
Matched['is_ok'] = False
logger.warning(log_str)
else:
Matched['Block'] = rCount
Matched['Root'] = Web3.toHex(sr)
Matched['Root'] = Web3.utils.toHex(sr)
Matched['Time'] = time.time()
logger.info(log_str)
matchedLock.release()
Expand Down Expand Up @@ -238,7 +238,7 @@ def fpLoop():

logger.info("#SCC-IDX L1-Block SCC-STATEROOT L2-STATEROOT VERIFIER-STATEROOT MISMATCH")

topic_sig = Web3.toHex(Web3.keccak(text="StateBatchAppended(uint256,bytes32,uint256,uint256,bytes)"))
topic_sig = Web3.utils.toHex(Web3.keccak(text="StateBatchAppended(uint256,bytes32,uint256,uint256,bytes)"))

while startBlock < l1_tip:
toBlock = min(startBlock+batch_size, l1_tip) - 1
Expand Down
Loading