Skip to content

Commit cffb7c8

Browse files
authored
params: use the same variable name as EIP-4788 (ethereum#29195)
In https://eips.ethereum.org/EIPS/eip-4788 the name `BEACON_ROOTS_ADDRESS` is used. This change makes geth use the same variable name to avoid confusion.
1 parent d28adb6 commit cffb7c8

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

core/chain_makers_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ func TestGeneratePOSChain(t *testing.T) {
4747
gspec = &Genesis{
4848
Config: &config,
4949
Alloc: types.GenesisAlloc{
50-
address: {Balance: funds},
51-
params.BeaconRootsStorageAddress: {Balance: common.Big0, Code: asm4788},
50+
address: {Balance: funds},
51+
params.BeaconRootsAddress: {Balance: common.Big0, Code: asm4788},
5252
},
5353
BaseFee: big.NewInt(params.InitialBaseFee),
5454
Difficulty: common.Big1,
@@ -180,7 +180,7 @@ func TestGeneratePOSChain(t *testing.T) {
180180
}
181181
state, _ := blockchain.State()
182182
idx := block.Time()%8191 + 8191
183-
got := state.GetState(params.BeaconRootsStorageAddress, common.BigToHash(new(big.Int).SetUint64(idx)))
183+
got := state.GetState(params.BeaconRootsAddress, common.BigToHash(new(big.Int).SetUint64(idx)))
184184
if got != want {
185185
t.Fatalf("block %d, wrong parent beacon root in state: got %s, want %s", i, got, want)
186186
}

core/state_processor.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ func ProcessBeaconBlockRoot(beaconRoot common.Hash, vmenv *vm.EVM, statedb *stat
181181
GasPrice: common.Big0,
182182
GasFeeCap: common.Big0,
183183
GasTipCap: common.Big0,
184-
To: &params.BeaconRootsStorageAddress,
184+
To: &params.BeaconRootsAddress,
185185
Data: beaconRoot[:],
186186
}
187187
vmenv.Reset(NewEVMTxContext(msg), statedb)
188-
statedb.AddAddressToAccessList(params.BeaconRootsStorageAddress)
188+
statedb.AddAddressToAccessList(params.BeaconRootsAddress)
189189
_, _, _ = vmenv.Call(vm.AccountRef(msg.From), *msg.To, msg.Data, 30_000_000, common.U2560)
190190
statedb.Finalise(true)
191191
}

eth/catalyst/api_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ func generateMergeChain(n int, merged bool) (*core.Genesis, []*types.Block) {
7272
genesis := &core.Genesis{
7373
Config: &config,
7474
Alloc: types.GenesisAlloc{
75-
testAddr: {Balance: testBalance},
76-
params.BeaconRootsStorageAddress: {Balance: common.Big0, Code: common.Hex2Bytes("3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500")},
75+
testAddr: {Balance: testBalance},
76+
params.BeaconRootsAddress: {Balance: common.Big0, Code: common.Hex2Bytes("3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500")},
7777
},
7878
ExtraData: []byte("test genesis"),
7979
Timestamp: 9000,
@@ -1650,10 +1650,10 @@ func TestParentBeaconBlockRoot(t *testing.T) {
16501650
rootIdx = common.BigToHash(big.NewInt(int64((execData.ExecutionPayload.Timestamp % 98304) + 98304)))
16511651
)
16521652

1653-
if num := db.GetState(params.BeaconRootsStorageAddress, timeIdx); num != timeIdx {
1653+
if num := db.GetState(params.BeaconRootsAddress, timeIdx); num != timeIdx {
16541654
t.Fatalf("incorrect number stored: want %s, got %s", timeIdx, num)
16551655
}
1656-
if root := db.GetState(params.BeaconRootsStorageAddress, rootIdx); root != *blockParams.BeaconRoot {
1656+
if root := db.GetState(params.BeaconRootsAddress, rootIdx); root != *blockParams.BeaconRoot {
16571657
t.Fatalf("incorrect root stored: want %s, got %s", *blockParams.BeaconRoot, root)
16581658
}
16591659
}

params/protocol_params.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ var (
184184
MinimumDifficulty = big.NewInt(131072) // The minimum that the difficulty may ever be.
185185
DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
186186

187-
// BeaconRootsStorageAddress is the address where historical beacon roots are stored as per EIP-4788
188-
BeaconRootsStorageAddress = common.HexToAddress("0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02")
187+
// BeaconRootsAddress is the address where historical beacon roots are stored as per EIP-4788
188+
BeaconRootsAddress = common.HexToAddress("0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02")
189189
// SystemAddress is where the system-transaction is sent from as per EIP-4788
190-
SystemAddress common.Address = common.HexToAddress("0xfffffffffffffffffffffffffffffffffffffffe")
190+
SystemAddress = common.HexToAddress("0xfffffffffffffffffffffffffffffffffffffffe")
191191
)

0 commit comments

Comments
 (0)