teatime.plugins.eth1 package

Submodules

teatime.plugins.eth1.account_creation module

This module contains a plugin with checks for account creation.

class teatime.plugins.eth1.account_creation.AccountCreation(test_password: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Detect whether it’s possible to create an account on the node.

Severity: Medium

This check will try to generate a new account on the node using the personal_newAccount and lock the new account with the given password.

Geth: https://geth.ethereum.org/docs/rpc/ns-personal#personal_newaccount Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-personal-module#personal_newaccount

INTRUSIVE = True

teatime.plugins.eth1.account_import module

This module holds the plugin checking for accound imports.

class teatime.plugins.eth1.account_import.GethAccountImport(keydata: str, password: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Detect whether it’s possible to import an account on the node.

Severity: Medium

This check will try to import an existing account on the node using the personal_importRawKey and lock the new account with the given password. This check only works with Geth client nodes.

Geth: https://geth.ethereum.org/docs/rpc/ns-personal#personal_importrawkey

INTRUSIVE = True

teatime.plugins.eth1.gas_limits module

This module contains plugins around the gas-setting RPC endpoints.

class teatime.plugins.eth1.gas_limits.ParityGasCeiling(gas_target: int)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to set a new gas ceiling target for mined blocks.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setgasceiltarget

INTRUSIVE = True
class teatime.plugins.eth1.gas_limits.ParityGasFloor(gas_floor: int)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to set a new gas floor target for mined blocks.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setgasfloortarget

INTRUSIVE = True

teatime.plugins.eth1.information_leaks module

This module contains plugins with admin interface checks.

class teatime.plugins.eth1.information_leaks.GethDatadir[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch Geth’s data directory.

Severity: Low

Geth: https://geth.ethereum.org/docs/rpc/ns-admin#admin_datadir

INTRUSIVE = False
class teatime.plugins.eth1.information_leaks.GethNodeInfo[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch admin info about the node.

Severity: Low

Geth: https://geth.ethereum.org/docs/rpc/ns-admin#admin_nodeinfo

INTRUSIVE = False
class teatime.plugins.eth1.information_leaks.ParityDevLogs[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch the node’s developer logs.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity-module#parity_devlogs

INTRUSIVE = False
class teatime.plugins.eth1.information_leaks.PeerlistLeak[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch peer list information.

Severity: Medium

Geth: https://geth.ethereum.org/docs/rpc/ns-admin#admin_peers Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity-module#parity_netpeers

INTRUSIVE = False

teatime.plugins.eth1.manipulation module

This module contains plugins around setting vital execution parameters.

class teatime.plugins.eth1.manipulation.ParityChangeCoinbase(author: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to change the coinbase address.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setauthor

INTRUSIVE = True
class teatime.plugins.eth1.manipulation.ParityChangeExtra(extra_data: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to set the extra data field.

Severity: Low

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setextradata

INTRUSIVE = True
class teatime.plugins.eth1.manipulation.ParityChangeTarget(target_chain: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to change the target chain.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setchain

INTRUSIVE = True
class teatime.plugins.eth1.manipulation.ParitySyncMode(mode: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to set the node’s sync mode.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setmode

INTRUSIVE = True

teatime.plugins.eth1.mining module

This module contains a plugin for mining-related checks.

class teatime.plugins.eth1.mining.HashrateStatus(expected_hashrate: int)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check whether the node has a certain hash rate.

Severity: Medium

This plugin will use the eth_hashrate method to fetch the node’s hash rate. If the hash rate is different from a user-specified value, an issue will be logged.

INTRUSIVE = False
class teatime.plugins.eth1.mining.MiningStatus(should_mine: bool)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check whether the node is mining.

Severity: Medium

This plugin will use the eth_mining method to find out whether a node is mining or not. If there is a difference to the user-specified value, an issue will be logged.

INTRUSIVE = False

teatime.plugins.eth1.network module

This module contains a plugin for network-related checks.

class teatime.plugins.eth1.network.NetworkListening[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check whether the node is listening for peers.

Severity: High

This plugin will use the net_listening method to check whether the node is listening to new peers. If that is not the case, an issue will be logged.

INTRUSIVE = False
class teatime.plugins.eth1.network.ParityDropPeers[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to remove non-reserved peers from the peer list.

Severity: Critical

This plugin will attempt to drop all non-reserved peer entries from the node’s peer table.

INTRUSIVE = True
class teatime.plugins.eth1.network.PeerCountStatus(minimum_peercount: int)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check whether the node has a certain peer count.

Severity: Medium

This plugin will use the net_peerCount method to check the node’s peer count. If the value is lower than the user-specified value of minimum peers, an issue will be logged.

INTRUSIVE = False
class teatime.plugins.eth1.network.PeerlistManipulation(test_enode: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to add a peer to the node’s peer list.

Severity: High

This plugin will attempt to add a given peer to the node’s peer list.

INTRUSIVE = True

teatime.plugins.eth1.open_accounts module

This module contains a plugin checking for account-related issues.

class teatime.plugins.eth1.open_accounts.AccountUnlock(infura_url: str, wordlist=None, skip_below: int = None)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check whether any accounts on the node are weakly protected.

Severity: Critical

This plugin will use the eth_accounts method to find accounts registered on the target node, and attempt to unlock the accounts with a given set of passwords. Each account is unlocked for a time of one second, the minimum time possible.

Optionally, accounts below a minimum balance can be skipped.

INTRUSIVE = True
class teatime.plugins.eth1.open_accounts.OpenAccounts(infura_url: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check for any accounts registered on the node.

Severity: Medium

This plugin will use the eth_accounts method to find accounts registered on the target node, and fetch the account’s latest balance through Infura.

INTRUSIVE = False

teatime.plugins.eth1.rpc module

This module contains plugins for controlling the HTTP RPC server status.

class teatime.plugins.eth1.rpc.GethStartRPC[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to start the RPC service.

Severity: Critical

This plugin attempts to start the HTTP RPC interface using the admin_startRPC method.

INTRUSIVE = True
class teatime.plugins.eth1.rpc.GethStopRPC[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to stop the RPC service.

Severity: Critical

Talking about shooting yourself in the foot. This plugin attempts to stop the HTTP RPC interface using the admin_stopRPC method. In case you didn’t notice, this might affect the outcome of other plugins due to connection failures.

INTRUSIVE = True

teatime.plugins.eth1.sha3 module

This module contains a plugin to check for SHA3 consistency.

class teatime.plugins.eth1.sha3.SHA3Consistency(test_input: str, test_output: str)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check for SHA3 consistency.

Severity: Critical

This plugin submits a user-specified value and lets the node convert it into a SHA3 hash using the web3_sha3 method. If the result value is different from the user-specified output value, an issue is logged.

INTRUSIVE = False

teatime.plugins.eth1.sync module

This module contains a plugin checking for node sync issues.

class teatime.plugins.eth1.sync.NodeSync(infura_url, block_threshold: int = 10)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check the node’s sync state and whether it’s stuck.

Severity: None/Critical

This plugin fetches the sync state if the node. If it is not syncing, the most recent block number is fetched from Infura using the eth_blockNumber method. If the most recent block number is higher than the node’s block number with a certain threshold, the node might be stuck and out of sync with the mainnet. In that case, a critical issue is logged. Otherwise, an informational issue on the current sync state is logged.

INTRUSIVE = False

teatime.plugins.eth1.tx_limits module

This module contains plugins around setting transaction-related limits.

class teatime.plugins.eth1.tx_limits.ParityMinGasPrice(gas_price: int)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to set the minimum transaction gas price.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setmingasprice

INTRUSIVE = True
class teatime.plugins.eth1.tx_limits.ParityTxCeiling(gas_limit: int)[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to set the maximum transaction gas.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module#parity_setmaxtransactiongas

INTRUSIVE = True

teatime.plugins.eth1.txpool module

This module contains checks regarding a node’s transaction pool.

class teatime.plugins.eth1.txpool.GethTxPoolInspection[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to inspect the transaction pool.

Severity: Low

Geth: https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_inspect

INTRUSIVE = False
class teatime.plugins.eth1.txpool.GethTxPoolStatus[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch the transaction pool status.

Severity: Low

Geth: https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_status

INTRUSIVE = False
class teatime.plugins.eth1.txpool.ParityTxPoolStatistics[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch the transaction pool statistics.

Severity: Low

Parity: https://openethereum.github.io/wiki/JSONRPC-parity-module#parity_pendingtransactionsstats

INTRUSIVE = False
class teatime.plugins.eth1.txpool.TxPoolContent[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to fetch the transaction pool contents.

Severity: Low

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity-module#parity_pendingtransactions Geth: https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content

INTRUSIVE = False

teatime.plugins.eth1.upgrade module

This module contains a plugin checking for Parity/OpenEthereum upgrades.

class teatime.plugins.eth1.upgrade.ParityUpgrade[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to check for an available upgrade.

Severity: Critical

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-parity_set-module.html#parity_upgradeready

INTRUSIVE = False

teatime.plugins.eth1.version module

This module contains a plugin to check for stale node versions.

class teatime.plugins.eth1.version.NodeVersion(geth_url: str = 'https://api.github.com/repos/ethereum/go-ethereum/releases/latest', parity_url: str = 'https://api.github.com/repos/openethereum/openethereum/releases/latest')[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Check whether a given node’s version is stale.

Severity: None/High

This plugin will fetch the client’s version string, and attempt to extract the node’s semantic version number. For Geth and Parity/OpenEthereum, it will try to fetch the latest repository tag and compare both versions. If there is a mismatch, an issue is logged about the node version being stale. In any case, an informational issue will be logged containing the version string.

Parity/OpenEthereum: https://openethereum.github.io/wiki/JSONRPC-web3-module#web3_clientversion Geth: I couldn’t find the web3 namespace in the official docs :(

INTRUSIVE = False
static latest_repo_release(url: str) → str[source]

Fetch the latest release tag for the given repository URL.

This method will use the public Github API to fetch the latest release tag for the given repository.

Returns:The repo’s semver as a string

teatime.plugins.eth1.websocket module

This module contains plugins for controlling the Websocket RPC server status.

class teatime.plugins.eth1.websocket.GethStartWebsocket[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to start the websocket service.

Severity: Critical

Geth: https://geth.ethereum.org/docs/rpc/ns-admin#admin_startws

INTRUSIVE = True
class teatime.plugins.eth1.websocket.GethStopWebsocket[source]

Bases: teatime.plugins.base.JSONRPCPlugin

Try to stop the websocket service.

Severity: Critical

Geth: https://geth.ethereum.org/docs/rpc/ns-admin#admin_stopws

INTRUSIVE = True

Module contents

This package contains plugins related to Ethereum 1.0.