Skip to content

Commit

Permalink
More tweaks for geth v1.11.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Feb 23, 2023
1 parent 0e7916d commit 90a9ad3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions newsfragments/2841.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ``py-geth`` version and re-generate integration test fixture with geth ``v1.11.2``.
1 change: 1 addition & 0 deletions tests/integration/go_ethereum/test_goethereum_ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def _geth_command_arguments(geth_ipc_path, base_geth_command_arguments):
geth_ipc_path,
"--miner.etherbase",
COINBASE[2:],
"--rpc.enabledeprecatedpersonal",
)


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/go_ethereum/test_goethereum_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def _geth_command_arguments(ws_port, base_geth_command_arguments, geth_version):
yield from base_geth_command_arguments
if geth_version.major == 1:
yield from (
"--miner.etherbase",
COINBASE[2:],
"--ws",
"--ws.port",
ws_port,
Expand All @@ -45,8 +47,6 @@ def _geth_command_arguments(ws_port, base_geth_command_arguments, geth_version):
"*",
"--ipcdisable",
"--allow-insecure-unlock",
"--miner.etherbase",
COINBASE[2:],
)
if geth_version.minor not in [10, 11]:
raise AssertionError("Unsupported Geth version")
Expand Down
7 changes: 6 additions & 1 deletion web3/tools/benchmark/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ def main(logger: logging.Logger, num_calls: int) -> None:
for built_fixture in fixture.build():
for _ in built_fixture:
w3_http = build_web3_http(fixture.endpoint_uri)
loop = asyncio.get_event_loop()
try:
loop = asyncio.get_running_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

async_w3_http = loop.run_until_complete(
build_async_w3_http(fixture.endpoint_uri)
)
Expand Down
6 changes: 6 additions & 0 deletions web3/tools/benchmark/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

GETH_FIXTURE_ZIP = "geth-1.11.2-fixture.zip"

# use same coinbase value as in `web3.py/tests/integration/generate_fixtures/common.py`
COINBASE = "0xdc544d1aa88ff8bbd2f2aec754b1f1e99e1812fd"


class GethBenchmarkFixture:
def __init__(self) -> None:
Expand Down Expand Up @@ -88,6 +91,9 @@ def _geth_command_arguments(self, datadir: str) -> Sequence[str]:
"admin,eth,net,web3,personal,miner",
"--ipcdisable",
"--allow-insecure-unlock",
"--miner.etherbase",
COINBASE[2:],
"--rpc.enabledeprecatedpersonal",
)

def _geth_process(
Expand Down

0 comments on commit 90a9ad3

Please sign in to comment.