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

Pectra touch-ups #744

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
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: 12 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
REACT_APP_IS_MERGE = "true"
REACT_APP_COMPOUNDING_CONTRACT_ADDRESS = "0x0000BBdDc7CE488642fb579F8B00f3a590007251"
REACT_APP_WITHDRAWAL_CONTRACT_ADDRESS = "0x00000961Ef480Eb55e80D19ad83579A64c007002"
REACT_APP_IS_MAINNET = "false"
REACT_APP_CONTRACT_ADDRESS = "0x4242424242424242424242424242424242424242"
REACT_APP_ETH_REQUIREMENT = "524288"
REACT_APP_ETH_DEPOSIT_OFFSET = "0"
REACT_APP_TESTNET_LAUNCHPAD_NAME = "devnet7"
REACT_APP_EL_EXPLORER_URL = "https://explorer.pectra-devnet-7.ethpandaops.io"
REACT_APP_GENESIS_FORK_VERSION = "0x10952561"
REACT_APP_RPC_URL = "https://rpc.pectra-devnet-7.ethpandaops.io"
REACT_APP_BEACONCHAIN_URL = "https://dora.pectra-devnet-7.ethpandaops.io/"
REACT_APP_FAUCET_URL = "https://www.holeskyfaucet.io/"
REACT_APP_MIN_GENESIS_TIME = "1740610800000"

