Skip to content

Commit 7b1bdcc

Browse files
committed
Add constants for sepolia cancun/deneb upgrade
1 parent 00c6183 commit 7b1bdcc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

bmv/eth2/src/main/java/foundation/icon/btp/bmv/eth2/BlockUpdate.java

+2
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ private static byte[] computeForkVersion(BigInteger epoch, byte[] genesisValidat
167167
return Constants.MAINNET_ALTAIR_VERSION;
168168
return Constants.MAINNET_GENESIS_VERSION;
169169
} else if (Arrays.equals(genesisValidatorsRoot, Constants.SEPOLIA_GENESIS_VALIDATORS_ROOT)) {
170+
if (epoch.compareTo(Constants.SEPOLIA_DENEB_EPOCH) >= 0)
171+
return Constants.SEPOLIA_DENEB_VERSION;
170172
if (epoch.compareTo(Constants.SEPOLIA_CAPELLA_EPOCH) >= 0)
171173
return Constants.SEPOLIA_CAPELLA_VERSION;
172174
if (epoch.compareTo(Constants.SEPOLIA_BELLATRIX_EPOCH) >= 0)

bmv/eth2/src/main/java/foundation/icon/btp/bmv/eth2/Constants.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,21 @@ public class Constants {
2727
public static final byte[] MAINNET_GENESIS_VALIDATORS_ROOT = StringUtil.hexToBytes("4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95");
2828
public static final byte[] SEPOLIA_GENESIS_VALIDATORS_ROOT = StringUtil.hexToBytes("d8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078");
2929

30+
// https://github.com/ethereum/execution-specs/tree/master/network-upgrades/mainnet-upgrades
31+
// read via /eth/v1/config/fork_schedule
3032
public static final BigInteger MAINNET_ALTAIR_EPOCH = BigInteger.valueOf(74240);
3133
public static final BigInteger MAINNET_BELLATRIX_EPOCH = BigInteger.valueOf(144896);
3234
public static final BigInteger MAINNET_CAPELLA_EPOCH = BigInteger.valueOf(194048);
33-
public static final BigInteger SEPOLIA_ALTAIR_EPOCH = BigInteger.valueOf(50);
34-
public static final BigInteger SEPOLIA_BELLATRIX_EPOCH = BigInteger.valueOf(100);
35-
public static final BigInteger SEPOLIA_CAPELLA_EPOCH = BigInteger.valueOf(56832);
3635
public static final byte[] MAINNET_CAPELLA_VERSION = StringUtil.hexToBytes("03000000");
3736
public static final byte[] MAINNET_BELLATRIX_VERSION = StringUtil.hexToBytes("02000000");
3837
public static final byte[] MAINNET_ALTAIR_VERSION = StringUtil.hexToBytes("01000000");
3938
public static final byte[] MAINNET_GENESIS_VERSION = StringUtil.hexToBytes("00000000");
39+
40+
public static final BigInteger SEPOLIA_ALTAIR_EPOCH = BigInteger.valueOf(50);
41+
public static final BigInteger SEPOLIA_BELLATRIX_EPOCH = BigInteger.valueOf(100);
42+
public static final BigInteger SEPOLIA_CAPELLA_EPOCH = BigInteger.valueOf(56832);
43+
public static final BigInteger SEPOLIA_DENEB_EPOCH = BigInteger.valueOf(132608);
44+
public static final byte[] SEPOLIA_DENEB_VERSION = StringUtil.hexToBytes("90000073");
4045
public static final byte[] SEPOLIA_CAPELLA_VERSION = StringUtil.hexToBytes("90000072");
4146
public static final byte[] SEPOLIA_BELLATRIX_VERSION = StringUtil.hexToBytes("90000071");
4247
public static final byte[] SEPOLIA_ALTAIR_VERSION = StringUtil.hexToBytes("90000070");

0 commit comments

Comments
 (0)