Skip to content

Commit

Permalink
Add constants for sepolia cancun/deneb upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
eunsoo-icon committed Feb 7, 2024
1 parent 00c6183 commit 7b1bdcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ private static byte[] computeForkVersion(BigInteger epoch, byte[] genesisValidat
return Constants.MAINNET_ALTAIR_VERSION;
return Constants.MAINNET_GENESIS_VERSION;
} else if (Arrays.equals(genesisValidatorsRoot, Constants.SEPOLIA_GENESIS_VALIDATORS_ROOT)) {
if (epoch.compareTo(Constants.SEPOLIA_DENEB_EPOCH) >= 0)
return Constants.SEPOLIA_DENEB_VERSION;
if (epoch.compareTo(Constants.SEPOLIA_CAPELLA_EPOCH) >= 0)
return Constants.SEPOLIA_CAPELLA_VERSION;
if (epoch.compareTo(Constants.SEPOLIA_BELLATRIX_EPOCH) >= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,21 @@ public class Constants {
public static final byte[] MAINNET_GENESIS_VALIDATORS_ROOT = StringUtil.hexToBytes("4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95");
public static final byte[] SEPOLIA_GENESIS_VALIDATORS_ROOT = StringUtil.hexToBytes("d8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078");

// https://github.com/ethereum/execution-specs/tree/master/network-upgrades/mainnet-upgrades
// read via /eth/v1/config/fork_schedule
public static final BigInteger MAINNET_ALTAIR_EPOCH = BigInteger.valueOf(74240);
public static final BigInteger MAINNET_BELLATRIX_EPOCH = BigInteger.valueOf(144896);
public static final BigInteger MAINNET_CAPELLA_EPOCH = BigInteger.valueOf(194048);
public static final BigInteger SEPOLIA_ALTAIR_EPOCH = BigInteger.valueOf(50);
public static final BigInteger SEPOLIA_BELLATRIX_EPOCH = BigInteger.valueOf(100);
public static final BigInteger SEPOLIA_CAPELLA_EPOCH = BigInteger.valueOf(56832);
public static final byte[] MAINNET_CAPELLA_VERSION = StringUtil.hexToBytes("03000000");
public static final byte[] MAINNET_BELLATRIX_VERSION = StringUtil.hexToBytes("02000000");
public static final byte[] MAINNET_ALTAIR_VERSION = StringUtil.hexToBytes("01000000");
public static final byte[] MAINNET_GENESIS_VERSION = StringUtil.hexToBytes("00000000");

public static final BigInteger SEPOLIA_ALTAIR_EPOCH = BigInteger.valueOf(50);
public static final BigInteger SEPOLIA_BELLATRIX_EPOCH = BigInteger.valueOf(100);
public static final BigInteger SEPOLIA_CAPELLA_EPOCH = BigInteger.valueOf(56832);
public static final BigInteger SEPOLIA_DENEB_EPOCH = BigInteger.valueOf(132608);
public static final byte[] SEPOLIA_DENEB_VERSION = StringUtil.hexToBytes("90000073");
public static final byte[] SEPOLIA_CAPELLA_VERSION = StringUtil.hexToBytes("90000072");
public static final byte[] SEPOLIA_BELLATRIX_VERSION = StringUtil.hexToBytes("90000071");
public static final byte[] SEPOLIA_ALTAIR_VERSION = StringUtil.hexToBytes("90000070");
Expand Down

0 comments on commit 7b1bdcc

Please sign in to comment.