Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Trace module docs invalid #11365

Closed
liamaharon opened this issue Jan 2, 2020 · 7 comments
Closed

Trace module docs invalid #11365

liamaharon opened this issue Jan 2, 2020 · 7 comments

Comments

@liamaharon
Copy link

  • Parity Ethereum version: 2.6.8
  • Operating system: Linux
  • Installation: one-line installer
  • Fully synchronized: yes
  • Network: goerli
  • Restarted: yes

The trace_call docs (https://wiki.parity.io/JSONRPC-trace-module#trace_call) specify that gas should be an integer, however when I call trace_call with this tx

{                                                                                                                                                                                
    blockHash: null,                                                                                                                                                                   
    blockNumber: null,                                                                                                                                                                 
    from: '0x8476Cf96b4330DE10236C22ca61B47ED6592544b',                                                                                                                                
    gas: 111034,                                                                                                                                                                       
    gasPrice: 1000006757,                                                                                                                                                            
    hash: '0x66ff70cb84eb3c9fbbc299667b911acfbad6d4aebd6556883cb77dc8b516d3e5',                                                                                                        
    input: '0x63ea01430000000000000000000000000000000000000000000000000000000000001ab20000000000000000000000008476cf96b4330de10236c22ca61b47ed6592544b000000000000000000000000000000000
0000000000000000de0b6b3a76400000000000000000000000000000759badb0195922ebb7cb6c1fc4b3d1ab9576a30',                                                                                      
    nonce: 2,                                                                                                                                                                          
    r: '0x85954c7ea242903d1952fcaabcdab8042d34afcf9d0b181c2b7561a81d712391',                                                                                                           
    s: '0x203690fffa1b789932e1994340858e01f2a8ae9ea2d9798f067c9a68289ad93d',                                                                                                           
    to: '0xDa1fBc048f503635950058953f5c60FC1F564ee6',                                                                                                                                  
    transactionIndex: null,                                                                                                                                                            
    v: '0x1c',                                                                                                                                                                         
    value: 0                                                                                                                                                                         
  }                                                                                                                                                                                    

like this

  const { trace } = await httpWeb3.eth.parity.traceCall({
    from: tx.from,
    to: tx.to,
    gas: tx.gas,
    gasPrice: tx.gasPrice,
    value: tx.value,
    data: tx.input,
  }, ['trace'])

an error is thrown, indicating that gas should be a hex string

(node:8765) UnhandledPromiseRejectionWarning: Error: Returned error: Invalid params: invalid type: integer `111034`, expected a 0x-prefixed hex string with length between (0; 64].

I'm pretty sure this used to work in previous versions of Parity.

@liamaharon liamaharon changed the title Trace module API out of date Trace module docs invalid Jan 2, 2020
@liamaharon
Copy link
Author

it works when gas, gasPrice, value are hex string with a 0x prefix, when the docs say they should be integers

@niklasad1
Copy link
Collaborator

niklasad1 commented Jan 2, 2020

I agree that the documentation is not great which should be updated but this behavior (TraceOptions) hasn't been changed for the last for the ~2-3 years.

@liamaharon
Copy link
Author

are the docs open source? I'd be happy to update this section

@niklasad1
Copy link
Collaborator

@liamaharon
Copy link
Author

liamaharon commented Jan 3, 2020

thanks for the link @niklasad1

@jam10o-new
Copy link
Contributor

jam10o-new commented Jan 3, 2020

I can only imagine this change in behavior might be caused by #10657 (or something else that changed json deserialization logic?) and if that's the case, it wouldn't be applicable for 2.5.x

@niklasad1
Copy link
Collaborator

@joshua-mir No, it is deserialization changes in ethereum-types then because it is CallRequest deserialization that fails but it is very old too. So, I expect it to be applicable for 2.5.x too

@vorot93 vorot93 closed this as completed May 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants