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

ethclient: "missing required JSON transaction signature fields" #3269

Closed
stevenroose opened this issue Nov 15, 2016 · 10 comments
Closed

ethclient: "missing required JSON transaction signature fields" #3269

stevenroose opened this issue Nov 15, 2016 · 10 comments

Comments

@stevenroose
Copy link
Contributor

stevenroose commented Nov 15, 2016

System information

OS & Version: Arch Linux
Commit hash : ca73dea

Expected behaviour

ethclient.Client.GetTransactionByHash(hash) returns a Transaction object

Actual behaviour

Throws "missing required JSON transaction signature fields"

Steps to reproduce the behaviour

Fire up a JSON RPC API server that is compatible with the JSON API specification and call the eth_getTransactionByHash method with an existing transaction hash.


It appears that the develop branch is breaking compatibility with the API spec. Or is there a renewed version of the spec that I'm not aware of that develop is following?

@fjl
Copy link
Contributor

fjl commented Nov 15, 2016

Which server are you using?

@fjl
Copy link
Contributor

fjl commented Nov 15, 2016

ethclient needs the v, r, s fields in order to be able to reconstruct complete transactions. These fields are returned by geth 1.5.0 or later as well as parity on the master branch.

@fjl
Copy link
Contributor

fjl commented Nov 15, 2016

Can you dump the RPC response? This could also be an issue on our end.

@stevenroose
Copy link
Contributor Author

stevenroose commented Nov 15, 2016

I'm using the latest Parity (made a report here as well).

However, the API spec I mentioned does not include the r, s and v fields, so either way a server following the spec is no longer supported in v1.5.

Let me try and get the raw JSON.

@stevenroose
Copy link
Contributor Author

stevenroose commented Nov 15, 2016

It seems to be ethclient.BlockByNumber(context, nil) throwing the exception. I can't access the JSON, but I can give this:

> eth.getBlock('latest')
{
  author: "0xf3b9d2c81f2b24b0fa0acaaa865b7d9ced5fc2fb",
  difficulty: 71064143929134,
  extraData: "0x426974436c756220455448204d696e696e6720506f6f6c",
  gasLimit: 2000000,
  gasUsed: 63000,
  hash: "0xecb7972419884252986933ee844c68de5ec75ceb00c6a6c01f3074bd88c89f0b",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0xf3b9d2c81f2b24b0fa0acaaa865b7d9ced5fc2fb",
  mixHash: "0x8d40e4549a66475d2b5bdcb9a8368122c82649547c2c72fb852d1c41421652ea",
  nonce: "0x9236f25b0277336d",
  number: 2632024,
  parentHash: "0x6903fbcca8c2aaa289b3b24978b4edc16a97e3635897605cfeddae2f6fb8770c",
  receiptsRoot: "0xcbd47d5efae69167bca8f00d668bdcb303f5202c4bcff292736f68bb3eb6884d",
  sealFields: ["0x8d40e4549a66475d2b5bdcb9a8368122c82649547c2c72fb852d1c41421652ea", "0x9236f25b0277336d"],
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 883,
  stateRoot: "0x01f401e8131ee051aa8666ffa277e34226cd7a79bfadb0c295a596341d8e8f75",
  timestamp: 1479220305,
  totalDifficulty: 90167044428100108886,
  transactions: ["0x2edbb63c97d33867d2772d5960577f7edf415e9d19c4530fe40850e8a21fae6a", "0xd92be3b3eeb6b5febb73bf466bd01e0afd897e31020f0d271035a3777c042fa5", "0xedb4ba74c9cf0b5811cd979e7cd2ddfe02dc8a3e46b0629da21e8bd06b568eba"],
  transactionsRoot: "0xfc669abb62188a8a51fc3951c41e746cfa01a1439d5e183ef9a1514e3c3ddf70",
  uncles: []
}
> eth.getTransaction("0x2edbb63c97d33867d2772d5960577f7edf415e9d19c4530fe40850e8a21fae6a")
{
  blockHash: "0xecb7972419884252986933ee844c68de5ec75ceb00c6a6c01f3074bd88c89f0b",
  blockNumber: 2632024,
  creates: null,
  from: "0xfbe26da0e985087d28228defbdaa394713b0865f",
  gas: 21000,
  gasPrice: 40000000000,
  hash: "0x2edbb63c97d33867d2772d5960577f7edf415e9d19c4530fe40850e8a21fae6a",
  input: "0x",
  nonce: 22978,
  publicKey: "0x362cad99ac3200bcde703caf83a6e600f6f893c200ca33bea2e883db2ebf53f5b44367806c93bd59fb3829e44576fe4f26006deb1bed97ea88220724fb187fe2",
  raw: "0xf86d8259c28509502f900082520894d5641a90556c582a51a62a3268430246d743600b87386cdf1b572700801ba090733b29008e20d65cc78a5a4b024ff69833efddba4a50fb6d3348d0963d9102a0501dd1226399dbdb23c121f5db8214fb41a7e84784d39d7d6f9dd5736d9084c3",
  to: "0xd5641a90556c582a51a62a3268430246d743600b",
  transactionIndex: 0,
  value: 15882304188000000
}

@stevenroose
Copy link
Contributor Author

stevenroose commented Nov 15, 2016

Btw, Geth v1.5.0 still advertises the same version of the API:
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 shh:1.0 txpool:1.0 web3:1.0

This should definitely change if breaking changes are made..

@fjl
Copy link
Contributor

fjl commented Nov 16, 2016

Looks like they will backport the fix soon.

@stevenroose
Copy link
Contributor Author

@fjl Well, there are still issues regarding Geth and ethclient not following any specification whatsoever. As long as Geth keeps making changes without documenting a new spec, I guess ethclient will never be compatible with Parity..

@tjayrush
Copy link

I summarized seven differences between 'geth' and Parity and the documentation in this issue: #3339. I did tests against about 1,000 randomly selected blocks and found only the noted differences.

@stevenroose
Copy link
Contributor Author

@obscuren Is this issue resolved?

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

No branches or pull requests

4 participants