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

Calling the eth_getTransactionReceipt method yielded different results #28938

Closed
J1a-wei opened this issue Feb 6, 2024 · 3 comments
Closed

Comments

@J1a-wei
Copy link

J1a-wei commented Feb 6, 2024

Version

geth: v1.13.11
prysm: v4.2.1

Question

Hi team, I deployed two sets of nodes on sepolia and called eth_getTransactionReceipt, resulting in two surprising outcomes. I checked the block height synchronization of both nodes, and they are in the latest state. Could it be a consensus issue between these two nodes?
The transaction hash I queried is: 0xc6268be12c9e8e2afaec8d92753646aef2121a019a883b8292b9f2b180a0d750.

When accessing different nodes, I obtained two sets of data:

A Node

{"jsonrpc":"2.0","id":353,"result":{"blockHash":"0xc3d57467eb85e9d42c6f2e8d3e99316f29efba999e077a7b82e5a801e33f0e2b","blockNumber":"0x4fc7c8","contractAddress":null,"cumulativeGasUsed":"0x5208","effectiveGasPrice":"0x34721aa8c","from":"0xb756d166b4dd40690e64b3d4dbef4c8bea7bd096","gasUsed":"0x5208","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x998a7851e153d5dea228ab1cc392ebfd6a508e56","transactionHash":"0xc6268be12c9e8e2afaec8d92753646aef2121a019a883b8292b9f2b180a0d750","transactionIndex":"0x0","type":"0x2"}}

B Node

{"jsonrpc":"2.0","id":353,"result":{"blockHash":"0x6b0b39b4367f1ca103a5f9b12dc292b7642bebba081fd20205cfbd61eb75e6a9","blockNumber":"0x4fc7c8","contractAddress":null,"cumulativeGasUsed":"0x5208","effectiveGasPrice":"0x34721aa8c","from":"0xb756d166b4dd40690e64b3d4dbef4c8bea7bd096","gasUsed":"0x5208","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x998a7851e153d5dea228ab1cc392ebfd6a508e56","transactionHash":"0xc6268be12c9e8e2afaec8d92753646aef2121a019a883b8292b9f2b180a0d750","transactionIndex":"0x0","type":"0x2"}}

etherscan: https://sepolia.etherscan.io/tx/0xc6268be12c9e8e2afaec8d92753646aef2121a019a883b8292b9f2b180a0d750

The results obtained contain discrepancies, and I'm unsure why such inconsistencies are occurring.

How can I avoid incorrect results, and are there alternative methods for verification?

@J1a-wei
Copy link
Author

J1a-wei commented Feb 6, 2024

I have conducted tests, and all transactions at height 5228488(Sometimes it may be other blocks that are not fixed in height) have this issue.
code

	ethProvider, err := Get11935Client() // my private node
	if err != nil {
		slog.Error("get eth client err", err)
		return
	}
	var blockNumber int64 = 5228488
	block, err := ethProvider.BlockByNumber(context.TODO(), big.NewInt(blockNumber))
	if err != nil {
		slog.Error("BlockByNumber err", err)
	}
	blockHash := block.Hash().Hex()
	for _, t := range block.Transactions() {
		recipet, err := ethProvider.TransactionReceipt(context.TODO(), t.Hash())
		if err != nil {
			slog.Error("get recipet err", err)
		}
		if recipet.BlockHash.Hex() != blockHash {
			slog.Warn("Block Hash not eqaul", "Block Number", blockNumber, "tx Hash", t.Hash().Hex(), "Block Hash", blockHash, "Recipet block hash", recipet.BlockHash.Hex())
		}
	}

result

2024/02/06 15:45:32 WARN Block Hash not eqaul "Block Number"=5228488 "tx Hash"=0xc6268be12c9e8e2afaec8d92753646aef2121a019a883b8292b9f2b180a0d750 "Block Hash"=0xc3d57467eb85e9d42c6f2e8d3e99316f29efba999e077a7b82e5a801e33f0e2b "Recipet block hash"=0x6b0b39b4367f1ca103a5f9b12dc292b7642bebba081fd20205cfbd61eb75e6a9
2024/02/06 15:45:32 WARN Block Hash not eqaul "Block Number"=5228488 "tx Hash"=0xac62d235cc7d0bbf644355f26a326a6ba93cf78ad55ec90640bcb7de8a8155e7 "Block Hash"=0xc3d57467eb85e9d42c6f2e8d3e99316f29efba999e077a7b82e5a801e33f0e2b "Recipet block hash"=0x6b0b39b4367f1ca103a5f9b12dc292b7642bebba081fd20205cfbd61eb75e6a9
2024/02/06 15:45:32 WARN Block Hash not eqaul "Block Number"=5228488 "tx Hash"=0xd5f84f644aac1b9a6e70bf577db6ecc469cf780dc757c25a06fb2a468b162266 "Block Hash"=0xc3d57467eb85e9d42c6f2e8d3e99316f29efba999e077a7b82e5a801e33f0e2b "Recipet block hash"=0x6b0b39b4367f1ca103a5f9b12dc292b7642bebba081fd20205cfbd61eb75e6a9

@J1a-wei
Copy link
Author

J1a-wei commented Feb 7, 2024

I started resyncing from block 0, and I switched to the Lighthouse client, but the same error persists.
geth v1.13.11
docker image: ethereum/client-go:v1.13.11

    - --datadir=/data
    - --http
    - --http.addr=0.0.0.0
    - --http.api=eth,net,web3,engine,admin
    - --http.vhosts=*
    - --http.corsdomain=*
    - --ws
    - --ws.origins=*
    - --ws.addr=0.0.0.0
    - --ws.api=eth,net,web3
    - --graphql
    - --graphql.corsdomain=*
    - --graphql.vhosts=*
    - --authrpc.addr=0.0.0.0
    - --authrpc.vhosts=*
    - --authrpc.jwtsecret=/data/jwt.hex
    - --authrpc.port=8551
    - --txlookuplimit=0
    - --nat=extip:${PUBLIC_IP}
    - --maxpeers=300
    - --${NETWORK}
    - --syncmode=snap
    - --db.engine=leveldb
    - --metrics
    - --pprof
    - --pprof.addr=0.0.0.0
    - --pprof.port=6060

lighthouse
docker image: sigp/lighthouse:v4.6.0

    - lighthouse
    - bn
    - --network=${NETWORK}
    - --datadir=/data
    - --execution-endpoint=http://geth:8551
    - --execution-jwt=/geth/jwt.hex
    - --http
    - --http-allow-origin=*
    - --http-port=8080
    - --http-address=0.0.0.0
    - --metrics
    - --metrics-allow-origin=*
    - --metrics-port=9090
    - --metrics-address=0.0.0.0
    - --checkpoint-sync-url=${CHECKPOINT_URL}
    - --enr-address=${PUBLIC_IP}
    - --slots-per-restore-point=${SPRP}
    - --historic-state-cache-size=${HSCS}
    - --purge-db
    - --disable-backfill-rate-limiting
    - --builder=http://mev-boost:18550

@rjl493456442
Copy link
Member

rjl493456442 commented Feb 7, 2024

The issue is fixed by #28865, check #28885 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants