* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
* rename the method isPersistingState to isPersistingPrivateState because that is what it is used for
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
- Correct Reporting of reverts in nested call
- correct reporting and handling of value transfer in nested calls
- correct handling of precompiles via DELEGATECALL & CALLCODE
- Addition of precompiled contract gas costs
- Re-work handling of storage writes
- Initial handling of gas refunds
- fix bug in DELEGATECALL tests, we don't need gas in the stack
* this has a cascading effect on balances in diff tests
- rework depth detection in flat trace
- two new tests blocks
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* correct refund addresses
* correct returned memory from static precompiled calls.
* update integration test
* precompiles sometimes get plain old CALLs
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
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>
* 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>
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>
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>
* 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>
- 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>
* 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>
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>
Removes as many Gradle 7.0 compatibility issues as possible
* `baseName` -> `archiveBaseName`
* `extension` -> `archiveExtension`
* `destinationDir` -> `destinationDirectory`
* `runtime` -> `runtimeOnly`
* Change some log4j-api and log4j-core dependencies
* Remove an unneeded and outdated plugin (`net.ltgt.apt`)
* tweak the plugin-api change detector's property annotations.
Warnings still exist with one external plugin used for license file
checking that we do not control the source code for.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Implement tracing API trace_replayBlockTransactions “vmTrace” option.
Use the testing tools implemented to generate test cases and reverse engineer the “vmTrace” compatibility.
Write logic to transform TransactionTrace result (used by existing debug_trace API’s) into a Parity-style vmTrace results.
Add any additional fields as necessary to support both debug_ and trace_block API’s.
Acceptance Criteria:
JSON-RPC method trace_replayBlockTransactions with singular option [“vmTrace”] supplied should match parity output when run on the same block data
- create `flat` and `vm` subpackages of `tracing`
- introduce `vmTrace` logic
- refactor `TraceReplayBlockTransactions` to handle `vmTrace` option
- split tests in separate directories
* address https://github.com/hyperledger/besu/pull/4#discussion_r325267437
- check if next frame is deeper than current frame instead of checking specific `CALL` opcode
- check if next frame is less deep than current frame instead of checking specific `RETURN` opcode
- reduce visibility of `generateTrace` to `private`
* address https://github.com/hyperledger/besu/pull/4#discussion_r325711858:
- add test case using `STOP` opcode
- ignore `STOP` only if there is 1 opcode in the trace
* refactor to improve readability of the code.
macro steps of the process are now:
- `generateTracingMemory`
- `generateTracingPush`
- `generateTracingStorage`
- `handleDepthIncreased`
- `handleDepthDecreased`
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
Generally, byte[] -> Bytes of some form. Most of the changes are the
side effect of the type changes or chaning to the names of Tuweni
equivilant calls (getHexString->toHexString, etc).
UnformattedData -> Bytes
Log Topics went from Hash to Bytes32
Difficulty went to UInt256 to match core impl.
Quantity lost BinaryData and is just getValue() and toHexString()
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Remove the LogSeries object and replace it with a plain old List<Log>.
The subclass had two features beyond a simple list. First it would
aggregate the logs as they were added into a bloom filter, but that
bloom filter was never used.
Second it had a RLP encoding convenience method. In the few cases this
is used the RLP encoding is unwrapped.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Make needed changes to have LogsBloomFilter become an immutable object.
Since we are returning this object from other immutable values then we
should mechanically enforce it's immutability by removing mutating
functions. These are moved into a builder ineterface where the bloom
values can be incrementally built and a LogsBloomFilter object is
produced when calculations are complete.
This allows us to make LogsBloomFilter a DelegatingBytes subclass and
eliminates the need to call getBytes in situations where that is needed.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
This was turned off a number of months ago because of long build times.
However it appears either because of code structure changes or fixed
errorprone that this finishes in a reasonable time now.
Code that violated this check is also fixed.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Update dependencies to most current version
- except picocli which is a major version update
Alphabetize dependencies
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Use UnformattedDataImpl as a DelegatingBytes class, so we can have it used throughout and reduce the churn of new objects
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
only when you are trying to process a privacy marker transaction
Wrap errors with Enclave exception
Signed-off-by: Antony Denyer <email@antonydenyer.co.uk>
Co-authored-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
Add support for MuirGlacier
* Add block numbers for Ropsten and Mainnet
* Add reference tests for difficulty calculations
* Update reference tests for new MuirGlacier difficulty tests
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
updated ClassicProtocolSpecs for Agharta Definiton to use
SpuriousDragonGasCalculator (instead of Istanbul gas calculator)
Signed-off-by: edwardmack <ed@edwardmack.com>
Change the configuration name of "CustomForks" to "Transitions." This
will better reflect that this is a list of blocks where transition
events might happen. These may be more than forks, and mainnet is also
moving away from the name forks to "network upgrades." Transitions is
more general purpose.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>