Move header validations that extract the signer key out of the "light"
validation mode. Reduces fast sync time on goerli 75%
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Ensure `plugin-api` module gets published at the correct maven path
* Move `plugins` to `plugin-api`
Signed-off-by: Edward Evans <edward.evans@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Return plugin-api to the main repo
* Spotless
* Migrate all external plugin-api references to the project in this repo
* Add licence header
* Update repo reference for publish, even if commented
* Use real configuration for publishing plugin-api
This was tested with the
`:plugins:publishMavenJavaPublicationToMavenLocal` task and checking the
local Maven repo to make sure it was using the correct paths
Signed-off-by: Edward Evans <edward.evans@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Interally we use a `BigInteger` for ChainID, but currently use an `int` for
NetworkID. Because the default for NetworkID is the same value as ChainID there
are some chains where this will be very problematic, and there is at least
one other long-living chain outside the 32 bit int value range.
This is a large commit because the type is baked fairly deep into some of
the other APIs and very much in the test code testing the type.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Rich Data for Events Plugin
* plugin-api -> api
* use BinaryData as a root and add getValue to UInt256Value
* bring rick data changes in line with proposed APIs.
Undo orthagonal naming changes.
* add size
* use log and transaction interfaces from rich data api
* update to released plugin api version and add new event listener.
* add tests
* fix acceptance tests
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2946] - changes in core JSON-RPC method to support ReTestEth
Some of the methods need to have a changeable reference to stuff like
blockchainqueries. For the impacted methods the solution is to wrap them
in a Supplier<> interface. This includes new constructors for re-used methods.
Also include the debug_accountRangeAt method as it's namespaced as debug.
Some features needed for retesteth are flag controlled to preserve current behaviors.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Retesteth requires support for mining without block rewards and without PoW.
No Proof simply requires exposing the nonce generator and using a special
EthHashSolver.
No Reward is supported via a flag in the ProtocolSpec, stating whether or not
to skip zero rewards. For frontier, homestead, and tangerine whistle (EIP150)
this flag is false. For all other forks and all other consensus engines the
flag is true, even when emulating EVM state from those three forks as all
non-PoW consensus engines never consider block rewards.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This reverts commit 814b36e4
The needed chantes to get rid of Instant.now (which is also needed to get rid
of the wall clock dependency) are too deep and intrusive into IBFT to try and
speed patch them in that some APIs require re-work, so in the interst of test
stability this gets sheleved until it is all ready.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
To allow us to reset the timestamp in the blockchain for Retesteth support
we need to pass a Clock to affected APIs and use that instead of the static method
System.currentTimeMillis(). The most consistent way to do this that will ensure
that the API does not sneak back in is to ban the method via ErrorProne.
TestClock.fixed() was altered to return the "now" time of the first time the fixed clock was requested, needed for many header validation tasks validating headers are not from the future.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Don't copy collections if we don't need to. Change types higher up if needed.
* Don't use Guava's Object.equal, use Java's Objects.equals.
** add errorprone test to enforce the banning of Guava's Objects class.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Provides better control over the maximum number of concurrent requests to a peer.
Gives a fairer allocation of peers to requests being made.
Avoids a task failing because all peers are busy which then introduces a delay before the request is retried.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Moves init code into a separate builder instead of a static init method, with common code in an abstract base class and subclasses of the builder for each of the consensus variants.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Move RocksDBStats to it's own module. This also brings metrics to
metrics:core since none of our other module have nested modules but
they have peer modules.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PRIV-41] Use metrics system for private state db
- Use PrivacyParametersBuilder to build PrivacyParameters
- refactor PrivacyParameters to expose default options
- refactor test builders to use PrivacyParameters.DEFAULT
- Use URI in Enclave
* Fix: enclave tests from bad merge
* Fix privacy acceptance tests after db configuration changes
* Switch to use nested class for PrivacyParametersBuilder
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Added ability to subscribe to dropped transactions from the transaction pending pool.
Implemented subscription webservice to support this.
* Added metrics to the pending transactions, tracking the number of local and remote transactions in the pool.
* Converted listener management in pending transactions to use the Subscribers util object.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Biggest change is that UnusedVariable and UnusedMethod went to WARN by
default. Since our build is a no warning build this means we either need
to turn them off or fix them. I mostly opted for the latter. Test code
was mostly fixed, unused loggers were deleted, and other shipped code
was mostly suppressed.
Two less noisy fixes to not use `SortedSet` and to use zero based
comparable results instead of -1, 0, and 1. Also a compiler nit in
errorprone was suppressed, per the description it won't affect us.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Store the instant that a pending transaction is added to the txpool, and expose this out through the api.
* Clock.systemUTC only used once.
* TestClock class added with a factory method for a fixed clock.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
With re-enabling IBFT 1.0, an error was introduced whereby the Eth/62
and ETH/63 protocols did not have a mapped ProtocolManager (resulting
in an eror at runtime).
This change ensures all protocols are handled by the Istanbul64
ProtocolManager.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>