Skip to content

Commit

Permalink
chore: improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
LayneHaber committed Aug 25, 2024
1 parent e3b7d4e commit aedd77f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ const processFromArbitrumRoot = async (
while (left <= right) {
const mid = Math.floor((left + right) / 2);
const log = logs[mid];
const block = await msg.getBlockFromAssertionLog(spokeProvider, log);
if (BigNumber.from(block.sendCount).gt(msg.event.position as BigNumberish)) {
let sendCount = BigNumber.from(0);
try {
const block = await msg.getBlockFromAssertionLog(spokeProvider, log);
sendCount = BigNumber.from(block.sendCount);
} catch (e) {
console.warn("failed to get block:", e);
}
console.log("- sendCount", sendCount.toString());
if (sendCount.gt(msg.event.position as BigNumberish)) {
foundLog = log;
right = mid - 1;
left = right + 1;
Expand Down

0 comments on commit aedd77f

Please sign in to comment.