Skip to content

missing required field 'miner' for Header error when calling ethclient.BlockByNumber(ctx, -1) #24632

@shryder

Description

@shryder

System information

Geth version: Version: 1.10.15-stable
OS & Version: Linux
Commit hash : 8be800ffa9c4992666e2620e0ab4725a1a83352b

Expected behaviour

Return rough idea of what the next block is going to look like.

Actual behaviour

Errors out with: missing required field 'miner' for Header

Steps to reproduce the behaviour

	ethClient, err := ethclient.Dial("http://127.0.0.1:8545")
	if err != nil {
		log.Fatal("Couldn't connect to eth node", err)
	}

	ctx := context.Background()
	block, err := ethClient.BlockByNumber(ctx, big.NewInt(-1))
	if err != nil {
		log.Fatal("Couldn't fetch pending block: ", err)
	}

I'm basically trying to find a way to get a rough idea on how the next block would look like if it were to be mined by my geth node (without actually mining it).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions