* Added changelog entries for PR:
- https://github.com/hyperledger/besu/pull/430
- https://github.com/hyperledger/besu/pull/440
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* ### Description
BlockHeader object needs to be modified in order to add the new field (baseFee) as specified in the EIP.
We should take care about the RLP encoding/decoding of this structure since it has to include or not the new fields depending on whether we are pre fork or post fork.
- Update `core.BlockHeader.java`
- Add `baseFee`
- Update `readFrom` method for RLP decoding
- Update `writeTo` method for RLP encoding
- Update `plugin.data.BlockHeader.java`
- Add `getBaseFee` method
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* TODO Add CLI command line flag `--Xeip1559-enabled`.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* TODO Add CLI command line flag `--Xeip1559-enabled`.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Added unstable annotation for getBaseFee. Moved from long to `Optional<Long>`
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Spotless apply
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Fixed error
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* fix plugin API hash
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* RLP encoding / decoding operations are guarded with the feature flag.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* spotless apply
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Fix the error retrurned when the PMT cannot be added to the transaction pool because the intrinsic gas exeeds the gas limit.
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
Occasionally the other side of an HTTP connection will drop the
connection before we are done processing. This results in a harmless
but annoying exception showing up in the log. If we check before we
write we won't get that exception.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
If we detect an EOF for the cache file switch over to an uncached query.
This is typically seen when filling a log filter and the new block has
not yet written out the log bloom cache to disk. Fixed#473
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
The EthQL API spec specifies pulledStates and knownStates in the
`syncing` query. Previously we always returned null. This plumbs through
the needed data so that the synchronization states can report the
fast sync progress via EthQL, as well as the `eth_syncing` JSON-RPC.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Restore test generation of blocks.bin
Restore the ability to generate our blocks.bin as part of the build.
(a) a fixed start time was added
(b) nonces for blocks imported for test are deterministically chosen.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* more readable test files
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* init trace_transaction api
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* add test cases for trace_transaction api
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* resolve the tests by checking only the presence of the blockHash field and not its value because it is different each time generateTestBlockchain is called
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* clean code
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* to allow the tests to work, we must put back the blocks.bin and no longer generate it during the build. adding the nonce to the blocks.json file should solve this problem
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* clean code
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* refactor add additional transaction part
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* create file if logBloom-current.cache is missing
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* update populateLatestSegment in order to resolve the missing logs issue
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* add lock for populateLatestSegment
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
LogsQuery may get passed in addresses in lists and topics in lists that do
not tolerate being checked for null members. This is an unexpected and
subtle situation hence the long comment.
This new test covers this case as it passes in null-intolerant lists.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Do a cursory cache check at start up (file is present and correct size)
instead of re-generating the cache at startup.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Make sure we cache the current cache segment with all of the data from
the beginning of the segment. Use a flip file approach since it will be
a partial file until done.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Co-authored-by: Abdelhamid Bakhta <45264458+abdelhamidbakhta@users.noreply.github.com>
* pop flat trace context when handling halts
* Better detection of precompiled and non-executed contracts
* correct from address when calling in init code
* fix some exotic nesting cases
* correct from field for init code calls at depth >1
* correct cost on a non-call
* changelog and notes
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
- 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>
* 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>
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>
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>
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>