* eth_getCode try to get from private state first
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* add container test for eth_getCode
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* address assumption that if 1559 is enabled there is a london fork block config
fixes#2192
Signed-off-by: garyschulte <garyschulte@gmail.com>
* omit null chainId from transaction json serialization, and fix merge regression
Signed-off-by: garyschulte <garyschulte@gmail.com>
* update json-rpc responses for 1559, use current feeCap and gasPremium field names
Signed-off-by: garyschulte <garyschulte@gmail.com>
* add pr number to changelog
Signed-off-by: garyschulte <garyschulte@gmail.com>
* fix transaction decoder
Signed-off-by: Gary Schulte <garyschulte@gmail.com>
* rebase and fix merge conflicts
Signed-off-by: garyschulte <garyschulte@gmail.com>
* remove null chainId from json-rpc test fixtures
Signed-off-by: garyschulte <garyschulte@gmail.com>
* the great 1559 rename
Signed-off-by: garyschulte <garyschulte@gmail.com>
* re-remove gasTarget
Signed-off-by: garyschulte <garyschulte@gmail.com>
* add serialization tests for 1559 transaction fields
Signed-off-by: garyschulte <garyschulte@gmail.com>
* add json property ordering annotations to Transaction*Result and spotless
Signed-off-by: garyschulte <garyschulte@gmail.com>
* rebase on master, update error message feedback from Karim
Signed-off-by: garyschulte <garyschulte@gmail.com>
* Decouple PoW from ethash
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Address code review comments, create a dev network for ecip1049, prepare for keccak hasher
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add PoW function and a few simple tests as test vectors
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Make the PoWHasher hash function a bit easier to understand
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* simplify and call out the code of the keccak hash function
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* support fixed difficulty for keccak mining
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Fix the dev network config
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add comment to KeccakHasher
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Increase fixed difficulty for the ecip1049 dev network to produce hashes a bit less often
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* spotless
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* fix test expectations
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Fix javadoc issue
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* add acceptance test using keccak mining
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* add changelog entry
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Address code review comments
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Enable Besu to import blocks containing quorum style private transactions
* Add RPC to accept quorum style raw private transactions
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
Co-authored-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
* Finish internal ConstantinopleFix->Petersburg transition, including
class names. Only backwards compatibility and retesteth use of the
name will remain.
* Remove four unused config fields from json configs. These are fields
with no code uses of any sort. All are implied by other fields.
eip150Hash, eip155Block, eip160Block, and daoForkSupport.
* Remove redundant fork block fields where their value is implied
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
This PR adds a waiting list for NewPooledTransactionHashesMessage in order to group several hashes into a single GetPooledTransactionsFromPeerTask
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
* expose epochCalculator to MiningCoordinator
Signed-off-by: Edward Mack <ed@edwardmack.com>
* replace epochCalculator Function with interface
Signed-off-by: Edward Mack <ed@edwardmack.com>
* apply spotless, clean-up tests
Signed-off-by: Edward Mack <ed@edwardmack.com>
* cleanup comments, fix more tests
Signed-off-by: Edward Mack <ed@edwardmack.com>
* fixing failures from testing
Signed-off-by: Edward Mack <ed@edwardmack.com>
* modify dagSeed calculator to use epochCalculator
epochStartBlock to determine epoch start block based on current epoch
length.
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add epochCalculator to StratumConnectionTest
Signed-off-by: Edward Mack <ed@edwardmack.com>
* apply spotless
Signed-off-by: Edward Mack <ed@edwardmack.com>
* remove unnecessary comments
Signed-off-by: Edward Mack <ed@edwardmack.com>
* remove activation block from Ecip1099EpochCalculator
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add messages to IllegalArgumentExceptions, init epochCalculator
Signed-off-by: Edward Mack <ed@edwardmack.com>
* un-wrap private dagSeed method
Signed-off-by: Edward Mack <ed@edwardmack.com>
* fix typo
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add unit tests for epochStartBlock functions
Signed-off-by: Edward Mack <ed@edwardmack.com>
* remove unused field
Signed-off-by: Edward Mack <ed@edwardmack.com>
* Add genesis config parameter ecip1099Block
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add stub for epoch activation config
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add stubs for EtcBesuControllerBuilder
that will handle ECIP 1099 Colibrate Epoch Duration functionality
Signed-off-by: Edward Mack <ed@edwardmack.com>
* introduce EtcHashMinerExecutor
Signed-off-by: Edward Mack <ed@edwardmack.com>
* implement EtcHashMinerExecutor
Signed-off-by: Edward Mack <ed@edwardmack.com>
* remove ecip1099 genesis config option
Signed-off-by: Edward Mack <ed@edwardmack.com>
* apply spotless to code
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add test for Etc Hash epoch calculation
Signed-off-by: Edward Mack <ed@edwardmack.com>
* cleanup comments, apply spotless
Signed-off-by: Edward Mack <ed@edwardmack.com>
* make needed variables final
Signed-off-by: Edward Mack <ed@edwardmack.com>
* update changelog
Signed-off-by: Edward Mack <ed@edwardmack.com>
* refactor code to add epochCalculator to EthHash
As suggested in comment removed EtcHash series of classes to keep
existing controller.
Signed-off-by: Edward Mack <ed@edwardmack.com>
* use gas limit calculator
Signed-off-by: Edward Mack <ed@edwardmack.com>
* fix imports
Signed-off-by: Edward Mack <ed@edwardmack.com>
* run spotless apply
Signed-off-by: Edward Mack <ed@edwardmack.com>
* fix imports
Signed-off-by: Edward Mack <ed@edwardmack.com>
* fix comments
Signed-off-by: Edward Mack <ed@edwardmack.com>
* add ecip1099Block option to asMap method
Signed-off-by: Edward Mack <ed@edwardmack.com>
GasLimitCalculator is now just an interface. This simplifies the logic
in what was previously GasLimitCalculator but is now
TargetingGasLimitCalculator.
Signed-off-by: Ratan Rai Sur <ratan.r.sur@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>
* 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>
Besu's Retesteth implementation failed transition tests. Two reasons:
* It wasn't adding the DaoForkBlock to genesis files correctly
* It wasn't using the protocol schedules og the block being imported,
but instead to the current chain head.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Previously we were returning success with a zero length hash, meaning we
understood the response but there were problems with the RLP. Instead
now we return one of two errors "Could not decode RLP for Block" or
"Could not import Block".
For #1130
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>
* When in retesteth return the coinbase in the eth_getBlockByHash, as
required by the retesteth tool.
* use genesis extraData when mining
* storage keys should be 0x00 instead of 0x when zero.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Compute transaction gas budget allocation according to EIP-1559 rules.
- Added `TransactionGasBudgetCalculator` with `hasBudget` method.
- Updated `AbstractBlockProcessor` to compute the gas budget using `TransactionGasBudgetCalculator`.
- Added unit tests in `TransactionGasBudgetCalculatorTest`.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Fixed unit test.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Handle legacy gas pool and EIP-1559 gas pool when mining blocks.
- Added `EIP1559` manager class in `ProtocolSpec` (defaulted to `Optional.empty()`).
- Updated `MainnetProtocolSpecs` EIP-1559 definition to set the `EIP1559` manager class.
- Updated `BlockTransactionSelector`
- Added `eip1559CumulativeGasUsed` field in `TransactionSelectionResults`.
- Updated `updateTransactionResultTracking` method to compute cumulative gas used according to `EIP-1559` rules.
- Updated `transactionTooLargeForBlock` method to compute gas remaining according to `EIP-1559` rules.
- Updated `blockOccupancyAboveThreshold` method to compute minimum block occupancy ratio according to `EIP-1559` rules.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Update BlockTransactionSelector transaction gas price computation.
BlockTransactionSelector should compare transaction gas price to the min transaction gas price parameter according to EIP-1559 rules.
- Added `TransactionPriceCalculator` to `ProtocolSpec` (defaulted to `TransactionPriceCalculator.frontier()`.
- Created `minTransactionPriceInNextBlock` method in `BaseFee`.
- Removed useless constructor in `BaseFee`.
- Updated EIP-1559 protocol spec definition to set the correct transaction price calculator.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Manage EIP-1559 transactions forging in local transaction pool.
- Updated `TransactionPool`
- Added `TransactionPriceCalculator` field for frontier transactions.
- Added `TransactionPriceCalculator` field for EIP-1559 transactions.
- Added `EIP1559` field.
- Added `minTransactionGasPrice` to compute transaction gas price according to EIP-1559 rules.
- Created `BaseFee` domain object.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
Add support for `berlinBlock` in genesis configs.
Until the final contents of Berlin are finalized this will be guarded by
a feature flag `--Xberlin-enabled`. Once Berlin is finalized and before
it is deployed on test nets the flag will be removed.
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>
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>
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>
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>