* Add a pid-path parameter to write a pid file that can be used as a healthcheck
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add healthcheck to the Dockerfile
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* fix assertj use
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Fix unit tests
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Move baseFee from SealableBlockHeader to ProcessableBlockHeader
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Move baseFee from SealableBlockHeader to ProcessableBlockHeader
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Write null gas price in the RLP structure if this an EIP-1559 transaction. (#738)
Write null gas price in the RLP structure if this an EIP-1559 transaction.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
Resolve the NatManager crash when besu is launched on GKE and improved logs when switching to the fallback mode. It is no longer necessary in KUBERNETES to create a volume and to move the kubeconfig file in this volume.
Signed-off-by: Karim TAAM karim.t2am@gmail.com
Make sure we remove pending transaction tracker when a peer disconnects
with a unit tests to test that disconnect callbacks are indeed called when a peer disconnects, for transaction and pending transaction tracking
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* 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>
* For post EIP-1559 blocks we must disable GasLimitRangeAndDeltaValidationRule.
We must also update ProofOfWorkValidationRule to include base fee field in the hash computation.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Rename logger
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Rename logger
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Fix base fee computation and add tests.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Address PR comments
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Fix support of peers <eth/65
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Fix unit test
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Update ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PeerPendingTransactionTracker.java
Co-Authored-By: Danno Ferrin <danno.ferrin@shemnon.com>
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* make protocol version part of the function
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Co-authored-by: Danno Ferrin <danno.ferrin@shemnon.com>
Pull two methods out of ProtocolSpec into the only class that uses them.
This is in preparation for future refactoring of the ProtocolSpec.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
It is possible for the service furture to fail exceptionally before we
first poll for waiting, so we should switch to a do/while loop so we
will get the exception re-thrown instead of ignoring it.
This may fix#662
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Security frameworks create signatures of 64-bytes (for a 256-bit keys) - and do not produce the recId.
Furthermore, the signatures created maybe in the upper-half of the curve, which is illegal under Ethereum.
As these checks must be applied to signatures generated by the jce, it is prudent to separate the concept of signature generation, from the post-operations.
Signed-off-by: Trent Mohay <trent.mohay@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>
This change allows the newly defined "SecurityModule" to work against a generic API, while the NodeKey interface adapts these generic types to the types already used throughout Besu (i.e. those defined in Secp256k1).
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Speed up build time by removing some of the most time consuming tests
* CALLBlake2f_MaxRounds - runs Blake2f 4 billion rounds, something no
one ever does and there is never enough gas to do. We have a unit test
for this already.
* The "do this 50k times" tests. Each has a smaller "5k times" or less
variant. This drifts into performance testing instead of conformance
testing
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* I propose to add Karim as a Besu project maintainer.
Karim contributed with many high quality commits (including bounties):
- NAT,
- log filters,
- fast sync,
- tracing.
Here are [his past contributions on Besu project]
(https://github.com/hyperledger/besu/commits?author=matkt)
and he even did some before the client was renamed to Besu.
Voting ends two weeks from today at
[midnight UTC on 2020-04-17](https://bit.ly/2JzWqd4)
For more information on this process see the
Becoming a Maintainer section in the MAINTAINERS.md file.
Signed-off-by: Nicolas MASSART <nicolas.massart@consensys.net>
* 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>
* Implement gas limit and gas price block header validation rules as per specified in EIP-1559
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* We should enforce the per transaction gas limit, as specified by the EIP, to 8,000,000 gas.
Add a `TransactionInvalidReason`
Update the `validate` method in `MainnetTransactionValidator` to enforce this check.
Update the validation process in `MainnetBlockBodyValidator` to enforce this check for all transactions within a block.
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* fix unit test
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
* Removed blockNumber from TransactionValidator.validate
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
Update BesuController to use the NodeKey, rather than working with KeyPair - which in turn allows the crypto operations to be injected.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
It was identified that during the creation of injectable crypto, that the NodeKey effectively offered duplicated functionality between ECDH and ECIES key agreements. The ECIES was superfluous and has been removed.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
When we deny a connection based on HTTP hostname log to trace the
rejected value.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Co-authored-by: Usman Saleem <usman@usmans.info>
Update the Handhshaking classes to use an injected NodeKey object for ECIES encryption.
This has necessitated an update of NodeKey to support the creation of Key and ECIES agreement creation.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Updates the Clique mining classes to use the NodeKeys framework (Created in PR #618) (rather than KeyPair directly) - allowing Clique to use pluggable crypto.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
The NodeKey class is now used through the Discovery protocol (as well as the IBFT2).
However RLPx continues to access the node's keyPair (and underlying private key).
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Bypass default value from environment variable provider for positional parameter. In case of subcommands such as `help` this could have thrown class cast exception
Signed-off-by: Usman Saleem <usman@usmans.info>
Currently, Besu injects a KeyPair from the initial entry, through the hierarchy of classes and into various leaf classes. The leaf classes then execute statically defined cryptographic functions (eg Secp256k1.sign) using the injected key.
Thus the implementation of the cryptographic function is hardcoded by the leaf node, and cannot be injected - and thus its implementation cannot be altered.
This change combines the node's KeyPair with associated cryptographic functions in a single class, which can then be injected. This in turn enables other cryptographic backends to be utilised by Besu.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>