Skip to content

Commit 815a841

Browse files
committed
internal/ethapi: use genesis header instead of block object
1 parent 4a63b16 commit 815a841

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/ethapi/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ type configResponse struct {
11711171

11721172
// Config implements the EIP-7910 eth_config method.
11731173
func (api *BlockChainAPI) Config(ctx context.Context) (*configResponse, error) {
1174-
genesis, err := api.b.BlockByNumber(ctx, 0)
1174+
genesis, err := api.b.HeaderByNumber(ctx, 0)
11751175
if err != nil {
11761176
return nil, fmt.Errorf("unable to load genesis: %w", err)
11771177
}
@@ -1188,7 +1188,7 @@ func (api *BlockChainAPI) Config(ctx context.Context) (*configResponse, error) {
11881188
for addr, c := range vm.ActivePrecompiledContracts(rules) {
11891189
precompiles[c.Name()] = addr
11901190
}
1191-
forkid := forkid.NewID(c, genesis, ^uint64(0), t).Hash
1191+
forkid := forkid.NewID(c, types.NewBlockWithHeader(genesis), ^uint64(0), t).Hash
11921192
return &config{
11931193
ActivationTime: t,
11941194
BlobSchedule: c.BlobConfig(c.LatestFork(t)),

internal/ethapi/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3842,9 +3842,9 @@ func (b configTimeBackend) ChainConfig() *params.ChainConfig {
38423842
return b.genesis.Config
38433843
}
38443844

3845-
func (b configTimeBackend) BlockByNumber(_ context.Context, n rpc.BlockNumber) (*types.Block, error) {
3845+
func (b configTimeBackend) HeaderByNumber(_ context.Context, n rpc.BlockNumber) (*types.Header, error) {
38463846
if n == 0 {
3847-
return b.genesis.ToBlock(), nil
3847+
return b.genesis.ToBlock().Header(), nil
38483848
}
38493849
panic("not implemented")
38503850
}

0 commit comments

Comments
 (0)