Skip to content

Commit 66ed85e

Browse files
tmelhaobuddh0
authored andcommitted
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 2893079 commit 66ed85e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

core/chain_makers_test.go

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ func ProcessBeaconBlockRoot(beaconRoot common.Hash, vmenv *vm.EVM, statedb *stat
239239
GasPrice: common.Big0,
240240
GasFeeCap: common.Big0,
241241
GasTipCap: common.Big0,
242-
To: &params.BeaconRootsStorageAddress,
242+
To: &params.BeaconRootsAddress,
243243
Data: beaconRoot[:],
244244
}
245245
vmenv.Reset(NewEVMTxContext(msg), statedb)
246-
statedb.AddAddressToAccessList(params.BeaconRootsStorageAddress)
246+
statedb.AddAddressToAccessList(params.BeaconRootsAddress)
247247
_, _, _ = vmenv.Call(vm.AccountRef(msg.From), *msg.To, msg.Data, 30_000_000, common.U2560)
248248
statedb.Finalise(true)
249249
}

params/protocol_params.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ var (
194194
MinimumDifficulty = big.NewInt(131072) // The minimum that the difficulty may ever be.
195195
DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
196196

197-
// BeaconRootsStorageAddress is the address where historical beacon roots are stored as per EIP-4788
198-
BeaconRootsStorageAddress = common.HexToAddress("0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02")
197+
// BeaconRootsAddress is the address where historical beacon roots are stored as per EIP-4788
198+
BeaconRootsAddress = common.HexToAddress("0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02")
199199
// SystemAddress is where the system-transaction is sent from as per EIP-4788
200-
SystemAddress common.Address = common.HexToAddress("0xfffffffffffffffffffffffffffffffffffffffe")
200+
SystemAddress = common.HexToAddress("0xfffffffffffffffffffffffffffffffffffffffe")
201201
)

0 commit comments

Comments
 (0)