Closed bokkypoobah closed 8 years ago
The different between Geth (which includes etherscan.io) and Parity is that Parity does not include the intrinsic transaction cost, i.e. the cost of including the transaction data in the block itself. This is because these trace entries are meant to give you information about the code execution environment which is common across all forms of contract-creation and message-call, regardless of whether they originated as a transaction or from a CALL
or CREATE
operation.
So to be clear, there are really three important values here:
total_provided
= 467645);intrinsic_used
= 128988);interior_used
= 238657).From these three values, you can arrive at:
total_used
= 367645);refund
= 100000);interior_provided
= 338657).Note:
total_used
= intrinsic_used
+ interior_used
;refund
= total_provided
- total_used
;interior_provided
= total_provided
- intrinsic_used
.Parity provides you with three of these values (I assume transaction
is equal to eth.getTransaction("0x403b4bf619ab760a5d88a73a87fb12606f150328075d9795ef34f5157525b887")
and trace
is the result of your curl
query):
transaction.gas
returns total_provided
;trace[0].action.create.gas
returns interior_provided
;trace[0].result.create.gasUsed
returns interior_used
.With these three values, you can derive the rest of the amounts, particularly those that Geth furnishes you with:
interior_used
= total_provided
- intrinsic_provided
;total_used
= intrinsic_used
+ interior_used
;refund
= total_provided
- total_used
.As an aside, since Geth provides you only with total_used
and total_provided
, you can only derive refund
; you can not figure out the additional information intrinsic_used
, interior_used
or interior_provided
. As such Parity is strictly more informative.
Thanks for the explanation @gavofyork
I'm running Parity/v1.3.8-beta/x86_64-linux-gnu/rustc1.12.0 on Linux synced to the main ETH chain.
Using the following command:
I get the following results:
So
gas
is 0x052ae1 (338657) andgasUsed
is 0x03a441 (238657) according to Parity.The
gas
andgasUsed
results are different togeth
's results:And they are different to etherscan.io's results:0x403b4bf619ab760a5d88a73a87fb12606f150328075d9795ef34f5157525b887: