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>
* 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>
The code required to deserialise signed payloads for QBFT is verbose and can be reduced by templating.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Move the messageFactory out of IbftFinalState such that the IbftFinalState can be reused between IBFT and QBFT.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
This adds the proposal and roundchange messages required for QBFT.
This does not wire in the ability to transmit/receive these messages, it just defines the message structure.
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>
Moves IBFT events to the common package for reuse with the QBFT implementation.
This necessitated the creation of BftEventHandler interface, such that a generic IbftController can be passed around, rather than the literal IbftController.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
Moving the IbftMessage (and rename to BftMessage) to the common package such that it can be reused as part of the QBFT implementation.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
This is the first step in making aspects of the IBFT2 code base common, such that it can be reused as part of the QBFT implementation which is coming shortly.
Signed-off-by: Trent Mohay trent.mohay@consensys.net
Upgrade to ErrorProne 2.4.0
* public constructors on abstract classes are removed
* Javadoc must have meaningfull documentation
* lambdas should not be variables
* Added to the list of confusing inner class names (Entry and Type)
* no assert keyword in tests
* Obsolete JDK classes produce errors now
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
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>
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>
This change allows a user to specify a list of address which are
to become validators in an IBFT2 network at a specific block number.
This has required extending the VoteTallyCache, and also added a new
"CustomForks" section to the genesis file.
At the moment only validators are able to be changed, however the
framework now exists for future modifications to be defined that
affect the behaviour of the system "outside" of traditional Ethereum
milestones.
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
* PIE-2016: Added PoaQueryService method that returns local node signer address.
Signed-off-by: Mark Terry <mark.terry@consensys.net>
* [PIE-2016] PR fixes.
Signed-off-by: Mark Terry <mark.terry@consensys.net>
The IbftQueryService has been added to the Plugin-api, along with an implementation.
This allows IBFT specific aspects of a block header to be queried (round number, and signers in block).
Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
We had two mostly idenitcal classes used for GraphQL and JsonRPC/WS.
This PR merges that to one class.
* Move from org.hyperledger.besu.ethereum.api.json.internal.queries to
org.hyperledger.besu.ethereum.api.query
* Add one method from the GraphQL version
(generateLogWithMetadataForTransaction)
* Remove graphql version and point graphql to the shared version.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
[PIE-1858] Added functionality to register custom metrics categories and exposed some PoA data for metrics.
Signed-off-by: Mark Terry <mark.terry@consensys.net>
* adding in spdx-license-identifier & updated check for the same; removing license check from spotless
Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>
* Change CheckSpdxHeader to a task.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
It was identified during a demonstration that Pantheon, when running
in IBFT would show a "Bad Block Import" when a validator was added or
removed from the validator pool.
It was determined this was due to IBFT maintaining a single, 'global'
copy of the curent list of validators, which was updated when a block
was imported - thus when a block which had been imported vi IBFT
was then received via Eth block propogation, the validator list would
not align with the global list (as it had been updated in the IBFT
import).
The solution has been to utilise the VoteTallyCache as used in the
Clique implementation.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Two changes:
* Stream chains now take up less vertical lines, only breaking on
stream operations.
* Long annotations that span multiple lines no longer have a dangling
parentesis and indent 4 spaces.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Removing code identified by the 'unused declaration' analysis in IntelliJ
* Undoing removal of injectNewRound as that's actually used
* Removing wrapper class from Clique UT
* Spotless
* Adding back code
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
A problem was identified whereby the vote in a child block was applied to the parent, this was resolved by
duplicating the parent VoteTally before modifying it, and injecting to the child block.
Some refactoring was also conducted to make VoteTally logic simpler.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Reverts #339
Görli's testnet regularly has proposers miss their turn and their
genesis block actually had a bad validator specified (that was voted out
as soon as they could) So many blocks do not have the proper "proposer"
as their block generator. As a consequence the
CliqueDifficultyValidationRule fails regularly, in fact it fails at
block 3, so this should be easy to re-create locally.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Clique Proposer Selection would choose an incorrect peer
when a signer was removed from the pool, as the algorithm worked
purely on the block count.
The algorithm has now been updated to ensure the next proposer is
incrementally the next signer in the ordered list, based on the
parent's proposer
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The ProposerSelection logic has been reworked such that it now accepts
a BlockInterface, through which IBFT parameters can be accessed
directly from the block header, without requiring literal hashing etc.
This has required the VoteBlockInterface to be renamed to
BlockInterface.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
IBFT requires various aspects of the mining infrastructure in order
to create a proposed block.
This includes specifically the BlockCreator and MiningCoordinating,
the mining executor is not required at this stage, nor is the miner.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Removing dependency upon using map.entry to define a vote that has
been proposed via JSON RPC.
This is part of the general clean up of the voting infrastructure
used for IBFT, Clique and legacy IBFT.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The consensus-mechanism specific block values have been separated
from the VoteTallyUpdater such that there is a single updater rather
than one per consensus mechanism.
This has necessitated the creation of a custom serialiser/
deserialiser for each mechanism instead.
This change will ultimatley bleed through to the proposed votes and
their insertion to mined blocks.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>