* Add privacy group id to private transaction
* Update enclave send methods to accept privacy group id
* Update eea sendRawTransaction endpoint
* extract privacy group id from private transaction if present
* extract privateFor/privateFrom if privacy group id is not present
* Fix tests
* Change abstract class invocation to concrete class.
* Utility method to load enclave public key
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add support for working within Network Address Translation (NAT) environments.
This adds a CLI flag `--nat-method` with two options, `NONE` (the default and
current behavior) and `UPNP.` `--nat-method` will affect what IP address and
ports are advertised via the P2P discovery and other APIs that report the
address and port for P2P actions.
`UPNP` is intended for a typical home or small office environment where a
wireless router or modem provides NAT isolation.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Display World State Sync Progress in Logs
- compute estimated world state completion
- display estimated world state completion in the logs
- `CompleteTaskStep` now have access to a `LongSupplier` to retireve the number of pending requests
- use a `RunnableCounter` to trigger displaying every 1000 requests completed
- only show a new log when the estimation changes
- added test to check the estimation computation
* report using raw ratio rather than percentage
* resolve PR discussion
* rename getTotal to get
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* add dump sub command
* add getBlockHash method for the dump sub command
* Resolve review issues : Add the ability to export multiple blocks, Rename dump command to export command, Improve tests for the export command
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Also sanity check as part of build so we know if the checks start failing prior to the actual release.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Ensure the environment variable default provider is always used even if there is no config file.
* Remove static block.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
- Update SyncStatusNodePermissioningProvider to use URI (without discovery port) instead of EnodeURI to allow optimised permission checking of static nodes
- Add EnodeURL.toURIWithoutDiscoveryPort
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Update the reference tests to where they are pre-Istanbul.
One small error in ExtCodeHash is fixed.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Currently when json-rpc and ws services are configured with a port value of 0, the "net_services" endpoint will display their ports as "0". A configured port of "0" actually means "choose a random port". We need to get the actual port that those services are using displayed in the "net_services" JSON-RPC response.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
- refactor packages
- remove `PantheonExceptionHandler` inner class and create a separate class
- introduce subcommand package
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add nonce too low unit tests to grahql and json-rpc
Also, add all the private transacton failures mappings to graphql
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PIE-1736] Implement incoming transaction messages CLI option as an unstable command.
`--tx-pool-keep-alive-seconds` should be a `-X` option.
- `tx-pool-keep-alive-seconds` is renamed to `incoming-tx-messages-keep-alive-seconds`
- `incoming-tx-messages-keep-alive-seconds` is an unstable command not visible for the user (`--Xincoming-tx-messages-keep-alive-seconds`)
* fix unit test & spotless apply
* use TransactionPoolConfiguration to hold unstable option.
* add tests
* remove unecessary mock stubbing
* spotless apply
* use real builder instead of mock
* remove commented code
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Updated TransactionValidationParams with checkLocalPermissioning flag
* Added TransactionValidationParam to TxProcessor
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Columnated storage to allow for iteration over world state
* change MetricsCategory to PantheonMetricsCategory
* consistency renaming of kvstores
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2850] Create a transaction pool configuration object
* fix unit test by adding equals and hash code methods
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Add eea_createPrivacyGroup endpoint
* Update orion version
* Fix the failing create privacy group test
* Add eea deletePrivacyGroup API in pantheon
* Update Orion to 1.1.0 release
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PIE-1710] Expose a CLI option to configure the life time of transaction messages.
- add a cli option `--tx-pool-message-keep-alive-seconds`
* rename cli option
* change cli option description
* spotless apply
* Update everything_config.toml
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* use MockitoJUnitRunner to run TransactionsMessageProcessor tests
* implement metrics counter and logging
* (format) replace statement by lambda expression
* (doc) fix javadoc
* spotless apply
* remove modulo and reset step counter to zero
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add the needed Istanbul configuration options to the genesis file and needed
hooks in the protocol specs for Istanbul.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PIE-1707] Implement a timeout in TransactionMessageProcessor
- `processTransactionsMessage` now takes a `keepAlive` parameter
- don't process the message if expired
- add unit tests
- use a default timeout for transactions (1 minute)
* Update ethereum/eth/src/test/java/tech/pegasys/pantheon/ethereum/eth/transactions/TransactionsMessageProcessorTest.java
Co-Authored-By: Nicolas MASSART <NicolasMassart@users.noreply.github.com>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2786] Stop Transaction Pool Queue from Growing Unbounded
- use a `ArrayBlockingQueue` with a fixed size to limit the transaction task queue
- expose a method in `MonitoredExecutors` to create a working queue with a maximum capacity
- update `EthScheduler` to use a limited working queue for the `txWorkerExecutor`
* [PAN-2786] Implement a bounded timed queue
- implement a custom bounded queue
- use a time based policy with keep alive configuration
- implement eviction process based on the policy
- add metrics
* use field instead of parameter
* fix PR pass 1
- use concrete class instead of interface
- change metric name to comply with global policy
- update unit test
- wrap `Runnable` into `scheduleTxWorkerTask`
* fix PR
- remove time based policy
- use raw `Runnable`
- make a room for a new element at full capacity
* Update BoundedQueueTest.java
invert condition
* fix PR comments
- remove Mock class
- make logic more thread safe, avoid race condition
- remove element until the new one is accepted
* Update ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/manager/EthScheduler.java
Co-Authored-By: Adrian Sutton <adrian@symphonious.net>
* spotless apply
* fix nit comments
- use assertj assertions for better readability
- improve unit test
* spotless apply
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>