* Rename BftForksSchedule to ForkSchedule
* Make ForksSchedule generic beyond BftConfigOptions to allow it to work for MiningCoordinator
* Extract BftForksScheduleFactory from ForksSchedule
* Move ForksSchedule to common package
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Broad reaching optimizations to speed up EVM calculations
* Generally speaking, use int and long where it is more appropriate than UInt256 (memory indexes mostly)
* Move the internal stack to Bytes from UInt256
* Re-work the flow of many operations to account for the above
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Move EVM to a standalone module
Move the EVM classes to a standalone module. This is mostly moves but
some API re-resign to peel out some features not essential to the EVM,
such as privacy support and ties to the data storage subsystem.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Rollback TransactionGasCalculator
Rollback the transactionGasCalculator changes. This was done in
preparation for the EVM modularization. Instead, de-structure the data
needed to calculate the gas instead of passing in the whole transaction.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Create new datatypes module
Create a new `datatypes` module to hold datatypes that are broadly used.
This will aid modularization by making sure the base types in the module
minimize the amount of unrelated support classes needed.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Add Address, Hash, and Wei to datatypes
Move the Address, Hash, and Wei to datatypes in as they are needed for
EVM modularization.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
In preparation for the EVM library pull out the transaction related gas
calculations and move them into their own `TransactionGasCalculator.`
This has 4 calls right now, none of which occur inside the EVM:
* Intrinsic gas cost
* Code Deposit gas cost
* Max refund quotient
* Max Privacy Marker Transaction intrinsic gas cost.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
EIP-1702 account versioning was a candidate for the Istanbul hard fork
but was removed prior to the first testnet. Other versioning techniques
have greater core dev mind share and one preparatory step landed in
London, EIP-3541, making EIP-1702 very unlikely to make it to Mainnet.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
QBFT no longer validates all fields of the block header (eg nonce mixhash), as these have no bearing on the
safety model of the protocol.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Aspects of the consensus mechanism associated with block creation, and validation have been moved
from the IBFT package, into into consensus/common, such that they can be reused for the QBFT
implementation.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Adding the Log4j "jul" (java.util.logging) adapter resulted in many
messages like this at startup:
`main INFO Registered Log4j as the java.util.logging.LogManager.`
These come from the Log4j status logger. We can get rid of those by
setting the status attribute on all configurations to a higher logging
level. WARN is the next higher level.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Add OTLP metrics support
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Don't automatically push to grpc. Only allow if pushEnabled is set to true
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Code review
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Missed refactoring
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add missing header
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Don't make otel depend on the push enabled flag
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Expose JUL logs to log4j2
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Code review fixes and make sure not to start push gateway if not set to prometheus
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* spotless
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Fix unit test
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* code review feedback
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add changelog entry
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Report a reasonable value for version (#1471)
* Accept filenames from stdin instead of json content (#1470)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* #1066 Switched to use unprefixed hex strings for memory and stack values
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Disable flaky tests per Ben Burns(Yeti) request
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Revert last commit and enable ignored tests.
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1157 - updated to create 2 agents so that proper bonding can occur
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1162 - Updated test to mock the local peer PING packet creation so that the hash can be managed.
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Added admin_logsRepairCache end point
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Added admin_logsRepairCache end point
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Remove p2p network code per PR comments
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Updates from PR comments
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Spotless Apply fixes
Signed-off-by: David Mechler <david.mechler@consensys.net>
* PR updates
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Admin force cache refresh when called through end point per PR comments
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Pr updates
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Update changelog for 1.5.1
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Remove check for 0x prefix on addresses to match expectations
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Update graphql pending to allow for sorting of transactions
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1408 Add Miner data endpoints
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1408 Add Miner data endpoints
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1408 Add Miner data endpoints
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1408 Added tests for new miner endpoints
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1408 - PR updates
Signed-off-by: David Mechler <david.mechler@consensys.net>
* SpotlessApply updtes
Signed-off-by: David Mechler <david.mechler@consensys.net>
* SpotlessApply updtes
Signed-off-by: David Mechler <david.mechler@consensys.net>
Co-authored-by: David Mechler <davemec@users.noreply.github.com>
This adds EvmTool to the standard distributions.
In addition, add a property flag that disables the secpk256k1
auto-randomization for just the EvmTool to speed up invocation.
(fixes#1464)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Prefer `EvmAccount` in interfaces and methods
* Rename `DefaultEvmAccount` to `WrappedEvmAccount`
* Move `UpdateTrackingAccount` to a top level class from an inner class
* Re-type `getTouchedAcounts()` to not use `UpdateTrackingAccount`
* Extract `WorldStateArchive` interface, rename old class
`DefaultWorldStateArchive`
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Add better invalid reason logging.
The EVMTool state-test will add a field in the json result object.
Block transaction processing will log at INFO why the block is invalid
and include the block hash and (if relevant) transaction hash.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* store warmed addresses and slots i the MessageFrame
* update gas calculations for berlin specific rules
* allow state tests in EVMTool to override the forks.
* retesteth should't broadcast re-orgs
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Create a docker image for EVMTool, so that the GoEvmLab tool can easily
integrate the besu EVM into its fuzzing framework.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Our current EVM loop splits out cost, execution and halt evaluation. Flattening these three into one method results in a significant speedup in reference tests, which are EVM heavy.
Mostly the cost, exceptionalHaltCondition, and execute are merged into one method, sharing calculations between the three.
In fixed cost operations the merger is very simple AddOperation is a representative fixed cost operation.
Check the gas, check other exceptional halts, do the work, return the result.
In variable cost operations there is some value reads to be done before the cost is calculated. This is where a lot of the de-duplication occurs. CodeCopyOperation is a representative variable cost operation.
JumpIOperation shows where this merger pays off. If the condition is zero then some exceptional halts don't need to be considered. But with the three way split each step couldn't consider such optimizations because the local data was lost between each call.
Some cleanup was enabled by this. The old exceptional halt predicates were deleted and moved into each operation. Gas costs must be checked by the operation instead of globally, or we would lose state if we had to split into two methods and do the gas check shared.
The OperandStack was flattened into a single class instead of an interface plus a single implementation. stack underflow and overflow are signaled via named exceptions and handled via catches instead of pre-checking the stack height. Since overflow/underflow is exceedingly rare in mainnet transactions java exceptions are the more performant means.
Some of the APIs had lingering impacts on how some tests were run and the EVMTool (we cache operation cost in the message frame now.)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Internally we used to use an enum set to track halt reasons and we would
track multiple halt reasons. However, what the halt reason is does not
matter to reference tests and tracing, only that a halt occurred.
Repalace the EnumSet with an Optional and trace only one revert reason.
This saves us time in enumset management and also allows us to return
quicker once any halt is detected.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
ProtocolContext uses a generic for the consensus state, which has a very
large footprint across the code to accomplish what it intends to
accomplish. For every call there are about 61 other lines per call that
need to be updated, over 1300 lines total.
Instead replace it with java.lang.Class#cast, which provides runtime
security, and use generics to provide the compile time sugar that
allows for chained methods of the appropriate type. Then remove its
(quite large) footprint from the rest of the code.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Support clique genesis (needs a nodekey)
* Support nested calls
* Write genesis allocations to world state
* Report total gas (EVM operations + intrinsic cost of TX)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>