Skip to content

Commit 8511786

Browse files
committed
Update devnet spec to mirror mainnet specs
1 parent 022570c commit 8511786

File tree

8 files changed

+41
-79
lines changed

8 files changed

+41
-79
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"args": [
3434
"genesis",
3535
"add-premined-deposit",
36-
"32000000000",
36+
"250000000000000",
3737
"0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4",
3838
"--home=${workspaceFolder}/.tmp/beacond",
3939
],
@@ -166,4 +166,4 @@
166166
"suppressMultipleSessionWarning": true,
167167
}
168168
]
169-
}
169+
}

cli/commands/genesis/storage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func setupMockCLGenesis(t *testing.T, tmpDir string) string {
123123
"deposits": []interface{}{
124124
map[string]interface{}{
125125
"data": map[string]interface{}{
126-
"amount": "32000000000",
126+
"amount": "250000000000000",
127127
"pubkey": "0x1234",
128128
"withdrawal_address": "0x5678",
129129
"signature": "0x9abc",

config/spec/devnet.go

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,9 @@ package spec
2222

2323
import (
2424
"github.com/berachain/beacon-kit/chain"
25-
"github.com/berachain/beacon-kit/primitives/common"
26-
"github.com/ethereum/go-ethereum/params"
2725
)
2826

2927
const (
30-
// devnetEVMInflationAddress is the address of the EVM inflation contract.
31-
devnetEVMInflationAddress = "0x6942069420694206942069420694206942069420"
32-
33-
// devnetEVMInflationPerBlock is the amount of native EVM balance (in units
34-
// of Gwei) to be minted per EL block.
35-
devnetEVMInflationPerBlock = 10 * params.GWei
36-
37-
// devnetMaxStakeAmount is the maximum amount of native EVM balance (in units
38-
// of Gwei) that can be staked.
39-
devnetMaxStakeAmount = 4000 * params.GWei
40-
4128
// devnetDeneb1ForkTime is the timestamp at which the Deneb1 fork occurs.
4229
// A value of 64 is set for the fork to occur 64 seconds into the test,
4330
// which is approximately 1 epoch.
@@ -52,20 +39,9 @@ const (
5239

5340
// devnetElectraForkTime is the timestamp at which the Electra fork occurs.
5441
devnetElectraForkTime = defaultElectraForkTime
55-
56-
// devnetEVMInflationAddressDeneb1 is the address of the EVM inflation contract
57-
// after the Deneb1 fork.
58-
devnetEVMInflationAddressDeneb1 = "0x4206942069420694206942069420694206942069"
59-
60-
// devnetEVMInflationPerBlockDeneb1 is the amount of native EVM balance (in units
61-
// of Gwei) to be minted per EL block after the Deneb1 fork.
62-
devnetEVMInflationPerBlockDeneb1 = 11 * params.GWei
6342
)
6443

65-
// DevnetChainSpecData is the chain.SpecData for a devnet. It is similar to mainnet but
66-
// has different values for testing EVM inflation and staking.
67-
//
68-
// TODO: remove modifications from mainnet spec to align with mainnet behavior.
44+
// DevnetChainSpecData is the chain.SpecData for a devnet.
6945
func DevnetChainSpecData() *chain.SpecData {
7046
specData := MainnetChainSpecData()
7147
specData.DepositEth1ChainID = DevnetEth1ChainID
@@ -74,20 +50,6 @@ func DevnetChainSpecData() *chain.SpecData {
7450
specData.Deneb1ForkTime = devnetDeneb1ForkTime
7551
specData.ElectraForkTime = devnetElectraForkTime
7652

77-
// EVM inflation is different from mainnet to test.
78-
specData.EVMInflationAddressGenesis = common.NewExecutionAddressFromHex(devnetEVMInflationAddress)
79-
specData.EVMInflationPerBlockGenesis = devnetEVMInflationPerBlock
80-
81-
// EVM inflation is different from mainnet for now, after the Deneb1 fork.
82-
specData.EVMInflationAddressDeneb1 = common.NewExecutionAddressFromHex(devnetEVMInflationAddressDeneb1)
83-
specData.EVMInflationPerBlockDeneb1 = devnetEVMInflationPerBlockDeneb1
84-
85-
// Staking is different from mainnet for now.
86-
specData.MaxEffectiveBalance = devnetMaxStakeAmount
87-
specData.EjectionBalance = defaultEjectionBalance
88-
specData.EffectiveBalanceIncrement = defaultEffectiveBalanceIncrement
89-
specData.SlotsPerEpoch = defaultSlotsPerEpoch
90-
9153
return specData
9254
}
9355

consensus-types/types/state_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func generateValidBeaconState() *types.BeaconState {
5353
{
5454
Pubkey: [48]byte{0x01},
5555
WithdrawalCredentials: [32]byte{0x02},
56-
EffectiveBalance: 32000000000,
56+
EffectiveBalance: 250000000000000,
5757
Slashed: false,
5858
ActivationEligibilityEpoch: 1,
5959
ActivationEpoch: 2,
@@ -63,15 +63,15 @@ func generateValidBeaconState() *types.BeaconState {
6363
{
6464
Pubkey: [48]byte{0x03},
6565
WithdrawalCredentials: [32]byte{0x04},
66-
EffectiveBalance: 31000000000,
66+
EffectiveBalance: 240000000000000,
6767
Slashed: true,
6868
ActivationEligibilityEpoch: 3,
6969
ActivationEpoch: 4,
7070
ExitEpoch: 5,
7171
WithdrawableEpoch: 6,
7272
},
7373
},
74-
Balances: []uint64{32000000000, 31000000000},
74+
Balances: []uint64{250000000000000, 240000000000000},
7575
RandaoMixes: generateRandomBytes32(65536),
7676
Slashings: []math.Gwei{1000000000, 2000000000},
7777
NextWithdrawalIndex: 7,

kurtosis/src/nodes/consensus/beacond/launcher.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def get_config(node_struct, engine_dial_url, chain_id, chain_spec, genesis_depos
7171
"CHAIN_SPEC": chain_spec,
7272
"BEACOND_CHAIN_SPEC": chain_spec,
7373
"WITHDRAWAL_ADDRESS": "0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4",
74-
"DEPOSIT_AMOUNT": "32000000000",
74+
"DEPOSIT_AMOUNT": "250000000000000",
7575
"GENESIS_DEPOSIT_COUNT_HEX": genesis_deposit_count_hex,
7676
"GENESIS_DEPOSITS_ROOT": genesis_deposits_root,
7777
},

kurtosis/src/nodes/consensus/beacond/node.star

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_genesis_env_vars(cl_service_name, chain_id, chain_spec):
5858
"BEACOND_ENABLE_PROMETHEUS": "true",
5959
"ETH_GENESIS": "/root/eth_genesis/genesis.json",
6060
"WITHDRAWAL_ADDRESS": "0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4",
61-
"DEPOSIT_AMOUNT": "32000000000",
61+
"DEPOSIT_AMOUNT": "250000000000000",
6262
"BEACOND_CHAIN_SPEC": chain_spec,
6363
"CHAIN_SPEC": chain_spec,
6464
}

testing/e2e/e2e_api_test.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (s *BeaconKitE2ESuite) TestBeaconValidatorsWithIndices() {
144144
s.Require().
145145
True(validator.Validator.EffectiveBalance > 0, "Effective balance should be positive")
146146
s.Require().
147-
True(validator.Validator.EffectiveBalance <= 32e9, "Effective balance should not exceed 32 ETH")
147+
True(validator.Validator.EffectiveBalance <= 250e12, "Effective balance should not exceed 250_000 ETH")
148148

149149
s.Require().
150150
False(validator.Validator.Slashed, "Slashed status should not be true")
@@ -163,7 +163,7 @@ func (s *BeaconKitE2ESuite) TestBeaconValidatorsWithIndices() {
163163
s.Require().
164164
True(validator.Balance > 0, "Validator balance should be positive")
165165
s.Require().
166-
True(validator.Balance <= 32e9, "Validator balance should not exceed 32 ETH")
166+
True(validator.Balance <= 250e12, "Validator balance should not exceed 250_000 ETH")
167167
}
168168

169169
// TestValidatorsEmptyIndicesAndStatuses tests that querying validators with empty indices and empty statuses returns all validators.
@@ -272,8 +272,8 @@ func (s *BeaconKitE2ESuite) TestValidatorBalances() {
272272
balanceMap := balancesResp.Data
273273
for _, balance := range balanceMap {
274274
s.Require().True(balance > 0, "Validator balance should be positive")
275-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
276-
s.Require().True(balance <= 4e12, "Validator balance should not exceed 4e12 gwei (4000 BERA)")
275+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
276+
s.Require().True(balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
277277
}
278278
}
279279

@@ -299,8 +299,8 @@ func (s *BeaconKitE2ESuite) TestValidatorBalancesWithSpecificIndices() {
299299
s.Require().NotNil(balance)
300300
s.Require().Contains(indices, index)
301301
s.Require().True(balance > 0, "Validator balance should be positive")
302-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
303-
s.Require().True(balance <= 4e12, "Validator balance should not exceed 4000 BERA")
302+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
303+
s.Require().True(balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
304304
}
305305
}
306306

@@ -326,8 +326,8 @@ func (s *BeaconKitE2ESuite) TestValidatorBalancesMultipleIndices() {
326326
for index, balance := range balancesResp.Data {
327327
returnedIndices[index] = struct{}{}
328328
s.Require().True(balance > 0)
329-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
330-
s.Require().True(balance <= 4e12, "Validator balance should not exceed 4000 BERA")
329+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
330+
s.Require().True(balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
331331
}
332332
for _, idx := range indices {
333333
_, exists := returnedIndices[idx]
@@ -379,8 +379,8 @@ func (s *BeaconKitE2ESuite) TestValidatorBalancesWithPubkey() {
379379
for _, balance := range balancesResp.Data {
380380
s.Require().NotNil(balance)
381381
s.Require().True(balance > 0, "Validator balance should be positive")
382-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
383-
s.Require().True(balance <= 4e12, "Validator balance should not exceed 4000 BERA")
382+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
383+
s.Require().True(balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
384384
}
385385
}
386386

@@ -582,8 +582,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorBalances() {
582582

583583
for _, balance := range *balancesResp {
584584
s.Require().True(balance.Balance > 0, "Validator balance should be positive")
585-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
586-
s.Require().True(balance.Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
585+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
586+
s.Require().True(balance.Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
587587
}
588588
}
589589

@@ -600,8 +600,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorBalancesWithSpecificID() {
600600

601601
s.Require().Len(*balancesResp, 1)
602602
s.Require().True((*balancesResp)[0].Balance > 0, "Validator balance should be positive")
603-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
604-
s.Require().True((*balancesResp)[0].Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
603+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
604+
s.Require().True((*balancesResp)[0].Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
605605
}
606606

607607
// TestGetValidatorBalancesWithMultipleIDs tests querying validator balances with multiple IDs.
@@ -621,8 +621,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorBalancesWithMultipleIDs() {
621621

622622
for _, balance := range *balancesResp {
623623
s.Require().True(balance.Balance > 0, "Validator balance should be positive")
624-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
625-
s.Require().True(balance.Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
624+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
625+
s.Require().True(balance.Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
626626
}
627627
}
628628

@@ -681,8 +681,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorBalancesWithPublicKey() {
681681

682682
s.Require().Len(*balancesResp, 1)
683683
s.Require().True((*balancesResp)[0].Balance > 0, "Validator balance should be positive")
684-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
685-
s.Require().True((*balancesResp)[0].Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
684+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
685+
s.Require().True((*balancesResp)[0].Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
686686
}
687687

688688
// TestGetValidatorBalancesWithInvalidPublicKey tests querying validator balances with invalid public key.
@@ -717,9 +717,9 @@ func (s *BeaconKitE2ESuite) TestGetValidatorBalancesForGenesis() {
717717

718718
for _, balance := range *balancesResp {
719719
s.Require().True(balance.Balance > 0, "Validator balance should be positive")
720-
// At genesis, the validator balance is 32 BERA.
721-
// 32e9 Gwei = 32 * 10^9 Gwei = 32,000,000,000 Gwei = 32 BERA
722-
s.Require().True(balance.Balance <= 32e9, "Validator balance should not exceed 32 BERA")
720+
// At genesis, the validator balance is 250_000 BERA.
721+
// 250e12 Gwei = 250_000 * 10^9 Gwei = 250,000,000,000,000 Gwei = 250_000 BERA
722+
s.Require().True(balance.Balance <= 250e12, "Validator balance should not exceed 250_000 BERA")
723723
}
724724
}
725725

@@ -779,8 +779,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorsWithStateHead() {
779779
for _, validator := range *validators {
780780
s.Require().True(validator.Status == "active_ongoing")
781781
s.Require().True(validator.Balance > 0, "Validator balance should be positive")
782-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
783-
s.Require().True(validator.Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
782+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
783+
s.Require().True(validator.Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
784784
}
785785
}
786786

@@ -800,8 +800,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorsWithID() {
800800
s.Require().Equal(uint64(0), (*validators)[0].Index, "Validator index should be 0")
801801
s.Require().Equal("active_ongoing", (*validators)[0].Status, "Validator status should be active_ongoing")
802802
s.Require().True((*validators)[0].Balance > 0, "Validator balance should be positive")
803-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
804-
s.Require().True((*validators)[0].Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
803+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
804+
s.Require().True((*validators)[0].Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
805805
}
806806

807807
// TestGetValidatorsWithStatus tests querying validators with status parameter.
@@ -820,8 +820,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorsWithStatus() {
820820
for _, validator := range *validators {
821821
s.Require().Equal("active_ongoing", validator.Status, "Validator status should be active_ongoing")
822822
s.Require().True(validator.Balance > 0, "Validator balance should be positive")
823-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
824-
s.Require().True(validator.Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
823+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
824+
s.Require().True(validator.Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
825825
}
826826
}
827827

@@ -846,8 +846,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorsWithIDAndStatus() {
846846
s.Require().Equal(uint64(0), (*validators)[0].Index, "Validator index should be 0")
847847
s.Require().Equal("active_ongoing", (*validators)[0].Status, "Validator status should be active_ongoing")
848848
s.Require().True((*validators)[0].Balance > 0, "Validator balance should be positive")
849-
// 4e12 Gwei = 4 * 10^12 Gwei = 4,000,000,000,000 Gwei = 4000 BERA
850-
s.Require().True((*validators)[0].Balance <= 4e12, "Validator balance should not exceed 4000 BERA")
849+
// 10e15 Gwei = 10_000_000 * 10^9 Gwei = 10,000,000,000,000,000 Gwei = 10_000_000 BERA
850+
s.Require().True((*validators)[0].Balance <= 10e15, "Validator balance should not exceed 10_000_000 BERA")
851851
}
852852

853853
// TestGetValidatorsWithStateGenesis tests querying validators with state genesis.
@@ -864,8 +864,8 @@ func (s *BeaconKitE2ESuite) TestGetValidatorsWithStateGenesis() {
864864
for _, validator := range *validators {
865865
s.Require().True(validator.Status == "active_ongoing")
866866
s.Require().True(validator.Balance > 0, "Validator balance should be positive")
867-
// 32e9 Gwei = 32 * 10^9 Gwei = 32,000,000,000 Gwei = 32 BERA
868-
s.Require().True(validator.Balance <= 32e9, "Validator balance should not exceed 32 BERA")
867+
// 250e12 Gwei = 250_000 * 10^9 Gwei = 250,000,000,000,000 Gwei = 250_000 BERA
868+
s.Require().True(validator.Balance <= 250e12, "Validator balance should not exceed 250_000 BERA")
869869
}
870870
}
871871

testing/files/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
8888
KZG_PATH=$network_dir/kzg-trusted-setup.json
8989
else
9090
./build/bin/beacond genesis add-premined-deposit --home $HOMEDIR $CHAIN_SPEC_ARG \
91-
32000000000 0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4
91+
250000000000000 0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4
9292
./build/bin/beacond genesis collect-premined-deposits --home $HOMEDIR $CHAIN_SPEC_ARG
9393
./build/bin/beacond genesis set-deposit-storage "$ETH_GENESIS" --home $HOMEDIR $CHAIN_SPEC_ARG
9494
./build/bin/beacond genesis set-deposit-storage "$ETH_NETHER_GENESIS" --nethermind --home $HOMEDIR $CHAIN_SPEC_ARG

0 commit comments

Comments
 (0)