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>
SignedData is to be used as part of QBFT, and as such the IBFT specific aspects of this class are to be moved into a separate class (allowed SignedData to be moved into the common package)
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
The change from create to DEFAULT was something that I saw was needed
to keep the reference tests performant in the upcoming EIP-2718 changes.
The change from reading the whole mainnet genesis to reading just the
config portion came from OutOfMemoryErrors in the reference tests when
running normalizeKeys.
Also moved them to ProtocolTestFixture since they're only used by tests.
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
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>
* #1561 - Create/store/update ENR when local node is created
Signed-off-by: David Mechler <david.mechler@consensys.net>
* #1561 - spotlessApply
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Update discovery library to prod version 0.4.1
Signed-off-by: David Mechler <david.mechler@consensys.net>
This is a not-fully-functional prototype of Bonsai Tries.
Bonsai tries is a flat leaf storage, branch-by-location, and diff based reorgs
refactoring of the existing forest based trie storage mechanism aimed at
creating sustainable performance at mainnet loads.
* Since it is experimental a feature flag of --Xdata-storage-format=BONSAI
controls activation.
Some required changes have a long reach:
* To accommodate location based storage many Trie operations accept both a
location and hash value. Each data storage format is keyed off of only
one of the fields, so many tests will pass in null to the other field.
* MutableWorldStateUpdater.persist now takes an argument of a block hash.
If this is a natural progression of blocks the hash of the new block is
passed in. Otherwise null should be passed in.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Add `memory` as an option for `--key-value-storage`. This is useful in
small network synchronization tests as memory is faster and is easier to
inspect via a debugger.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
This implements the encoding/decoding logic and because it's backwards
compatible we can introduce it immediately. You can see that some of
the typed-transaction specific encoding/decoding logic is tested where
there are EIP-1559 encoding/decoding tests but there'll be more tests
included in the EIP-2930 PR.
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
* modifying transaction RLP encode/decode to handle GoQuorum private tx value
* added static flag to be read by TransactionRLPDecoder so that we can still allow chainId=1
* ensure chainId and v not both provided
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Make sure DNS discovery URLs are never present if using a genesis file
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add tests to make sure we cover extensively the genesis file vs named network use cases
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.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>
* Add more block import metrics, including gas burnt and gas burn rate.
* Drop reporting period from 100 blocks to 1000.
* Log one final time at the end of each file.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
With future storage needs in mind change `createPruningStorage` to a
more generic `getStorageBySegmentIdentifier` method where the segment
identifier is the argument. For now that's just pruning storage as
world state needs a specific return type.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Fixed issue where get methods were no longer public
Signed-off-by: David Mechler <david.mechler@consensys.net>
* Add tests for JSON
Signed-off-by: David Mechler <david.mechler@consensys.net>
* 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>
switch to bash comments for commented out commands.
(It's inside a scalar, so it should still go to bash)
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* Add DNS discovery for goerli, rinkeby and mainnet to help speed up discovery of peers
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Add final to constant fields
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Co-authored-by: David Mechler <david.mechler@consensys.net>