[context.branch-deploy.environment]
NODE_VERSION = "14.19.2"
[context.dev.environment]
Expand Down
15 changes: 10 additions & 5 deletions src/components/TransactionStatusModal/TransactionProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,17 @@ export const TransactionProgress: React.FC<TransactionProgressProps> = ({
<FormattedMessage defaultMessage="Sign transaction with your wallet" />
</Text>
</Item>
<Item>
<ProgressCircle step={2} status={confirmOnChainStatus} />
<Text>
<FormattedMessage defaultMessage="Confirm on-chain" />
<div>
<Item>
<ProgressCircle step={2} status={confirmOnChainStatus} />
<Text>
<FormattedMessage defaultMessage="Confirm on execution layer" />
</Text>
</Item>
<Text style={{ fontSize: '0.875rem' }}>
<FormattedMessage defaultMessage="Confirmation on the execution layer does not guarantee that the request will be valid on the consensus layer. Please check the beacon explorer to confirm if the request is successful after 13 minutes (under normal finalization period)." />
</Text>
</Item>
</div>
</div>
);
};
36 changes: 24 additions & 12 deletions src/intl/compiled/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2079,6 +2079,12 @@
"value": "Exiting"
}
],
"Ab1qjD": [
{
"type": 0,
"value": "Confirm on execution layer"
}
],
"AbBgEs": [
{
"type": 0,
Expand Down Expand Up @@ -2287,6 +2293,12 @@
"value": "Proof of stake"
}
],
"CFjSbY": [
{
"type": 0,
"value": "Available to withdrawal"
}
],
"CPl2hh": [
{
"type": 0,
Expand Down Expand Up @@ -3125,6 +3137,12 @@
"value": "Formerly TurboGeth, Erigon is an Ethereum client built to enable performance optimizations."
}
],
"I7N/DN": [
{
"type": 0,
"value": "Confirmation on the execution layer does not guarantee that the request will be valid on the consensus layer. Please check the beacon explorer to confirm if the request is successful after 13 minutes (under normal finalization period)."
}
],
"ICbItT": [
{
"type": 0,
Expand Down Expand Up @@ -3381,12 +3399,6 @@
"value": "Further reading"
}
],
"Jge1Sx": [
{
"type": 0,
"value": "Force exit"
}
],
"JhUYU3": [
{
"type": 0,
Expand Down Expand Up @@ -6223,6 +6235,12 @@
"value": "Setup"
}
],
"dyfKG1": [
{
"type": 0,
"value": "Exit fully"
}
],
"dzdAcD": [
{
"type": 0,
Expand Down Expand Up @@ -7343,12 +7361,6 @@
"value": "Advisories"
}
],
"l5kq/q": [
{
"type": 0,
"value": "Confirm on-chain"
}
],
"l6OJpv": [
{
"type": 0,
Expand Down
18 changes: 12 additions & 6 deletions src/intl/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@
"AZaw+B": {
"message": "Exiting"
},
"Ab1qjD": {
"message": "Confirm on execution layer"
},
"AbBgEs": {
"message": "understanding validator effective balance"
},
Expand Down Expand Up @@ -856,6 +859,9 @@
"CF9vMR": {
"message": "Proof of stake"
},
"CFjSbY": {
"message": "Available to withdrawal"
},
"CPl2hh": {
"message": "I have reviewed the checklist and understand how withdrawals work."
},
Expand Down Expand Up @@ -1184,6 +1190,9 @@
"I7MjRD": {
"message": "Formerly TurboGeth, Erigon is an Ethereum client built to enable performance optimizations."
},
"I7N/DN": {
"message": "Confirmation on the execution layer does not guarantee that the request will be valid on the consensus layer. Please check the beacon explorer to confirm if the request is successful after 13 minutes (under normal finalization period)."
},
"ICbItT": {
"message": "This approach creates a single compounding account. Requires at least {MIN_ACTIVATION_BALANCE} {TICKER_NAME}, and can hold up to {MAX_EFFECTIVE_BALANCE}."
},
Expand Down Expand Up @@ -1265,9 +1274,6 @@
"Ja5vXW": {
"message": "Further reading"
},
"Jge1Sx": {
"message": "Force exit"
},
"JhUYU3": {
"message": "Download CLI app"
},
Expand Down Expand Up @@ -2352,6 +2358,9 @@
"dvr19k": {
"message": "Setup"
},
"dyfKG1": {
"message": "Exit fully"
},
"dzdAcD": {
"message": "Default Port"
},
Expand Down Expand Up @@ -2785,9 +2794,6 @@
"l5XCJW": {
"message": "Advisories"
},
"l5kq/q": {
"message": "Confirm on-chain"
},
"l6OJpv": {
"message": "First, create a venv virtualenv under repository directory:"
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Actions/components/ForceExit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const ForceExit: React.FC<Props> = ({ validator }) => {
const walletProvider = await (connector as AbstractConnector).getProvider();
const web3 = new Web3(walletProvider);

// Force exits have withdrawal amount of 0
// Full exits have withdrawal amount of 0
const {
transactionParams,
queue: withdrawalQueue,
Expand Down Expand Up @@ -111,7 +111,7 @@ const ForceExit: React.FC<Props> = ({ validator }) => {
return (
<>
<Button
label={<FormattedMessage defaultMessage="Force exit" />}
label={<FormattedMessage defaultMessage="Exit fully" />}
onClick={handleOpen}
destructive
/>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Actions/components/PartialWithdraw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ const PartialWithdraw: React.FC<Props> = ({ validator }) => {
}}
>
<div>
<FormattedMessage defaultMessage="Available" />:
<FormattedMessage defaultMessage="Available to withdrawal" />
:
</div>
<div
style={{ textAlign: 'end', fontFamily: 'monospace' }}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/ConnectWallet/web3Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ export enum NetworkChainId {
'Mainnet' = 1,
'Sepolia' = 11155111,
'Holesky' = 17000,
'devnet7' = 7032118028,
}

export const NetworkChainIdDict: { [id: string]: number } = {
Mainnet: 1,
Sepolia: 11155111,
Holesky: 17000,
devnet7: 7032118028,
};

/*
Expand All @@ -35,11 +37,13 @@ const supportedNetworks = [
NetworkChainId.Mainnet,
NetworkChainId.Sepolia,
NetworkChainId.Holesky,
NetworkChainId.devnet7,
];

enum Testnet {
'Sepolia',
'Holesky',
'devnet7',
}

enum Mainnet {
Expand All @@ -50,6 +54,7 @@ export const NetworkNameToChainId: { [key: string]: NetworkChainId } = {
Holesky: NetworkChainId.Holesky,
Mainnet: NetworkChainId.Mainnet,
Sepolia: NetworkChainId.Sepolia,
devnet7: NetworkChainId.devnet7,
};

export const TARGET_NETWORK_CHAIN_ID = IS_MAINNET
Expand Down
26 changes: 23 additions & 3 deletions src/utils/beaconchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,33 @@ import {
SLOTS_PER_EPOCH,
} from './envVars';

export const getEpochMsSinceGenesis = (epoch: number) =>
epoch * SLOTS_PER_EPOCH * MS_PER_SLOT;

/**
* Converts an epoch number to it's unix time in ms
*
* @param epoch - The epoch number to convert.
* @returns The corresponding unix time in ms.
*/
export const epochToDate = (epoch: number): Date => {
const msSinceGenesis = epoch * SLOTS_PER_EPOCH * MS_PER_SLOT;
return new Date(BEACON_CHAIN_GENESIS_TIME + msSinceGenesis);
export const epochToDate = (epoch: number): Date =>
new Date(BEACON_CHAIN_GENESIS_TIME + getEpochMsSinceGenesis(epoch));

/**
* Calculate current epoch using current time
*
* @returns The current epoch number
*/
export const getCurrentEpoch = (): number => {
const msElapsed = Date.now() - BEACON_CHAIN_GENESIS_TIME;
return Math.floor(msElapsed / MS_PER_SLOT / SLOTS_PER_EPOCH);
};

/**
* Calculate current epoch using current time
*
* @returns The current epoch number
*/
export const currentEpoch = Math.floor(
(Date.now() - BEACON_CHAIN_GENESIS_TIME) / MS_PER_SLOT / SLOTS_PER_EPOCH
);