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

eth_getTransactionByHash return 0x0 sender value for pending EIP-1559 tx #23762

Closed
nining opened this issue Oct 18, 2021 · 5 comments · Fixed by #23765
Closed

eth_getTransactionByHash return 0x0 sender value for pending EIP-1559 tx #23762

nining opened this issue Oct 18, 2021 · 5 comments · Fixed by #23765
Labels

Comments

@nining
Copy link

nining commented Oct 18, 2021

System information

Geth version: v1.10.10
OS & Version: Linux

Expected behaviour

return correct tx sender address

Actual behaviour

return 0x0

Steps to reproduce the behaviour

for any pending EIP-1559 tx


example result:
{
  "nonce": "0x1",
  "hash": "0x18aadbf8d2107a47315da9178590ef29d8f35fb67386c26eaddd051d5c6d4e80",
  "gas": "0x5208",
  "blockNumber": null,
  "gasPrice": "0xc92a69c00",
  "from": "0x0000000000000000000000000000000000000000",
  "blockHash": null,
  "transactionIndex": null,
  "value": "0xe54aeefe8c000",
  "to": "0xa4e5961b58dbe487639929643dcb1dc3848daf5e",
  "s": "0xe35fa2f48b524198048ab4eeb21c7a0c4d1c7858fac0a365e9a8c17ccc1ceab",
  "r": "0xc24b399f68566789de62a1b4a3f2b6dee0ee1337f53ad94387a184533e00a9d3",
  "v": "0x26",
  "input": "0x",
  "type": "0x0"
}
@nining
Copy link
Author

nining commented Oct 18, 2021

This bug might caused by this merge:
#23683 internal/ethapi: use correct signer when serving old blocks

@MariusVanDerWijden
Copy link
Member

The v value looks off to me, is this transaction on mainnet?

@MariusVanDerWijden
Copy link
Member

func TestMakeSigner(t *testing.T) {
	gp, _ := new(big.Int).SetString("0xc92a69c00", 0)
	val, _ := new(big.Int).SetString("0xe54aeefe8c000", 0)
	v, _ := new(big.Int).SetString("0x26", 0)
	r, _ := new(big.Int).SetString("0xc24b399f68566789de62a1b4a3f2b6dee0ee1337f53ad94387a184533e00a9d3", 0)
	s, _ := new(big.Int).SetString("0xe35fa2f48b524198048ab4eeb21c7a0c4d1c7858fac0a365e9a8c17ccc1ceab", 0)
	to := common.HexToAddress("0xa4e5961b58dbe487639929643dcb1dc3848daf5e")
	tx := LegacyTx{
		Nonce:    1,
		GasPrice: gp,
		To:       &to,
		Gas:      0x5208,
		Value:    val,
		V:        v,
		R:        r,
		S:        s,
	}
	typeTx := NewTx(&tx)
	fmt.Printf("hash: %v", typeTx.Hash())
	signer := HomesteadSigner{}
	sender, err := signer.Sender(typeTx)
	if err != nil {
		panic(err)
	}
}

Results in

hash: 0x18aadbf8d2107a47315da9178590ef29d8f35fb67386c26eaddd051d5c6d4e80--- FAIL: TestMakeSigner (0.00s)
panic: invalid transaction v, r, s values [recovered]
	panic: invalid transaction v, r, s values

So the type in the log says it is a LegacyTx not a DynamicFeeTx. If I put it as a LegacyTx I receive the correct hash. Are you sure that the signature is valid?

@nining
Copy link
Author

nining commented Oct 18, 2021

The v value looks off to me, is this transaction on mainnet?

it was dropped: https://etherscan.io/tx/0x18aadbf8d2107a47315da9178590ef29d8f35fb67386c26eaddd051d5c6d4e80

You can choose pending tx from https://etherscan.io/txsPending. If it was still pending when calling eth_getTransactionByHash, then the result "from" field would be "0x0000000000000000000000000000000000000000"

@nining nining changed the title eth_gettransactionbyhash return 0x0 sender value for pending EIP-1559 tx eth_getTransactionByHash return 0x0 sender value for pending EIP-1559 tx Oct 18, 2021
@MariusVanDerWijden
Copy link
Member

I found and fixed the issue here: #23765

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

Successfully merging a pull request may close this issue.

3 participants
@nining @MariusVanDerWijden and others