Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"missing required field 'maxFeePerDataGas' for txdata" when fetching block by number #29773

Closed
antagonisuto opened this issue May 14, 2024 · 3 comments
Labels

Comments

@antagonisuto
Copy link

System information

Geth version: geth version 1.13.14-stable-2bd6bd01
CL client & version: Lighthouse v5.1.2-5ce1619
OS & Version: Rocky Linux 8.6

Expected behaviour

to get the block with full transactions.

Actual behaviour

panic: missing required field 'maxFeePerDataGas' for txdata
error appears when getting from BlockByNumber() and TransactionByHash()

I uses client.SubscribeNewHead() to get newest block header for getting all transactions. In general, it gives errors after each two successful blocks.
i.e blockNumber: 19860848
TxHash: 0xfb399a758ca8df66abd09c02eaae93cf9349c516a749a9a72992e2cb511a1610

Steps to reproduce the behaviour

BlockByNumber

	client, err := ethclient.Dial("ws://ip:port")
	if err != nil {
		panic(err)
	}
	head := big.NewInt(19860848)
	_, err = client.BlockByNumber(context.Background(), head)
	if err != nil {
		panic(err)
	}
	tx, _, err := client.TransactionByHash(context.Background(), common.HexToHash("0xfb399a758ca8df66abd09c02eaae93cf9349c516a749a9a72992e2cb511a1610"))
	if err != nil {
		panic(err)
	}

Backtrace

we have upgraded from
geth 1.12.0
lighthouse 4.3.0
due to lighthouse ver. stopped support geth with such error

ERRO Error updating deposit contract cache   error: Invalid endpoint state: RequestFailed("eth_chainId call failed Auth(InvalidToken)"), retry_millis: 60000, service: beacon
@antagonisuto
Copy link
Author

Also, unusual logs from node:
Chain reorg detected number=19,860,615 hash=ecba0d..d28a47 drop=1 dropfrom=44d112..7a7212 add=1 addfrom=225a64..3abdfa

Extend chain add=2 number=19,860,672 hash=46584a..55635b

WARN [05-13|17:03:27.841] Ignoring already known beacon payload number=19,860,671 hash=9d1892..f20aac age=16s

ERROR[05-13|16:52:02.026] Demoting invalidated transaction hash=34ce41..fccaa3

WARN [05-13|17:03:27.841] Ignoring already known beacon payload number=19,860,671 hash=9d1892..f20aac age=16s

Logs from lighthouse seems fine.

@antagonisuto antagonisuto reopened this May 14, 2024
@holiman holiman changed the title panic: missing required field 'maxFeePerDataGas' for txdata "missing required field 'maxFeePerDataGas' for txdata" when fetching block by number May 14, 2024
@holiman
Copy link
Contributor

holiman commented May 15, 2024

Repro program, which uses a mainnet geth-node as a backend:

package main

import (
	"context"
	"fmt"
	"math/big"
	"os"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/ethclient"
	"github.com/ethereum/go-ethereum/rpc"
)

func main() {
	rpcRaw, err := rpc.Dial("https://geth.mainnet.ethpandaops.io")
	if err != nil {
		panic(err)
	}
	rpcRaw.SetHeader("CF-Access-Client-Id", os.Getenv("CFID"))
	rpcRaw.SetHeader("CF-Access-Client-Secret", os.Getenv("CFSEC"))
	client := ethclient.NewClient(rpcRaw)
	id, err := client.NetworkID(context.Background())
	fmt.Printf("id %v err %v\n", id, err)
	block, err := client.BlockByNumber(context.Background(), big.NewInt(19860848))
	if err != nil {
		panic(err)
	}
	fmt.Printf("block: %v\n", block.Number())
	tx, _, err := client.TransactionByHash(context.Background(), common.HexToHash("0xfb399a758ca8df66abd09c02eaae93cf9349c516a749a9a72992e2cb511a1610"))
	if err != nil {
		panic(err)
	}
	fmt.Printf("tx %v\n", tx.Hash())
}

I still need to check exactly what version the backend is running, but so far looks good to me

[user@work go-ethereum]$ go run ./cmd/foo/
id 1 err <nil>
block: 19860848
tx 0xfb399a758ca8df66abd09c02eaae93cf9349c516a749a9a72992e2cb511a1610

@antagonisuto
Copy link
Author

antagonisuto commented May 15, 2024

have changed from:

go 1.20
github.com/ethereum/go-ethereum v1.12.0

to

go 1.21.6
github.com/ethereum/go-ethereum v1.14.3

problem is solved, thank you very much ~

@holiman holiman closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants