Skip to content

Remove geth.miner and any references to it for v7 #3236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/toc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Table of Contents
web3.beacon
web3.pm
web3.net
web3.miner
web3.geth
web3.tracing
web3.utils
Expand Down
4 changes: 0 additions & 4 deletions docs/web3.main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ Each ``Web3`` instance also exposes these namespaced API modules.

See :doc:`./web3.eth`

.. py:attribute:: Web3.miner

See :doc:`./web3.miner`

.. py:attribute:: Web3.pm

See :doc:`./web3.pm`
Expand Down
91 changes: 0 additions & 91 deletions docs/web3.miner.rst

This file was deleted.

1 change: 1 addition & 0 deletions newsfragments/3236.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecated ``geth.miner`` namespace and methods.
2 changes: 0 additions & 2 deletions tests/core/txpool-module/test_txpool_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
def test_txpool_content(web3_empty):
web3 = web3_empty

web3.geth.miner.stop()

with Timeout(60) as timeout:
while web3.eth.hashrate or web3.eth.mining:
timeout.sleep(random.random())
Expand Down
2 changes: 0 additions & 2 deletions tests/core/txpool-module/test_txpool_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
def test_txpool_inspect(web3_empty):
web3 = web3_empty

web3.geth.miner.stop()

with Timeout(60) as timeout:
while web3.eth.hashrate or web3.eth.mining:
timeout.sleep(random.random())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _geth_command_arguments(ws_port, base_geth_command_arguments, geth_version):
"--ws.port",
ws_port,
"--ws.api",
"admin,eth,net,web3,personal,miner",
"admin,eth,net,web3,personal",
"--ws.origins",
"*",
"--ipcdisable",
Expand Down
66 changes: 0 additions & 66 deletions web3/_utils/miner.py

This file was deleted.

12 changes: 0 additions & 12 deletions web3/_utils/module_testing/module_testing_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections import (
deque,
)
import time
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -60,17 +59,6 @@
flaky_geth_dev_mining = flaky(max_runs=3)


def mine_pending_block(w3: "Web3") -> None:
timeout = 10

w3.geth.miner.start() # type: ignore
start = time.time()
while time.time() < start + timeout:
if len(w3.eth.get_block("pending")["transactions"]) == 0:
break
w3.geth.miner.stop() # type: ignore


def assert_contains_log(
result: Sequence[LogReceipt],
block_with_txn_with_log: BlockData,
Expand Down
10 changes: 0 additions & 10 deletions web3/_utils/rpc_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ class RPC:
evm_revert = RPCEndpoint("evm_revert")
evm_snapshot = RPCEndpoint("evm_snapshot")

# miner
miner_makeDag = RPCEndpoint("miner_makeDag")
miner_setExtra = RPCEndpoint("miner_setExtra")
miner_setEtherbase = RPCEndpoint("miner_setEtherbase")
miner_setGasPrice = RPCEndpoint("miner_setGasPrice")
miner_start = RPCEndpoint("miner_start")
miner_stop = RPCEndpoint("miner_stop")
miner_startAutoDag = RPCEndpoint("miner_startAutoDag")
miner_stopAutoDag = RPCEndpoint("miner_stopAutoDag")

# net
net_listening = RPCEndpoint("net_listening")
net_peerCount = RPCEndpoint("net_peerCount")
Expand Down
25 changes: 0 additions & 25 deletions web3/geth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
from web3._utils.compat import (
Protocol,
)
from web3._utils.miner import (
make_dag,
set_etherbase,
set_extra,
set_gas_price,
start,
start_auto_dag,
stop,
stop_auto_dag,
)
from web3._utils.rpc_abi import (
RPC,
)
Expand Down Expand Up @@ -215,21 +205,6 @@ class GethAdmin(Module):
)


class GethMiner(Module):
"""
https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-miner
"""

make_dag = make_dag
set_extra = set_extra
set_etherbase = set_etherbase
set_gas_price = set_gas_price
start = start
stop = stop
start_auto_dag = start_auto_dag
stop_auto_dag = stop_auto_dag


class Geth(Module):
personal: GethPersonal
admin: GethAdmin
Expand Down
2 changes: 0 additions & 2 deletions web3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
AsyncGethTxPool,
Geth,
GethAdmin,
GethMiner,
GethPersonal,
GethTxPool,
)
Expand Down Expand Up @@ -171,7 +170,6 @@ def get_default_modules() -> Dict[str, Union[Type[Module], Sequence[Any]]]:
Geth,
{
"admin": GethAdmin,
"miner": GethMiner,
"personal": GethPersonal,
"txpool": GethTxPool,
},
Expand Down
9 changes: 0 additions & 9 deletions web3/providers/eth_tester/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,6 @@ def personal_send_transaction(eth_tester: "EthereumTester", params: Any) -> HexS
"writeBlockProfile": not_implemented,
"writeMemProfile": not_implemented,
},
"miner": {
"make_dag": not_implemented,
"set_extra": not_implemented,
"set_gas_price": not_implemented,
"start": not_implemented,
"stop": not_implemented,
"start_auto_dag": not_implemented,
"stop_auto_dag": not_implemented,
},
"personal": {
"ec_recover": not_implemented,
"import_raw_key": call_eth_tester("add_account"),
Expand Down
1 change: 0 additions & 1 deletion web3/providers/rpc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

REQUEST_RETRY_ALLOWLIST = [
"admin",
"miner",
"net",
"txpool",
"testing",
Expand Down