Move header validations that extract the signer key out of the "light"
validation mode. Reduces fast sync time on goerli 75%
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Remove metrics from plugin registration. Doing it this way here always results in a
NoOpsMetrics being inited because CLI options have not been parsed.
Add an acceptance test for metrics. This is what should have been in place and
would have detected metrics not working earlier.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* 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 e2bb261a185d20f75e33be0ec72f5b5851c40461.
* Revert "fix failing test"
This reverts commit e5dc3fa073ef968bc017e513d15657204f54e519.
* Revert "fix Jenkins failure"
This reverts commit 15f90ea5e214ac624b891225bd096466c2ce1111.
* Revert "[PAN-2995] Make account.getAddress() return an Optional<Address>"
This reverts commit 08cc7ca5b785c666acd8d2b34d5f672837cd78fe.
* init trace_replayBlockTransactions
* Revert "init trace_replayBlockTransactions"
This reverts commit 545426595c8ede0b30ab1025bbdd262ce51281b7.
* Revert "Revert "init trace_replayBlockTransactions""
This reverts commit 756f52bb019c0e0c61aac4a97269d40198341c86.
* 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 88ee6aa84c199e1f386e1ba314c507d17c89226d.
* 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
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add a generalized genesis config override facility for command line use. Only useful for string or integer config values, not object values.
Sample use - enable Istanbul fork on block 99 million
--override-genesis-config=istanbulFork=99000000
Overriding a value with an empty string unsets the value
Sample use - disable Istanbul fork by un-setting istanbulFork:
--override-genesis-config=istanbulFork=
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Ensure `plugin-api` module gets published at the correct maven path
* Move `plugins` to `plugin-api`
Signed-off-by: Edward Evans <edward.evans@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Return plugin-api to the main repo
* Spotless
* Migrate all external plugin-api references to the project in this repo
* Add licence header
* Update repo reference for publish, even if commented
* Use real configuration for publishing plugin-api
This was tested with the
`:plugins:publishMavenJavaPublicationToMavenLocal` task and checking the
local Maven repo to make sure it was using the correct paths
Signed-off-by: Edward Evans <edward.evans@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* update web3j 4.5.0 + use pantheon module in favour of core
* remove custom eea/privacy rpc calls -> use web3j instead
* overhaul the conditions -> web3j does the polling for receipts for us
* re-define a PrivacyNode - it is an object that holds a PantheonNode and an OrionTestHarness
* do not start OrionTestHarness prematurely - calling PrivacyNode.start() will start an Orion node followed by it's accompanying Pantheon node
* stop and close resources properly -> clean-up removes the created temporary directories correctly
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Interally we use a `BigInteger` for ChainID, but currently use an `int` for
NetworkID. Because the default for NetworkID is the same value as ChainID there
are some chains where this will be very problematic, and there is at least
one other long-living chain outside the 32 bit int value range.
This is a large commit because the type is baked fairly deep into some of
the other APIs and very much in the test code testing the type.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This reverts commit b0238318f171078aa7097d3339988419d56592b5. Causes intermittency because of hard coded port 8545.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Change the blake validation errors from soft errors (empty data) to hard errors
(precompile failed).
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Add chain data resources
* Update tests for tracing to run on custom data, add test cases
* Regenerate test cases, update tests to be agnostic on key ordering
* Remove dead code
* Move to-be-implemented test cases to root trace directory
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>