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

Workaround for first 404 blocks of Nova #35

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
12 changes: 11 additions & 1 deletion packages/arbitrum-retryables/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ export function handleRedeemScheduled(event: RedeemScheduled): void {
const stats = getOrCreateTotalRetryableStats();

const prevStatus = entity.status;
const redeemSuccessful = isRedeemSuccessful(ArbRetryableTxContract.bind(event.address), ticketId);

// querying the retryables precompile in nova, in first 403 blocks, doesn't revert in expected way
// thus we just assume that redeem was successful
let redeemSuccessful: boolean;
if (event.block.number.lt(BigInt.fromI32(404))) {
redeemSuccessful = true;
} else {
// check if redeem was successful by doing eth_call - if redeem was successful call will revert (ticket is missing)
redeemSuccessful = isRedeemSuccessful(ArbRetryableTxContract.bind(event.address), ticketId);
}

if (redeemSuccessful) {
if (prevStatus == "Created") {
entity.isAutoRedeemed = true;
Expand Down