This PR introduces functionality to conform with ECIP-1061
https://ecips.ethereumclassic.org/ECIPs/ecip-1061
Signed-off-by: edwardmack <ed@edwardmack.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Co-authored-by: Danno Ferrin <danno.ferrin@shemnon.com>
* Handle CREATE and CREATE2 in flat trace
* precompile calls don't generate traces
* Handle REVERT in output and result nodes.
* output doesn't need to be held behind a supplier
* Handle padded output values when end is past memory
* Store memory in vm trace for MLOADs
* CREATE and CREATE2 store memory in vm-trace
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Allows for the setting of the timestamp in JSON block importer.
Ordinarily it is now and then 1 second for each block. The initial time
can now be set via CLI option `--start-time`, which defaults to now.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Fix strategy for getting next nonce for sender in `PendingTransactions`.
Added test.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Introduced `TransactionsForSenderInfo` structure to have a less naive implementation, more robust against load testing.
A queue of gaps between used nonces is maintained.
`getNextNonceForSender` has been updated and have the following logic:
- if no infos corresponding to the nonce returns an empty optional
- if gap list is not empty returns the lowest nonce in the gap
- else returns the max nonce + 1
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* spotless
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* spotless
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* added test
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* spotless
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Handle CREATE and CREATE2 in flat trace
Handle create and create2 operations. Some other tests also got adjusted
as the source accounts were running out of test ether. Bumping up the
value in the genesis caused the statediff values to also go up.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
- Updated PicoCLI from version 3.9.6 to 4.1.4 and fixed test cases that were impacted by breaking changes of PicoCLI.
- Updated the command factory to fallback to the default factory, as directed in the PicoCli v.4.0.0 release notes.
Signed-off-by: Paul Harris <paul.harris@consensys.net>
The iterative look back mechanism flat trace was using was missing
many of the nesting subtlties, so a stack based calculation is used.
A new test case with two levels of calls is also introduced.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Mark Plugins Data and Events as stable
Remove the @Unstable annotations form the data and BesuEvents services.
This means that no breaking changes (like removing methods or
changing signatures) will occur without proper notice and versioning
bumps.
* tweak build check
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Co-authored-by: Tim Beiko <t.beiko23@gmail.com>
* Contributor Content: complete refactor
- Deleted contributor files now hosted in wiki,
(CLI-STYLE-GUIDE.md, CODE-OF-CONDUCT.md, CODING-CONVENTIONS.md,
ROADMAP.md, SECURITY.md).
- Deleted old docs files in /docs folder (except readme for redirect).
- Refactored the root README.md with relevant content.
- Refactored the CONTRIBUTING.md file to simplify it with links to wiki.
* added contact developer advocate link
* small updates on README and CONTRIBUTING MDs.
* README updated.
* unified links for docs, jira, etc
* updated suggestions from PR comments
* updated links from comments
* updated links that still pointed to internal /docs
* LF wording and links
Signed-off-by: Felipe Faraggi <felipefaraggi@gmail.com>
Co-authored-by: Nicolas MASSART <NicolasMassart@users.noreply.github.com>
Switch the EVM Memory to a copy on write structure, so when the trace
reads the memory they don't have to copy mutable bytes but can instead
simply use the value as immutable.
Also, fix a state diff bug when an account is deleted that was also just
created in the TX don't report it as an all equal diff, as well as new accounts storage diffs.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* In order to obtain free open source YourKit license we are asked to put the link to YourKit website.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
Following cli options are added to enable TLS client authentication and trusting client certificates.
--rpc-http-tls-client-auth-enabled - Enable TLS client authentication for the JSON-RPC HTTP service (default: false)
--rpc-http-tls-known-clients-file - Path to file containing client's certificate common name and fingerprint for client authentication.
--rpc-http-tls-ca-clients-enabled - Enable to accept clients certificate signed by a valid CA for client authentication (default: false)
If client-auth is enabled, then user must either enable CA signed clients OR provide a known-clients file. An error is reported if both CA signed clients is disabled and known-clients file is not specified.
Signed-off-by: Usman Saleem <usman@usmans.info>
When we calculate the cost of a SSTORE in trace we need to consider the
original value as of when the last transaction finished, not when the
whole block started.
To create a test for this the test blockchain also needed to be upgraded
to Istanbul. This resulted in a large number of cost only changes.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
-- SelfSignedP12Certificate in testSupport for JSON-RPC HTTP TLS testing
-- Generate self signed certificates in PKCS12 format with SAN extensions for testing
-- Remove pre-generated key stores and trust stores used by TLS tests
Signed-off-by: Usman Saleem <usman@usmans.info>
Now that BlockTracer has mutable state we cannot re-use it across
requests, instead we need to create a new one for each call.
To support this spec tests were upgraded to allow batched requests and
responses, which are processed sequentially.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Make priv_call use the PrivacyController
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
* minor changes after review
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
* Add tests to FilterParameter to demonstrate loading topics from JSON
Demonstrate that filter topics in JSON format consistent with eth_newFilter RPC requests
will be correctly loaded into the FilterParameter topics.
Previous tests were loading from an internal structure, which makes it difficult to see
coverage of scenarios.
- [] - matches anything
- [A] matches A in the first position, and anything after
- [A, B] - A in first position, and B in second position, then anything after
- [null, B] - matches anything in first position, and B in second position, and anything after.
- [[A,B],[A,B]] - Matches A OR B in first position, and A OR B in second position, and anything after.
Fixes Jira: [BESU-182]
Signed-off-by: Paul Harris <paul.harris@consensys.net>
Squash and merge
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
- Flat trace
* Support all call types
* Correct input for new tests
* Correctly report out of gas
* Report null result when no result but no error
- Remove need to keep messageFrame directly in traceframe
- Clean up StateDiffGenerator style
- Tighten type of updated accounts
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Handling of contracts that produce logs.
Added smart contracts to produce log records.
Fixes https://pegasys1.atlassian.net/browse/PIE-2224
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Fix zip build
Currently building from a non-git checkout, such as a zip file, does not
work because of the way we calculate the git commit hash. Add a catch
clause to return 8 "x"s in case the calculation fails.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* let the user know retrievial failed
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* left in debugging code tripping the error
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* State diff
All but balances work at this point. And it has something to do with
upfront gas costs.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* fix the balances bug
There was also a chained transactions bug. To address this I create a
new WorldUpdater for each iteration of a transaction through the block.
The current world updater has the new state, the prior the old one.
Diffs just fall out after that.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* get rid of midBlock state, it's unneeded with the chained updaters.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* remove rootWorld method, old code from a prior attempt.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* remove println
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* spotless
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* spotless, comments, and cleanup
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* spotless keeps missing this.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* javadoc
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* fix broken reference tests
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* spotless
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* tighten access
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Generate the blocks.bin file from the json source. The approach used is
to just run the besu import commands as a part of the build script.
This removes a magical binary file from the test files that is now
generated from human readable json.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Create plugin APIs for the block body (just transactions and ommers) and
add the block body to the block propagation listener context.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Handling of sequential memory modifications.
* Handling of integer overflow.
* Handling of `MSTORE` opcode.
Added special case if exceptional halt reasons set is not empty.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Handle multiple transactions in the same block.
* Fix a bug in `BlockTracer`. The bug was causing multiple `TransactionTrace` to share the same list of `TraceFrame`.
A new method has been added in `DebugOperationTracer` to reset the list of frames for successive transactions in a block.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
Don't try and cast total difficulty down to a long because it will
overflow long in a reasonable timeframe (mainnet already has).
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>