* refactor NodeWhitelistController -> NodeLocalConfigPermissioningController
* added smart contract permissioning config
* only use SyncStatusProvider if Smart Contract Permissioning enabled
* check we are not adding self enode
* local permissioning controller isPermitted() should return true if either source OR destination is permitted
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2343] some stubs in progress
* [PAN-2343] getting close to what could be a working contract controller
* [PAN-2343] added the permissioning provider interface to the smart contract controller
* [PAN-2343] smart permissioning queryer works
* [PAN-2343] docs for the smart contract permissioning controller
* [PAN-2343] removed some bad debugging
* [PAN-2343] docs
* [PAN-2343] final
* [PAN-2343] charsets
* [PAN-2343] dependencies that are missing
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2348] Changes in chain head (new blocks or chain reorgs) should trigger new permissioning check
* [PAN-2348] Changes in chain head (new blocks or chain reorgs) should trigger new permissioning check
* Errorprone
* Fix changes
* Spotless
* PR comments
* Spotless
* Fix test
* Fix javadoc
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Improve the import log line to include relevant metrics like number
of transactions, ommers, and gas usage.
Also, this fixes a bug in that we get task times when metrics are not
turned on.
Sample line:
2019-03-11 21:03:50.245+00:00 | EthScheduler-Workers-3 | INFO | BlockPropagationManager | Imported #36 / 20 tx / 0 om / 420,000 (4.0%) gas / (0xecb366469d88d9d75b20721581797c1eb1118557b93db9a460dc0e000b9ec7fe) in 0.143s.
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>
* PAN-2057: Accept transactions in the pool with nonce above account sender nonce
* Simplifying if statement
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2342] Created SyncStatusNodePermissioningProvider and NodePermissioningController
* Fix block height comparison logic
* Unit test for SyncStatusNodePermissioningProvider
* Add comment about permissioning while not in sync
* PR comments
* Fix missing final
* Fixing unit test
* Unsubscribing from Synchronizer SyncStatus updates after reaching sync
* Fix race condition
* Simplifying synchronization between callbacks
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Forces subclasses have to implement it so they specify minimum requirements for the peer to use.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The P2P and discovery ports are now always dynamically assigned (set to port 0 when starting pantheon) to guarantee they always select an available port.
This however means you can't determine the ports that will be used or the enode URL for a node before it has started. The main effect of this is that nodes have to use the peer discovery process to discover each other rather than having every node in the network in the boot nodes list. A single node is started first with no bootnodes, then other nodes are started with that node as their bootnode and use peer discovery to find the other nodes as they start.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Create a new PrivateContractAddress generation
* Remove resolveAccountFromPublicState
* Change method sign to BytesValue
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Start P2P network synchronously so the ports are guaranteed to be known before we write the ports file
Include the P2P TCP port in ports file even when peer discovery is disabled.
Load information from the advertised peer rather than the discovery listening socket.
Fix admin_nodeInfo to include the ?discport param in the enode URI when the discovery port differs from the P2P port.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
rpc_module enumerates the modules exposed to RPC. This allows the
`geth attach` geth javascript console to attach to Pantheon and use the
json-rpc APIs that pantheon and geth share.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Implement admin_nodeInfo RPC call. This involved bringing data from the
ethNetworkConfig and genesis json into the rpc call, so it had a lot of
testing side effects.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2341] Created mechanism to publish sync status
* Refactoring WebSockets syncing subscription to respond to SyncStatus events
* Removing rpc-ws-refresh-delay option
* Removing ws-refresh-delay option from ATs
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Use a single thread to persist received world state nodes to avoid RocksDB timeouts due to contention on the write lock.
* Fix RocksDbTaskQueue so it doesn't read stale data when resuming a transfer.
* Skip downloading empty trie nodes.
* Log unhandled errors from world state download requests
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>