This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement trace replay block transactions trace option (#1886)
* Factorise metrics code for KeyValueStorage database - introduce `MonitorableKeyValueStorage` - factorise code - remove metrics instanciation in `RocksDbKeyValueStorage` and `ColumnarRocksDbKeyValueStorage` * Rename class * [PAN-2995] Make account.getAddress() return an Optional<Address> * fix Jenkins failure * fix failing test * fix failing test * Revert "fix failing test" This reverts commit e2bb261. * Revert "fix failing test" This reverts commit e5dc3fa. * Revert "fix Jenkins failure" This reverts commit 15f90ea. * Revert "[PAN-2995] Make account.getAddress() return an Optional<Address>" This reverts commit 08cc7ca. * init trace_replayBlockTransactions * Revert "init trace_replayBlockTransactions" This reverts commit 5454265. * Revert "Revert "init trace_replayBlockTransactions"" This reverts commit 756f52b. * Update TraceReplayBlockTransactions.java * Check request parameters Method returns an error if any option other than “trace” is supplied. * Update TraceReplayBlockTransactions.java * implement trace_replayBlockTransactions - start business logic implementation - iterate through `TraceFrame` and transform to parity style - detect `CALL` opcode to retrieve contract address required in parity format * remove comments * add final modifier for method parameters * fix unit tests * remove useless log * transform address from stack (Bytes32) to an Address * trace_replayBlockTransactions new features - compute gas used for each sub trace - detect `RETURN` opcode - to get `ouput` value from `memory` - detect end of subtrace * fix unit tests * Update FlatTrace.java add final modifier * pretty format JSON file * handle smart contract deployments * handle smart contract deployment - set `code` field when contract creation transaction - set `address` field when contract creation transaction * introduce FlatTraceGenerator * refactoring * spotless apply * update tests to compare Json node tree independently of the order - added generated test cases - use jackson `ObjectMapper` to compare the actual result to the expected one - `assertThat(mapper.readTree(actualResult)).isEqualTo(mapper.readTree(expectedResult));` * fix unit tests - return empty result if block is empty - handle case where there is no `RETURN`, `STOP` is then considered as a return to close the trace and perform gas computation. - increment gas remaining by gas used * spotless apply * introduce SELFDESTRUCT * set result to null when suicide type * remove result field, use builder only * re-enable tracing tests * implement gas used computation - implement a strategy with 2 options - if first frame gas remaining is higher than gas remaining after transaction was processed then the gas used will be the net difference - otherwise a frame by frame cumulative gas cost will be used * get self destruct refund balance from message frame * give access to `ProtocolSchedule` to get `GasCalculator` * fix gas used computation for subtrace (1 level deep) * fix input, use all memory and not only first element * fix trace addresses * debug log * remove some tests files * Revert "remove some tests files" This reverts commit 88ee6aa. * debug jenkins * out instead of err * spotless apply * add debug info * remove static modifier for blockchainSetupUtil field * remove unused field * add javadoc for gasCalculator parameter * fix PR review comments * add javadoc for Trace interface
- Loading branch information
1 parent
4ba5c6e
commit 8dffdcd
Showing
37 changed files
with
1,622 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.