Skip to content

Commit

Permalink
feat: add sepolia production config (#100)
Browse files Browse the repository at this point in the history
# What ❔

1. Remove new prover notification since it's not needed anymore.
2. Add Sepolia Testnet production configuration.

## Why ❔

We need a Sepolia block explorer production environment to eventually
use it as a main Testnet environment.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.
  • Loading branch information
vasyl-ivanchuk authored and pcheremu committed Feb 15, 2024
1 parent f999b33 commit 60780c6
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 137 deletions.
44 changes: 0 additions & 44 deletions packages/app/src/components/NewProverInfoBox.vue

This file was deleted.

6 changes: 0 additions & 6 deletions packages/app/src/components/batches/InfoTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useI18n } from "vue-i18n";
import { useWindowSize } from "@vueuse/core";
import NewProverInfoBox from "@/components/NewProverInfoBox.vue";
import InfoTableSection from "@/components/batches/InfoTableSection.vue";
import CopyContent from "@/components/common/table/fields/CopyContent.vue";
import TimeField from "@/components/common/table/fields/TimeField.vue";
Expand Down Expand Up @@ -88,11 +87,6 @@ const tableInfoItems = computed(() => {
url: currentNetwork.value.l1ExplorerUrl
? `${currentNetwork.value.l1ExplorerUrl}/tx/${props.batch[key]}`
: undefined,
...(key === "proveTxHash" &&
props.batch.isProvenByNewProver && {
additionalContentComponent: NewProverInfoBox,
additionalContentProps: { context: "batch" },
}),
},
{
label: t(`batches.${timeKey}`),
Expand Down
3 changes: 0 additions & 3 deletions packages/app/src/components/batches/InfoTableSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<component v-else-if="item.component" :is="item.component" v-bind="item.value"></component>
<template v-else>{{ item.value }}</template>
</div>
<div v-if="item.additionalContentComponent">
<component :is="item.additionalContentComponent" v-bind="item.additionalContentProps"></component>
</div>
</table-body-column>
</template>
</template>
Expand Down
6 changes: 0 additions & 6 deletions packages/app/src/components/blocks/InfoTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useI18n } from "vue-i18n";
import { useWindowSize } from "@vueuse/core";
import NewProverInfoBox from "@/components/NewProverInfoBox.vue";
import InfoTableBlock from "@/components/blocks/InfoTableBlock.vue";
import CopyContent from "@/components/common/table/fields/CopyContent.vue";
import TimeField from "@/components/common/table/fields/TimeField.vue";
Expand Down Expand Up @@ -113,11 +112,6 @@ const tableInfoItems = computed(() => {
url: currentNetwork.value.l1ExplorerUrl
? `${currentNetwork.value.l1ExplorerUrl}/tx/${props.block[key]}`
: undefined,
...(key === "proveTxHash" &&
props.block.isProvenByNewProver && {
additionalContentComponent: NewProverInfoBox,
additionalContentProps: { context: "block" },
}),
},
{
label: t(`blocks.table.${timeKey}`),
Expand Down
3 changes: 0 additions & 3 deletions packages/app/src/components/blocks/InfoTableBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
<component v-else-if="item.component" :is="item.component" v-bind="item.value"></component>
<template v-else>{{ item.value }}</template>
</div>
<div v-if="item.additionalContentComponent">
<component :is="item.additionalContentComponent" v-bind="item.additionalContentProps"></component>
</div>
</table-body-column>
</template>
</template>
Expand Down
20 changes: 2 additions & 18 deletions packages/app/src/composables/useBatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,19 @@ import { $fetch, FetchError } from "ohmyfetch";

import useContext from "@/composables/useContext";

export type BatchDetails = Api.Response.BatchDetails & {
isProvenByNewProver?: boolean;
};
export type BatchDetails = Api.Response.BatchDetails;

export default (context = useContext()) => {
const isRequestPending = ref(false);
const isRequestFailed = ref(false);
const batchItem = ref(<null | BatchDetails>null);

const getBatchNewProof = async (id: string) => {
try {
return await $fetch(`${context.currentNetwork.value.newProverUrl}/proof_${id}.bin`, { method: "HEAD" });
} catch (error: unknown) {
return null;
}
};

const getById = async (id: string) => {
isRequestPending.value = true;
isRequestFailed.value = false;

try {
const batch = await $fetch(`${context.currentNetwork.value.apiUrl}/batches/${id}`);
if (batch.proveTxHash) {
const proof = await getBatchNewProof(id);
batch.isProvenByNewProver = !!proof;
}
batchItem.value = batch;
batchItem.value = await $fetch(`${context.currentNetwork.value.apiUrl}/batches/${id}`);
} catch (error: unknown) {
batchItem.value = null;
if (!(error instanceof FetchError) || error.response?.status !== 404) {
Expand All @@ -43,7 +28,6 @@ export default (context = useContext()) => {
};

return {
getBatchNewProof,
getById,
batchItem,
isRequestPending,
Expand Down
15 changes: 1 addition & 14 deletions packages/app/src/composables/useBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,12 @@ export default (context = useContext()) => {
const isRequestFailed = ref(false);
const blockItem = ref(<null | Block>null);

const getBatchNewProof = async (id: number) => {
try {
return await $fetch(`${context.currentNetwork.value.newProverUrl}/proof_${id}.bin`, { method: "HEAD" });
} catch (error: unknown) {
return null;
}
};

const getById = async (id: string) => {
isRequestPending.value = true;
isRequestFailed.value = false;

try {
const data = await $fetch(`${context.currentNetwork.value.apiUrl}/blocks/${id}`);
if (data.l1BatchNumber && data.proveTxHash) {
const proof = await getBatchNewProof(data.l1BatchNumber);
data.isProvenByNewProver = !!proof;
}
blockItem.value = data;
blockItem.value = await $fetch(`${context.currentNetwork.value.apiUrl}/blocks/${id}`);
} catch (error: unknown) {
blockItem.value = null;
if (!(error instanceof FetchError) || error.response?.status !== 404) {
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/composables/useRuntimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ export const DEFAULT_NETWORK: NetworkConfig = {
icon: "/images/icons/zksync-arrows.svg",
l1ExplorerUrl: "https://goerli.etherscan.io",
l2ChainId: 280,
l2NetworkName: "zkSync Era Testnet",
l2NetworkName: "zkSync Era Goerli Testnet",
l2WalletUrl: "https://goerli.portal.zksync.io/",
maintenance: false,
name: "goerli",
newProverUrl: "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
published: true,
rpcUrl: "https://testnet.era.zksync.dev",
};
Expand Down
5 changes: 0 additions & 5 deletions packages/app/src/configs/dev.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"l2WalletUrl": "http://localhost:3000",
"maintenance": false,
"name": "local",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "http://localhost:3050"
},
Expand All @@ -30,7 +29,6 @@
"l2WalletUrl": "https://goerli.staging-portal.zksync.dev/",
"maintenance": false,
"name": "goerli",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://testnet.era.zksync.dev"
},
Expand All @@ -46,7 +44,6 @@
"l2WalletUrl": "https://staging-portal.zksync.dev/?network=era-boojnet",
"maintenance": false,
"name": "sepolia",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://sepolia.era.zksync.dev"
},
Expand All @@ -63,7 +60,6 @@
"l2WalletUrl": "https://goerli-beta.staging-portal.zksync.dev/",
"maintenance": false,
"name": "goerli-beta",
"newProverUrl": "https://storage.googleapis.com/zksync-era-stage-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://z2-dev-api.zksync.dev"
},
Expand All @@ -81,7 +77,6 @@
"l2WalletUrl": "https://staging-portal.zksync.dev/",
"maintenance": false,
"name": "mainnet",
"newProverUrl": "https://storage.googleapis.com/zksync-era-mainnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://mainnet.era.zksync.io"
}
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export type NetworkConfig = {
icon: string;
verificationApiUrl?: string;
apiUrl: string;
newProverUrl: string;
rpcUrl: string;
bridgeUrl?: string;
l2NetworkName: string;
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/configs/local.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"l2WalletUrl": "http://localhost:3000",
"maintenance": false,
"name": "local",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "http://localhost:3050"
}
Expand Down
21 changes: 18 additions & 3 deletions packages/app/src/configs/production.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,30 @@
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://goerli.etherscan.io",
"l2ChainId": 280,
"l2NetworkName": "zkSync Era Testnet",
"l2NetworkName": "zkSync Era Goerli Testnet",
"l2WalletUrl": "https://goerli.portal.zksync.io/",
"maintenance": false,
"name": "goerli",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://testnet.era.zksync.dev"
},
{
"apiUrl": "https://block-explorer-api.sepolia.zksync.dev",
"verificationApiUrl": "https://explorer.sepolia.era.zksync.dev",
"bridgeUrl": "https://bridge.zksync.io",
"hostnames": [
"https://sepolia.explorer.zksync.io"
],
"icon": "/images/icons/zksync-arrows.svg",
"l1ExplorerUrl": "https://sepolia.etherscan.io",
"l2ChainId": 300,
"l2NetworkName": "zkSync Era Sepolia Testnet",
"l2WalletUrl": "https://portal.zksync.io/",
"maintenance": false,
"name": "sepolia",
"published": true,
"rpcUrl": "https://sepolia.era.zksync.dev"
},
{
"apiUrl": "https://block-explorer-api.mainnet.zksync.io",
"verificationApiUrl": "https://zksync2-mainnet-explorer.zksync.io",
Expand All @@ -32,7 +48,6 @@
"l2WalletUrl": "https://portal.zksync.io/",
"maintenance": false,
"name": "mainnet",
"newProverUrl": "https://storage.googleapis.com/zksync-era-mainnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://mainnet.era.zksync.io"
}
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/configs/staging.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"l2WalletUrl": "https://goerli.staging-portal.zksync.dev/",
"maintenance": false,
"name": "goerli",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://testnet.era.zksync.dev"
},
Expand All @@ -30,7 +29,6 @@
"l2WalletUrl": "https://staging-portal.zksync.dev/?network=era-boojnet",
"maintenance": false,
"name": "sepolia",
"newProverUrl": "https://storage.googleapis.com/zksync-era-testnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://sepolia.era.zksync.dev"
},
Expand All @@ -47,7 +45,6 @@
"l2WalletUrl": "https://goerli-beta.staging-portal.zksync.dev/",
"maintenance": false,
"name": "goerli-beta",
"newProverUrl": "https://storage.googleapis.com/zksync-era-stage-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://z2-dev-api.zksync.dev"
},
Expand All @@ -65,7 +62,6 @@
"l2WalletUrl": "https://staging-portal.zksync.dev/",
"maintenance": false,
"name": "mainnet",
"newProverUrl": "https://storage.googleapis.com/zksync-era-mainnet-proofs/proofs_fri",
"published": true,
"rpcUrl": "https://mainnet.era.zksync.io"
}
Expand Down
10 changes: 3 additions & 7 deletions packages/app/src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"general": {
"checkHere": "Check here",
"l2NetworkName": "zkSync Era",
"l1NetworkName": "Ethereum"
},
Expand Down Expand Up @@ -60,8 +59,7 @@
"executedAtTooltip": "Time when block was executed",
"notYetExecuted": "Not yet executed",
"notFound": "Not Found",
"notFoundHomePage": "We haven't had any blocks yet. Please, check again later.",
"newProverInfo": "This block was also proved with our upcoming new prover, Boojum. Want to learn more and verify yourself?"
"notFoundHomePage": "We haven't had any blocks yet. Please, check again later."
},
"status": {
"verified": "Verified",
Expand Down Expand Up @@ -164,8 +162,7 @@
"unableToLoadMore": "Unable to load more",
"tryAgain": "Try again ->"
},
"unknown": "Unknown",
"newProverInfo": "This transaction was also proved with our upcoming new prover, Boojum. Want to learn more and verify yourself?"
"unknown": "Unknown"
},
"logs": {
"name": "Name",
Expand Down Expand Up @@ -273,8 +270,7 @@
"age": "Age",
"notFound": "Not Found",
"notFoundHomePage": "We haven't had any batches yet. Please, check again later.",
"transactionsShort": "txns",
"newProverInfo": "This batch was also proved with our upcoming new prover, Boojum. Want to learn more and verify yourself?"
"transactionsShort": "txns"
},
"tooltipInfo": "Latest batches submitted to Ethereum Network",
"status": {
Expand Down
7 changes: 2 additions & 5 deletions packages/app/src/locales/uk.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"general": {
"checkHere": "Перевірити тут",
"l2NetworkName": "zkSync Era",
"l1NetworkName": "Ethereum"
},
Expand Down Expand Up @@ -37,8 +36,7 @@
"notYetProven": "Ще не підтверджений",
"executeTxHash": "Виконання хешу",
"executedAt": "Виконаний",
"notYetExecuted": "Ще не виконано",
"newProverInfo": "Цей блок був також підтверджений нашим новим майбутнім прувером, Boojum. Бажаєте дізнатися більше та перевірити самостійно?"
"notYetExecuted": "Ще не виконано"
},
"status": {
"verified": "Перевірено",
Expand Down Expand Up @@ -99,8 +97,7 @@
"showMore": "Показати більше транзакцій ->",
"unableToLoadMore": "Неможливо завантажити більше",
"tryAgain": "Спробуйте знову ->"
},
"newProverInfo": "Ця транзакція була також підтверджена нашим новим майбутнім прувером, Boojum. Бажаєте дізнатися більше та перевірити самостійно?"
}
},
"logs": {
"address": "Адреса",
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { checksumAddress } from "./formatters";

export const ETH_TOKEN_L2_ADDRESS = checksumAddress("0x000000000000000000000000000000000000800A");

export const NEW_PROVER_CLI_URL = "https://github.com/matter-labs/era-boojum-validator-cli";

export const PROXY_CONTRACT_IMPLEMENTATION_ABI = [
{
inputs: [],
Expand Down
Loading

0 comments on commit 60780c6

Please sign in to comment.