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: added arbitrum sepolia to get retryable tickets #253

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Changes from 1 commit
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
16 changes: 13 additions & 3 deletions src/mappings/helpers/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ethereum,
crypto,
ByteArray,
log,
} from "@graphprotocol/graph-ts";
import { DepositInitiated } from "../../types/L1GraphTokenGateway/L1GraphTokenGateway";
import { bigIntToBytes, padZeros } from "./byte";
Expand Down Expand Up @@ -50,9 +51,18 @@ export function getRetryableTicketId(
let fields: ByteArray[] = [];

// Get the L2 chain id based on the L1 network
// 0x066EED = 421613 (Arbitrum Goerli)
// 0xA4B1 = 42161 (Arbitrum One)
let l2ChainIdHex = addresses.network === "mainnet" ? "0xA4B1" : "0x066EED";
let l2ChainIdHex = "";
if (addresses.network === "mainnet") {
l2ChainIdHex = "0xA4B1"; // 0xA4B1 = 42161 (Arbitrum One)
} else if (addresses.network === "goerli") {
l2ChainIdHex = "0x066EED"; // 0x066EED = 421613 (Arbitrum Goerli)
} else if (addresses.network === "sepolia") {
l2ChainIdHex = "0x066EEE"; // 0x066EEE = 421614 (Arbitrum Sepolia)
} else {
log.critical('Unsupported network: {}', [addresses.network]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would break all deployments except mainnet, goerli and sepolia, since log.critical causes the subgraph to crash. If we want to give a warning or error message, please change it to log.error or log.warning

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, my intention was to be loud so next time we wouldn't forget to update this but we can't do that since we do deploy this to other networks. I'll update to a warning.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error would probably be also a decent choice if you want to make it extra obvious that something isn't expected, but given the context warning makes sense too

return null;
}

let l2ChainId = Bytes.fromHexString(l2ChainIdHex);
fields.push(l2ChainId);

Expand Down
Loading