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

Resuscitated Arbitrum Sepolia to Sepolia devnet deployment #305

Merged
merged 10 commits into from
Sep 23, 2024
4 changes: 2 additions & 2 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments

#### Sepolia

- [VeaOutboxArbToEthDevnet](https://sepolia.etherscan.io/address/0x5AD255400913515C8DA7E82E6b8A109fA5c46135)
- [VeaOutboxArbToEthDevnet](https://sepolia.etherscan.io/address/0xb8BF3B6bd3E1a0Cc9E2dB77dd492503310514674)

#### Arbitrum Sepolia

- [VeaInboxArbToEthDevnet](https://sepolia.arbiscan.io/address/0x77e95F54032f467eC45c48C6affc203f93858783)
- [VeaInboxArbToEthDevnet](https://sepolia.arbiscan.io/address/0x0B5851fE2a931F619F73E739E5435C43976f1D68)

#### Chiado

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const paramsByChainId = {
epochPeriod: 1800, // 30 min
minChallengePeriod: 0, // 30 min
numEpochTimeout: 10000000000000, // never
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
amb: "0x8448E15d0e706C0298dECA99F0b4744030e59d7d", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
Copy link
Contributor

Choose a reason for hiding this comment

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

ignoreable Nice comment, it made it very easy to figure out where the value came from

sequencerLimit: 86400,
maxMissingBlocks: 10000000000000,
routerChainId: 11155111,
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/01-outbox/01-arb-to-gnosis-outbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const paramsByChainId = {
numEpochTimeout: 1000000, // never
maxMissingBlocks: 1000000, // any
routerChainId: 11155111,
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
amb: "0x8448E15d0e706C0298dECA99F0b4744030e59d7d", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
WETH: "0x8d74e5e4DA11629537C4575cB0f33b4F0Dfa42EB",
sequencerLimit: 86400, // 24 hours
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum SenderChains {
const paramsByChainId = {
GNOSIS_CHIADO: {
epochPeriod: 1800, // 30 minutes
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
amb: "0x8448E15d0e706C0298dECA99F0b4744030e59d7d", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
},
HARDHAT: {
amb: ethers.constants.AddressZero,
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/02-inbox/02-gnosis-to-arb-inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const paramsByChainId = {
},
GNOSIS_CHIADO: {
epochPeriod: 7200, // 2 hours
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
amb: "0x8448E15d0e706C0298dECA99F0b4744030e59d7d",
},
HARDHAT: {
epochPeriod: 600, // 10 minutes
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/03-routers/03-arb-to-gnosis-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const paramsByChainId = {
},
ETHEREUM_SEPOLIA: {
arbitrumBridge: "0x38f918D0E9F1b721EDaA41302E399fa1B79333a9", // https://developer.arbitrum.io/useful-addresses
amb: "0x87A19d769D875964E9Cd41dDBfc397B2543764E6",
amb: "0xf2546D6648BD2af6a008A7e7C1542BB240329E11", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
},
HARDHAT: {
arbitrumInbox: ethers.constants.AddressZero,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum RouterChains {
const paramsByChainId = {
ETHEREUM_SEPOLIA: {
arbitrumBridge: "0x38f918D0E9F1b721EDaA41302E399fa1B79333a9", // https://developer.arbitrum.io/useful-addresses
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
amb: "0xf2546D6648BD2af6a008A7e7C1542BB240329E11", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
},
HARDHAT: {
arbitrumBridge: ethers.constants.AddressZero,
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/03-routers/03-gnosis-to-arb-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const paramsByChainId = {
},
ETHEREUM_SEPOLIA: {
arbitrumBridge: "0x38f918D0E9F1b721EDaA41302E399fa1B79333a9", // https://developer.arbitrum.io/useful-addresses
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
amb: "0xf2546D6648BD2af6a008A7e7C1542BB240329E11", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
},
HARDHAT: {
arbitrumBridge: ethers.constants.AddressZero,
Expand Down
32 changes: 16 additions & 16 deletions contracts/deployments/arbitrumSepolia/VeaInboxArbToEthDevnet.json

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions contracts/deployments/sepolia/VeaOutboxArbToEthDevnet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion relayer-cli/src/devnetRelayExample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const epochPeriod = 1800; // 30 min
for (const chain_id of chain_ids) {
let nonce = await initialize(chain_id);
// This is libghtbulb switch address in arbitrum sepolia
const sender = "0x4A9EF2E97B780ea6E8DE3fD8acd4cBA8C061F173";
const sender = "0x28d6D503F4c5734cD926E96b63C61527d975B382";
nonce = await relayAllFrom(chain_id, nonce, sender);
if (nonce != null) await updateStateFile(chain_id, Math.floor(Date.now() / 1000), nonce);
}
Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/utils/proof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const getMessageDataToRelay = async (chainid: number, nonce: number) => {
const subgraph = getSubgraph(chainid);

const result = await request(
`https://api.studio.thegraph.com/query/67213/${subgraph}/version/latest`,
`https://api.studio.thegraph.com/query/85918/${subgraph}/version/latest`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider extracting this into an environment variable, if not the whole prefix at least the magic number

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit.

`{
messageSents(first: 5, where: {nonce: ${nonce}}) {
nonce
Expand Down Expand Up @@ -39,7 +39,7 @@ const getProofAtCount = async (chainid: number, nonce: number, count: number): P
try {
const subgraph = getSubgraph(chainid);

const result = await request(`https://api.studio.thegraph.com/query/67213/${subgraph}/version/latest`, query);
const result = await request(`https://api.studio.thegraph.com/query/85918/${subgraph}/version/latest`, query);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion about extracting to env vars


const proof = [];

Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/utils/relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getCount = async (veaOutbox: VeaOutboxArbToEth, chainid: number): Promise<
const stateRoot = await veaOutbox.stateRoot();

const result = await request(
`https://api.studio.thegraph.com/query/67213/${subgraph}/version/latest`,
`https://api.studio.thegraph.com/query/85918/${subgraph}/version/latest`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion about extracting to env vars

`{
snapshotSaveds(first: 1, where: { stateRoot: "${stateRoot}" }) {
count
Expand Down Expand Up @@ -119,7 +119,7 @@ const getNonceFrom = async (chainid: number, nonce: number, msgSender: string) =
const subgraph = getSubgraph(chainid);

const result = await request(
`https://api.studio.thegraph.com/query/67213/${subgraph}/version/latest`,
`https://api.studio.thegraph.com/query/85918/${subgraph}/version/latest`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion about extracting to env vars

`{
messageSents(first: 1000, where: {nonce_gte: ${nonce}, msgSender_: {id: "${msgSender}"}}, orderBy: nonce, orderDirection: asc) {
nonce
Expand Down
4 changes: 2 additions & 2 deletions relayer-subgraph-inbox/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dataSources:
name: VeaInbox
network: arbitrum-sepolia
source:
address: "0x77e95F54032f467eC45c48C6affc203f93858783"
address: "0x0B5851fE2a931F619F73E739E5435C43976f1D68"
abi: VeaInbox
startBlock: 18210847
startBlock: 69673433
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down
2 changes: 1 addition & 1 deletion veascan-subgraph-inbox/src/VeaInbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SnapshotSaved,
SnapshotSent,
VeaInbox,
} from "../generated/VeaInboxArbToGnosis/VeaInbox";
} from "../generated/VeaInbox/VeaInbox";

export function handleMessageSent(event: MessageSent): void {
const snapshot = getCurrentSnapshot();
Expand Down
4 changes: 2 additions & 2 deletions veascan-subgraph-inbox/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ dataSources:
name: VeaInbox
network: arbitrum-sepolia
source:
address: "0x77e95F54032f467eC45c48C6affc203f93858783"
address: "0x0B5851fE2a931F619F73E739E5435C43976f1D68"
abi: VeaInbox
startBlock: 18210847
startBlock: 69673433
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down
4 changes: 2 additions & 2 deletions veascan-subgraph-outbox/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dataSources:
name: VeaOutbox
network: sepolia
source:
address: "0x5AD255400913515C8DA7E82E6b8A109fA5c46135"
address: "0xb8BF3B6bd3E1a0Cc9E2dB77dd492503310514674"
abi: VeaOutbox
startBlock: 5379614
startBlock: 6458841
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down
30 changes: 15 additions & 15 deletions veascan-web/src/consts/bridges.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import VeaInboxArbitrumSepolia from "@kleros/vea-contracts/deployments/arbitrumSepolia/VeaInboxArbToEthDevnet.json";
import VeaOutboxSepolia from "@kleros/vea-contracts/deployments/sepolia/VeaOutboxArbToEthDevnet.json";
import VeaInboxArbitrumSepoliaChiado from "@kleros/vea-contracts/deployments/arbitrumSepolia/VeaInboxArbToGnosisDevnet.json";
import VeaOutboxArbitrumSepoliaChiado from "@kleros/vea-contracts/deployments/chiado/VeaOutboxArbToGnosisDevnet.json";
// import VeaInboxArbitrumSepoliaChiado from "@kleros/vea-contracts/deployments/arbitrumSepolia/VeaInboxArbToGnosisDevnet.json";
fcanela marked this conversation as resolved.
Show resolved Hide resolved
// import VeaOutboxArbitrumSepoliaChiado from "@kleros/vea-contracts/deployments/chiado/VeaOutboxArbToGnosisDevnet.json";
import {
Chain,
arbitrumSepolia,
Expand Down Expand Up @@ -42,22 +42,22 @@ export const bridges: IBridge[] = [
to: sepolia.id,
inboxAddress: VeaInboxArbitrumSepolia.address as `0x${string}`,
inboxEndpoint:
"https://api.studio.thegraph.com/query/67213/veascan-inbox-arb-sep-devnet/version/latest",
"https://api.studio.thegraph.com/query/85918/veascan-inbox-arb-sep-devnet/v0.8.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion about extracting to env vars

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, will do.

outboxAddress: VeaOutboxSepolia.address as `0x${string}`,
outboxEndpoint:
"https://api.studio.thegraph.com/query/67213/veascan-outbox-arb-sep-devnet/version/latest",
},
{
id: 1,
from: arbitrumSepolia.id,
to: gnosisChiado.id,
inboxAddress: VeaInboxArbitrumSepoliaChiado.address as `0x${string}`,
inboxEndpoint:
"https://api.studio.thegraph.com/query/67213/veascan-inbox-arb-sep-chiado-devnet/version/latest",
outboxAddress: VeaOutboxArbitrumSepoliaChiado.address as `0x${string}`,
outboxEndpoint:
"https://api.studio.thegraph.com/query/67213/veascan-outbox-arb-chiado-devnet/version/latest",
"https://api.studio.thegraph.com/query/85918/veascan-outbox-arb-sep-devnet/v0.8.0",
},
// {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment regarding commented code

// id: 1,
// from: arbitrumSepolia.id,
// to: gnosisChiado.id,
// inboxAddress: VeaInboxArbitrumSepoliaChiado.address as `0x${string}`,
// inboxEndpoint:
// "https://api.studio.thegraph.com/query/67213/veascan-inbox-arb-sep-chiado-devnet/version/latest",
// outboxAddress: VeaOutboxArbitrumSepoliaChiado.address as `0x${string}`,
// outboxEndpoint:
// "https://api.studio.thegraph.com/query/67213/veascan-outbox-arb-chiado-devnet/version/latest",
// },
];

export const getBridge = (id: number): IBridge =>
Expand Down
Loading