web3 7.1.0__py3-none-any.whl → 7.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- web3/_utils/async_transactions.py +27 -16
- web3/_utils/caching/__init__.py +12 -0
- web3/_utils/{caching.py → caching/caching_utils.py} +121 -36
- web3/_utils/caching/request_caching_validation.py +129 -0
- web3/_utils/contract_sources/contract_data/arrays_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/bytes_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/constructor_contracts.py +7 -7
- web3/_utils/contract_sources/contract_data/contract_caller_tester.py +3 -3
- web3/_utils/contract_sources/contract_data/emitter_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/event_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/extended_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/fallback_function_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/math_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/offchain_lookup.py +3 -3
- web3/_utils/contract_sources/contract_data/offchain_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/panic_errors_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/payable_tester.py +3 -3
- web3/_utils/contract_sources/contract_data/receive_function_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/reflector_contracts.py +3 -3
- web3/_utils/contract_sources/contract_data/revert_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/simple_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/storage_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/string_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/tuple_contracts.py +5 -5
- web3/_utils/http.py +5 -2
- web3/_utils/module_testing/eth_module.py +40 -0
- web3/_utils/transactions.py +14 -13
- web3/exceptions.py +14 -1
- web3/main.py +23 -0
- web3/middleware/signing.py +2 -2
- web3/providers/async_base.py +12 -0
- web3/providers/base.py +11 -0
- web3/providers/persistent/async_ipc.py +26 -26
- web3/providers/rpc/async_rpc.py +10 -2
- web3/providers/rpc/rpc.py +11 -2
- web3/utils/__init__.py +2 -0
- web3/utils/caching.py +8 -0
- {web3-7.1.0.dist-info → web3-7.3.0.dist-info}/METADATA +19 -12
- {web3-7.1.0.dist-info → web3-7.3.0.dist-info}/RECORD +43 -46
- {web3-7.1.0.dist-info → web3-7.3.0.dist-info}/WHEEL +1 -1
- web3/tools/benchmark/__init__.py +0 -0
- web3/tools/benchmark/main.py +0 -190
- web3/tools/benchmark/node.py +0 -120
- web3/tools/benchmark/reporting.py +0 -39
- web3/tools/benchmark/utils.py +0 -69
- {web3-7.1.0.dist-info → web3-7.3.0.dist-info}/LICENSE +0 -0
- {web3-7.1.0.dist-info → web3-7.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: web3
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.3.0
|
|
4
4
|
Summary: web3: A Python library for interacting with Ethereum
|
|
5
5
|
Home-page: https://github.com/ethereum/web3.py
|
|
6
6
|
Author: The Ethereum Foundation
|
|
@@ -37,15 +37,8 @@ Requires-Dist: pywin32 >=223 ; platform_system == "Windows"
|
|
|
37
37
|
Provides-Extra: dev
|
|
38
38
|
Requires-Dist: build >=0.9.0 ; extra == 'dev'
|
|
39
39
|
Requires-Dist: bumpversion >=0.5.3 ; extra == 'dev'
|
|
40
|
-
Requires-Dist: flaky >=3.7.0 ; extra == 'dev'
|
|
41
|
-
Requires-Dist: hypothesis >=3.31.2 ; extra == 'dev'
|
|
42
40
|
Requires-Dist: ipython ; extra == 'dev'
|
|
43
|
-
Requires-Dist: mypy ==1.10.0 ; extra == 'dev'
|
|
44
|
-
Requires-Dist: pre-commit >=3.4.0 ; extra == 'dev'
|
|
45
|
-
Requires-Dist: pytest-asyncio <0.23,>=0.21.2 ; extra == 'dev'
|
|
46
|
-
Requires-Dist: pytest-mock >=1.10 ; extra == 'dev'
|
|
47
41
|
Requires-Dist: setuptools >=38.6.0 ; extra == 'dev'
|
|
48
|
-
Requires-Dist: tox >=4.0.0 ; extra == 'dev'
|
|
49
42
|
Requires-Dist: tqdm >4.32 ; extra == 'dev'
|
|
50
43
|
Requires-Dist: twine >=1.13 ; extra == 'dev'
|
|
51
44
|
Requires-Dist: wheel ; extra == 'dev'
|
|
@@ -53,23 +46,37 @@ Requires-Dist: sphinx >=6.0.0 ; extra == 'dev'
|
|
|
53
46
|
Requires-Dist: sphinx-autobuild >=2021.3.14 ; extra == 'dev'
|
|
54
47
|
Requires-Dist: sphinx-rtd-theme >=1.0.0 ; extra == 'dev'
|
|
55
48
|
Requires-Dist: towncrier <22,>=21 ; extra == 'dev'
|
|
56
|
-
Requires-Dist: eth-tester[py-evm] <0.13.0b1,>=0.11.0b1 ; extra == 'dev'
|
|
57
|
-
Requires-Dist: py-geth >=5.0.0 ; extra == 'dev'
|
|
58
49
|
Requires-Dist: pytest-asyncio <0.23,>=0.18.1 ; extra == 'dev'
|
|
50
|
+
Requires-Dist: pytest-mock >=1.10 ; extra == 'dev'
|
|
59
51
|
Requires-Dist: pytest-xdist >=2.4.0 ; extra == 'dev'
|
|
60
52
|
Requires-Dist: pytest >=7.0.0 ; extra == 'dev'
|
|
53
|
+
Requires-Dist: flaky >=3.7.0 ; extra == 'dev'
|
|
54
|
+
Requires-Dist: hypothesis >=3.31.2 ; extra == 'dev'
|
|
55
|
+
Requires-Dist: tox >=4.0.0 ; extra == 'dev'
|
|
56
|
+
Requires-Dist: mypy ==1.10.0 ; extra == 'dev'
|
|
57
|
+
Requires-Dist: pre-commit >=3.4.0 ; extra == 'dev'
|
|
58
|
+
Requires-Dist: eth-tester[py-evm] <0.13.0b1,>=0.11.0b1 ; extra == 'dev'
|
|
59
|
+
Requires-Dist: py-geth >=5.0.0 ; extra == 'dev'
|
|
61
60
|
Provides-Extra: docs
|
|
62
61
|
Requires-Dist: sphinx >=6.0.0 ; extra == 'docs'
|
|
63
62
|
Requires-Dist: sphinx-autobuild >=2021.3.14 ; extra == 'docs'
|
|
64
63
|
Requires-Dist: sphinx-rtd-theme >=1.0.0 ; extra == 'docs'
|
|
65
64
|
Requires-Dist: towncrier <22,>=21 ; extra == 'docs'
|
|
66
65
|
Provides-Extra: test
|
|
67
|
-
Requires-Dist: eth-tester[py-evm] <0.13.0b1,>=0.11.0b1 ; extra == 'test'
|
|
68
|
-
Requires-Dist: py-geth >=5.0.0 ; extra == 'test'
|
|
69
66
|
Requires-Dist: pytest-asyncio <0.23,>=0.18.1 ; extra == 'test'
|
|
70
67
|
Requires-Dist: pytest-mock >=1.10 ; extra == 'test'
|
|
71
68
|
Requires-Dist: pytest-xdist >=2.4.0 ; extra == 'test'
|
|
72
69
|
Requires-Dist: pytest >=7.0.0 ; extra == 'test'
|
|
70
|
+
Requires-Dist: flaky >=3.7.0 ; extra == 'test'
|
|
71
|
+
Requires-Dist: hypothesis >=3.31.2 ; extra == 'test'
|
|
72
|
+
Requires-Dist: tox >=4.0.0 ; extra == 'test'
|
|
73
|
+
Requires-Dist: mypy ==1.10.0 ; extra == 'test'
|
|
74
|
+
Requires-Dist: pre-commit >=3.4.0 ; extra == 'test'
|
|
75
|
+
Requires-Dist: eth-tester[py-evm] <0.13.0b1,>=0.11.0b1 ; extra == 'test'
|
|
76
|
+
Requires-Dist: py-geth >=5.0.0 ; extra == 'test'
|
|
77
|
+
Provides-Extra: tester
|
|
78
|
+
Requires-Dist: eth-tester[py-evm] <0.13.0b1,>=0.11.0b1 ; extra == 'tester'
|
|
79
|
+
Requires-Dist: py-geth >=5.0.0 ; extra == 'tester'
|
|
73
80
|
|
|
74
81
|
# web3.py
|
|
75
82
|
|
|
@@ -14,10 +14,10 @@ ens/specs/normalization_spec.json,sha256=xn3N9a-6KHMLu3MeCBsmOxSzIzUQykzE9EscKK1
|
|
|
14
14
|
web3/__init__.py,sha256=P11QAEV_GYoZq9ij8gDzFx5tKzJY2aMXG-keg2Lg1xs,1277
|
|
15
15
|
web3/constants.py,sha256=eQLRQVMFPbgpOjjkPTMHkY-syncJuO-sPX5UrCSRjzQ,564
|
|
16
16
|
web3/datastructures.py,sha256=LbUsfE0icgRRTXsC_LATR-LtmO7MAYwYB5D-6LCX1jE,11366
|
|
17
|
-
web3/exceptions.py,sha256=
|
|
17
|
+
web3/exceptions.py,sha256=MH4W0eLG4TNQXRCpVY18BshnVpnSZgV1Gz9HBH3UpH4,9413
|
|
18
18
|
web3/geth.py,sha256=IQYeqiVSqcskuXWgDR35UBuVsD-whhvTpDltO4vvCvE,5867
|
|
19
19
|
web3/logs.py,sha256=ROs-mDMH_ZOecE7hfbWA5yp27G38FbLjX4lO_WtlZxQ,198
|
|
20
|
-
web3/main.py,sha256=
|
|
20
|
+
web3/main.py,sha256=NTbE9J3nbrgbXNFP676Pi-JfZjfkQXI_PRiC6xn3htk,15146
|
|
21
21
|
web3/manager.py,sha256=_3Ox2IdGh0iOCGF7e2NFK3-kp3esZ-KUkZDrNTNFLqY,22905
|
|
22
22
|
web3/method.py,sha256=Uv29Vng93VC5-HHeRok30PUbGCg42SNA2YsxiweTgWA,8593
|
|
23
23
|
web3/module.py,sha256=rz_cqGNlzLGCHLE8zDf-hW4SpDfLgzVEW8pgDxM45Y0,6006
|
|
@@ -30,10 +30,9 @@ web3/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
30
30
|
web3/_utils/abi.py,sha256=6-k4oKesmJ74ZXwH1yKg-zW6UjieUgnXuWK0gzGSC6U,25674
|
|
31
31
|
web3/_utils/abi_element_identifiers.py,sha256=m305lsvUZk-jkPixT0IJd9P5sXqMvmwlwlLeBgEAnBQ,55
|
|
32
32
|
web3/_utils/async_caching.py,sha256=2XnaKCHBTTDK6B2R_YZvjJqIRUpbMDIU1uYrq-Lcyp8,486
|
|
33
|
-
web3/_utils/async_transactions.py,sha256=
|
|
33
|
+
web3/_utils/async_transactions.py,sha256=fodlTP7zpoFhFycWQszJWN0UUAfu5neQTCYJ3eGRCA0,5581
|
|
34
34
|
web3/_utils/batching.py,sha256=SbFKYFCRTrkFMFNa4HA4DkD_Qbjc6atnebMObyuQeHE,6316
|
|
35
35
|
web3/_utils/blocks.py,sha256=SZ17qSJuPAH5Dz-eQPGOsZw_QtkG19zvpSYMv6mEDok,2138
|
|
36
|
-
web3/_utils/caching.py,sha256=-9jyR33wBWrWGp1S7LFvovDQblLLYr8Kz7oujnJwhqA,5406
|
|
37
36
|
web3/_utils/contracts.py,sha256=HKYJKJedf8eO5az-YVybrqfw0K1__9Da5QyLVfqSPVE,10994
|
|
38
37
|
web3/_utils/datatypes.py,sha256=nI0C9XWl46gFj1RpwuoHfVqb4e73wlaerE1LNyMg3oo,1701
|
|
39
38
|
web3/_utils/decorators.py,sha256=bYIoVL0DjHWU2-KOmg-UYg6rICeThlLVZpH9yM2NT8s,1825
|
|
@@ -45,7 +44,7 @@ web3/_utils/events.py,sha256=sVAXWUMmWKwYguWzk_jqra3rI6NZ55T3XfDp4_aDa-8,17044
|
|
|
45
44
|
web3/_utils/fee_utils.py,sha256=MFt27R9E3qFP-Hf87-Lzv0JAiuYRE_qqafyTmzctAYA,2145
|
|
46
45
|
web3/_utils/filters.py,sha256=1WX2Vgmat8QKj0WNm_GoRcVp4iJ0BhaIpM_RbcZlBzs,11860
|
|
47
46
|
web3/_utils/formatters.py,sha256=RfRZU0aXC99s6OoLMY7D-fcYJyVAYBEwdbw-JIDjbZE,3067
|
|
48
|
-
web3/_utils/http.py,sha256=
|
|
47
|
+
web3/_utils/http.py,sha256=2R3UOeZmwiQGc3ladf78R9AnufbGaTXAntqf-ZQlZPI,230
|
|
49
48
|
web3/_utils/http_session_manager.py,sha256=Q5K9qJVOAjpO6490McC5kdO4lgjt-c-zxkp0kyDY2pI,11520
|
|
50
49
|
web3/_utils/hypothesis.py,sha256=4Cm4iOWv-uP9irg_Pv63kYNDYUAGhnUH6fOPWRw3A0g,209
|
|
51
50
|
web3/_utils/math.py,sha256=4oU5YdbQBXElxK00CxmUZ94ApXFu9QT_TrO0Kho1HTs,1083
|
|
@@ -54,39 +53,42 @@ web3/_utils/module.py,sha256=GuVePloTlIBZwFDOjg0zasp53HSJ32umxN1nQhqW-8Y,3175
|
|
|
54
53
|
web3/_utils/normalizers.py,sha256=uOaGGgkFXTa5gg6mHgPhP8n035WYpo96xtrvpRPnfNk,7455
|
|
55
54
|
web3/_utils/rpc_abi.py,sha256=ey3rw3j2jC9ybs1FZpyCPReA0Mra7TwRX1a7GTtOPeE,8392
|
|
56
55
|
web3/_utils/threads.py,sha256=hNlSd_zheQYN0vC1faWWb9_UQxp_UzaM2fI5C8y0kB0,4245
|
|
57
|
-
web3/_utils/transactions.py,sha256=
|
|
56
|
+
web3/_utils/transactions.py,sha256=aWMYWiCM_Qs6kFIRWwLGRqAAwCz5fXU8uXcsFGi_Xqo,9044
|
|
58
57
|
web3/_utils/type_conversion.py,sha256=s6cg3WDCQIarQLWw_GfctaJjXhS_EcokUNO-S_ccvng,873
|
|
59
58
|
web3/_utils/utility_methods.py,sha256=7VCpo5ysvPoGjFuDj5gT1Niva2l3BADUvNeJFlL3Yvg,2559
|
|
60
59
|
web3/_utils/validation.py,sha256=TYfkiOIT37zvRy1PqvP9lvbdfLmn1HvlBbHvrFifx1A,6351
|
|
61
60
|
web3/_utils/windows.py,sha256=IlFUtqYSbUUfFRx60zvEwpiZd080WpOrA4ojm4tmSEE,994
|
|
61
|
+
web3/_utils/caching/__init__.py,sha256=ri-5UGz5PPuYW9W1c2BX5lUJn1oZuvErbDz5NweiveA,284
|
|
62
|
+
web3/_utils/caching/caching_utils.py,sha256=LRIbBPIPS2eZGO_vU_yizHhhPlt4y7nC90msddiJcNA,8365
|
|
63
|
+
web3/_utils/caching/request_caching_validation.py,sha256=rwB_PFMRyWyIYu1jiQbr86mNK-zhwyxsPqPrRpb-cnY,4123
|
|
62
64
|
web3/_utils/compat/__init__.py,sha256=RUD0S8wzEv2a9o1UhJD0SIECjzatjJl7vc6RCM2d1Fs,571
|
|
63
65
|
web3/_utils/contract_sources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
66
|
web3/_utils/contract_sources/compile_contracts.py,sha256=C3eLY6gJ4xj9FunNwn4YPb9c8ElORkN8O4ddBa_kKqI,6486
|
|
65
67
|
web3/_utils/contract_sources/contract_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
68
|
web3/_utils/contract_sources/contract_data/_custom_contract_data.py,sha256=nxpN2uS1T338Tp5uVhwY9U1C2m2pdDz7kZv3LoZ0hpo,552
|
|
67
|
-
web3/_utils/contract_sources/contract_data/arrays_contract.py,sha256=
|
|
68
|
-
web3/_utils/contract_sources/contract_data/bytes_contracts.py,sha256=
|
|
69
|
-
web3/_utils/contract_sources/contract_data/constructor_contracts.py,sha256=
|
|
70
|
-
web3/_utils/contract_sources/contract_data/contract_caller_tester.py,sha256=
|
|
71
|
-
web3/_utils/contract_sources/contract_data/emitter_contract.py,sha256=
|
|
72
|
-
web3/_utils/contract_sources/contract_data/event_contracts.py,sha256=
|
|
73
|
-
web3/_utils/contract_sources/contract_data/extended_resolver.py,sha256=
|
|
74
|
-
web3/_utils/contract_sources/contract_data/fallback_function_contract.py,sha256=
|
|
75
|
-
web3/_utils/contract_sources/contract_data/function_name_tester_contract.py,sha256=
|
|
76
|
-
web3/_utils/contract_sources/contract_data/math_contract.py,sha256=
|
|
77
|
-
web3/_utils/contract_sources/contract_data/offchain_lookup.py,sha256=
|
|
78
|
-
web3/_utils/contract_sources/contract_data/offchain_resolver.py,sha256=
|
|
79
|
-
web3/_utils/contract_sources/contract_data/panic_errors_contract.py,sha256=
|
|
80
|
-
web3/_utils/contract_sources/contract_data/payable_tester.py,sha256=
|
|
81
|
-
web3/_utils/contract_sources/contract_data/receive_function_contracts.py,sha256=
|
|
82
|
-
web3/_utils/contract_sources/contract_data/reflector_contracts.py,sha256=
|
|
83
|
-
web3/_utils/contract_sources/contract_data/revert_contract.py,sha256=
|
|
84
|
-
web3/_utils/contract_sources/contract_data/simple_resolver.py,sha256=
|
|
85
|
-
web3/_utils/contract_sources/contract_data/storage_contract.py,sha256=
|
|
86
|
-
web3/_utils/contract_sources/contract_data/string_contract.py,sha256=
|
|
87
|
-
web3/_utils/contract_sources/contract_data/tuple_contracts.py,sha256=
|
|
69
|
+
web3/_utils/contract_sources/contract_data/arrays_contract.py,sha256=2l6vZvudUnM9W-vB2ihKpz4cnjbRv6BBXZ6vXHSEGV0,18626
|
|
70
|
+
web3/_utils/contract_sources/contract_data/bytes_contracts.py,sha256=IZrTiZWzzslzI6NPDkDVWNGk8VeaqcHXr_ACdGaWufQ,14351
|
|
71
|
+
web3/_utils/contract_sources/contract_data/constructor_contracts.py,sha256=GI3LaXX-VfTPk2XgHXfE6Z-tlF_4UakTgStrHXvPsPg,6051
|
|
72
|
+
web3/_utils/contract_sources/contract_data/contract_caller_tester.py,sha256=E2T3OyaOxXuhX_8KLpo7WAQwpvMVdZ6niQdfmxPLICs,6228
|
|
73
|
+
web3/_utils/contract_sources/contract_data/emitter_contract.py,sha256=Kr1JQKkXQJWEfvE4VnPJ2MU4txu1pKetLrRCtp8cmOw,40861
|
|
74
|
+
web3/_utils/contract_sources/contract_data/event_contracts.py,sha256=fTUmOnmJrZagSbNHU8rAi9OKMzkdPy3F4YzCq3rpeGg,5569
|
|
75
|
+
web3/_utils/contract_sources/contract_data/extended_resolver.py,sha256=tY1mcWTI2aaCKHLCMg-dkRKnKRsZAzPoNEHBDlDX514,15720
|
|
76
|
+
web3/_utils/contract_sources/contract_data/fallback_function_contract.py,sha256=1weuAAyUYH_loLlTiC-R3CsodsI95k5Dn5NJqGlI8qQ,1649
|
|
77
|
+
web3/_utils/contract_sources/contract_data/function_name_tester_contract.py,sha256=qQwJK54vprpBapkWqPfBI3YXpdfDtI9W73b04x19IkU,1894
|
|
78
|
+
web3/_utils/contract_sources/contract_data/math_contract.py,sha256=7KoMC9ppWjn0h1Rw5gb-oo65pul6Ar_KmY24_eYcPAs,7635
|
|
79
|
+
web3/_utils/contract_sources/contract_data/offchain_lookup.py,sha256=5XYgMSwlyW-ep41slxpcs2bz2-gdKrCO8KTKoKpWIZ4,16440
|
|
80
|
+
web3/_utils/contract_sources/contract_data/offchain_resolver.py,sha256=O_Xl5rfnRXGaOy5TXK25Ch-r7JhA4n-jYAsQi-EPKGI,31829
|
|
81
|
+
web3/_utils/contract_sources/contract_data/panic_errors_contract.py,sha256=tOLQHKGuD0pgJC9lC_94DEbf0ERxYsxMeRgugMDI4Ic,15263
|
|
82
|
+
web3/_utils/contract_sources/contract_data/payable_tester.py,sha256=0LWImIizIiiX8c6x-A8NOsov_837RD8WUzfJ-RybaoA,1827
|
|
83
|
+
web3/_utils/contract_sources/contract_data/receive_function_contracts.py,sha256=OXZBw7qk8QW23QzeceojhNPSLWT_v_z7_r3QM4mRetg,17102
|
|
84
|
+
web3/_utils/contract_sources/contract_data/reflector_contracts.py,sha256=15IMxkKJnK2w3vwA3nUXrfmrJnJvxuXbTXAFgKNUilk,5262
|
|
85
|
+
web3/_utils/contract_sources/contract_data/revert_contract.py,sha256=pBc6TVknT5_a70gRyZTyM0n07igmtbTZluZVRI92Nw0,4262
|
|
86
|
+
web3/_utils/contract_sources/contract_data/simple_resolver.py,sha256=czfP4CxBwPOnklZzEEa6Ylw3oRxArBJvewua4hpvAxA,3553
|
|
87
|
+
web3/_utils/contract_sources/contract_data/storage_contract.py,sha256=VrIyFZ6gPp_pGSpWQ0gMLtFwfim_ps4jVCr1he_YXOE,7938
|
|
88
|
+
web3/_utils/contract_sources/contract_data/string_contract.py,sha256=wuNXF7O6Y_FP178b5YeBSZdBwrDGJdrv43GxtHs2AMA,11228
|
|
89
|
+
web3/_utils/contract_sources/contract_data/tuple_contracts.py,sha256=wy_blOQtNL6ipn-sxDGhi5MgUQW7s_8JW5DkcMeQdbk,23176
|
|
88
90
|
web3/_utils/module_testing/__init__.py,sha256=tPFAaX7xOR50CPTq24UeY-1CX1LQxxmEOPr0-tIRkoE,376
|
|
89
|
-
web3/_utils/module_testing/eth_module.py,sha256=
|
|
91
|
+
web3/_utils/module_testing/eth_module.py,sha256=D8frcppmzxzug5TYkzP7m-QW_SoLa9xHq2fJT9WWSJE,187685
|
|
90
92
|
web3/_utils/module_testing/go_ethereum_admin_module.py,sha256=_c-6SyzZkfAJ-7ySXUpw9FEr4cg-ShRdAGSAHWanCtY,3406
|
|
91
93
|
web3/_utils/module_testing/go_ethereum_txpool_module.py,sha256=5f8XL8-2x3keyGRaITxMQYl9oQzjgqGn8zobB-j9BPs,1176
|
|
92
94
|
web3/_utils/module_testing/module_testing_utils.py,sha256=koDvLoR5q8wFOz_8o9oRpEpjbuvU8cUbBe1PM39LjG0,7304
|
|
@@ -122,13 +124,13 @@ web3/middleware/gas_price_strategy.py,sha256=ZjZ6pe3z0mDGLZHYoFXp4_fZIePqukljEh9
|
|
|
122
124
|
web3/middleware/names.py,sha256=OBpsvCmcTItth4TcvUNUvcYmINnudtCHq3n6YO_BkNs,4309
|
|
123
125
|
web3/middleware/proof_of_authority.py,sha256=0AT4jr5CmTdrvl8Jiy-WYy8IFDYBOEaesgHDwpn0c7M,1429
|
|
124
126
|
web3/middleware/pythonic.py,sha256=awc8I6lLzVc2Iv138sps2uf6dMQipskLRBTdvTEEIgQ,348
|
|
125
|
-
web3/middleware/signing.py,sha256=
|
|
127
|
+
web3/middleware/signing.py,sha256=1DOYxpmCra-Qq5r42237q3b54uDO-QHjMVMulxVpLVQ,5899
|
|
126
128
|
web3/middleware/stalecheck.py,sha256=oWRA69BGIbNGjHSnUVOBnoxOYJZYjzRzlqqL5RRlnzk,2680
|
|
127
129
|
web3/middleware/validation.py,sha256=QxActrJk_zsXXiwpadP2MUjZBS5E50OJOtUwVrm9XVo,4280
|
|
128
130
|
web3/providers/__init__.py,sha256=YkcSzE9AubvSp-UfvJjyCrdepvziysbqeq2LT0ImDoc,936
|
|
129
|
-
web3/providers/async_base.py,sha256=
|
|
131
|
+
web3/providers/async_base.py,sha256=GXuIkY9ePp5bSJjfRobBN6PWaCSkazm8oi8DTOuEM0c,7401
|
|
130
132
|
web3/providers/auto.py,sha256=Zx3CHKoRkmiw3Jte2BLNPiJAFd8rDXNGfA3XtxZvHgc,3465
|
|
131
|
-
web3/providers/base.py,sha256=
|
|
133
|
+
web3/providers/base.py,sha256=uFJnqTJal3z8_xpwjj5fVxQrULVo1jtpruKXF09blG0,6431
|
|
132
134
|
web3/providers/ipc.py,sha256=wvC8Eq6OZ65ctpUAn9SvoBCLR_x-Hgur390_b3AU100,6355
|
|
133
135
|
web3/providers/legacy_websocket.py,sha256=6mFEQVlVoc71AyDvPGGt3KQudQKdMxoHvokg6Fb4VOw,4767
|
|
134
136
|
web3/providers/eth_tester/__init__.py,sha256=UggyBQdeAyjy1awATW1933jkJcpqqaUYUQEFAQnA2o0,163
|
|
@@ -136,34 +138,29 @@ web3/providers/eth_tester/defaults.py,sha256=9aPe0x2C5wahdGI_rZjiGR3Fe2LbMjKWH9o
|
|
|
136
138
|
web3/providers/eth_tester/main.py,sha256=U19sNDeHs36A4IYQ0HFGyXdZvuXiYvoSMNWVuki0WwI,7807
|
|
137
139
|
web3/providers/eth_tester/middleware.py,sha256=3h8q1WBu5CLiBYwonWFeAR_5pUy_vqgiDmi7wOzuorc,12971
|
|
138
140
|
web3/providers/persistent/__init__.py,sha256=X7tFKJL5BXSwciq5_bRwGRB6bfdWBkIPPWMqCjXIKrA,411
|
|
139
|
-
web3/providers/persistent/async_ipc.py,sha256=
|
|
141
|
+
web3/providers/persistent/async_ipc.py,sha256=8xEqsXMigLSFwRGMK_oDieKjRLNykhy1z8ZLUe1fdWg,4858
|
|
140
142
|
web3/providers/persistent/persistent.py,sha256=8dezjPWoabZ6Wk47t7BRAksj3eAGeQnmpiZ6XafcnqQ,11344
|
|
141
143
|
web3/providers/persistent/persistent_connection.py,sha256=RCoYNobRE9IMtxhByT0gTNby4eFqAOEDAqYzphtHNB8,2683
|
|
142
144
|
web3/providers/persistent/request_processor.py,sha256=E1jJwsvrPBTbufCy2LeNvMdRXf1H-Iz5WTsqyFvPGc0,14504
|
|
143
145
|
web3/providers/persistent/utils.py,sha256=gfY7w1HB8xuE7OujSrbwWYjQuQ8nzRBoxoL8ESinqWM,1140
|
|
144
146
|
web3/providers/persistent/websocket.py,sha256=2EuBOdkEBTp6ge53UlJbjV0eAUJ143TkmqrOLTQl9kk,4231
|
|
145
147
|
web3/providers/rpc/__init__.py,sha256=mObsuwjr7xyHnnRlwzsmbp2JgZdn2NXSSctvpye4AuQ,149
|
|
146
|
-
web3/providers/rpc/async_rpc.py,sha256=
|
|
147
|
-
web3/providers/rpc/rpc.py,sha256=
|
|
148
|
+
web3/providers/rpc/async_rpc.py,sha256=fRZh36q735OI7HFt_QsueFC4zgSSkm3MsYMh9C4b3ds,5824
|
|
149
|
+
web3/providers/rpc/rpc.py,sha256=9_ju2UZX3Ew2HhmyRWnXGhRW9NTvW0roFQ9BI2JzuI0,5866
|
|
148
150
|
web3/providers/rpc/utils.py,sha256=_mtoZMMIoZpPA8J8U5DfRxaNQmi8bw0ZVUiqn1Nz4co,2154
|
|
149
151
|
web3/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
150
152
|
web3/scripts/install_pre_releases.py,sha256=uVxsZk239640yxiqlPhfXxZKSsh3858pURKppi9kM5U,821
|
|
151
153
|
web3/scripts/parse_pygeth_version.py,sha256=BZjWOsJmYuFbAnFuB1jec9Rl6z0tJJNFFV38sJvDfGo,416
|
|
152
154
|
web3/scripts/release/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
153
155
|
web3/scripts/release/test_package.py,sha256=DH0AryllcF4zfpWSd0NLPSQGHNoC-Qng5WYYbS5_4c8,1534
|
|
154
|
-
web3/
|
|
155
|
-
web3/tools/benchmark/main.py,sha256=9nBC8yvdiNPoRuNlcqKC6HKWly_iwOYSeG0cOQCjfpg,5810
|
|
156
|
-
web3/tools/benchmark/node.py,sha256=n73GckmBKLm4_urC7HfF_Z3ZURffNMjq6ymzb9HM9c8,3252
|
|
157
|
-
web3/tools/benchmark/reporting.py,sha256=G2bj_Eo2kBV06GARDYK9zr0VqesiR0_5JLKvhAo6zRM,912
|
|
158
|
-
web3/tools/benchmark/utils.py,sha256=7OOdUD71AVWi0cowAE9ekMgqlfcJwk3vrNnMCHtiGdU,1696
|
|
159
|
-
web3/utils/__init__.py,sha256=XwpyVR4EBkfqV5SHBH3maNyNBy624EwqujRgetLc7PU,1781
|
|
156
|
+
web3/utils/__init__.py,sha256=zwf8bM-Dl2_L9u_cR5K22_krl0vx4QBAANoBssmbDlU,1857
|
|
160
157
|
web3/utils/abi.py,sha256=iSBaCW41UxB1q1UHDPwJ1QJbdiuYmTWNu8m6E28DqlY,18672
|
|
161
158
|
web3/utils/address.py,sha256=KC_IpEbixSCuMhaW6V2QCyyJTYKYGS9c8QtI9_aH7zQ,967
|
|
162
159
|
web3/utils/async_exception_handling.py,sha256=GZWSBFC0-Wmwz1tpTie-1AKRbIQH7JkmBpf5bXrUTzY,3320
|
|
163
|
-
web3/utils/caching.py,sha256=
|
|
160
|
+
web3/utils/caching.py,sha256=Rkt5IN8A7YBZYXlCRaWa64FiDhTXsxzTGGQdGBB4Nzw,2514
|
|
164
161
|
web3/utils/exception_handling.py,sha256=k31JROfUyKIm9PoEWOtYSkIq9wL8SOBwQfnSLNQyfnM,3097
|
|
165
|
-
web3-7.
|
|
166
|
-
web3-7.
|
|
167
|
-
web3-7.
|
|
168
|
-
web3-7.
|
|
169
|
-
web3-7.
|
|
162
|
+
web3-7.3.0.dist-info/LICENSE,sha256=ScEyLx1vWrB0ybKiZKKTXm5QhVksHCEUtTp4lwYV45I,1095
|
|
163
|
+
web3-7.3.0.dist-info/METADATA,sha256=rUvDeXl5wdquUWhIzLbAv0Vnd4HT5xwh1v-FSe1typY,5317
|
|
164
|
+
web3-7.3.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
165
|
+
web3-7.3.0.dist-info/top_level.txt,sha256=iwupuJh7wgypXrpk_awszyri3TahRr5vxSphNyvt1bU,9
|
|
166
|
+
web3-7.3.0.dist-info/RECORD,,
|
web3/tools/benchmark/__init__.py
DELETED
|
File without changes
|
web3/tools/benchmark/main.py
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
import asyncio
|
|
3
|
-
from collections import (
|
|
4
|
-
defaultdict,
|
|
5
|
-
)
|
|
6
|
-
import logging
|
|
7
|
-
import sys
|
|
8
|
-
import timeit
|
|
9
|
-
from typing import (
|
|
10
|
-
Any,
|
|
11
|
-
Callable,
|
|
12
|
-
Dict,
|
|
13
|
-
Union,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
from web3 import (
|
|
17
|
-
AsyncHTTPProvider,
|
|
18
|
-
AsyncWeb3,
|
|
19
|
-
HTTPProvider,
|
|
20
|
-
Web3,
|
|
21
|
-
)
|
|
22
|
-
from web3.middleware import (
|
|
23
|
-
BufferedGasEstimateMiddleware,
|
|
24
|
-
GasPriceStrategyMiddleware,
|
|
25
|
-
)
|
|
26
|
-
from web3.tools.benchmark.node import (
|
|
27
|
-
GethBenchmarkFixture,
|
|
28
|
-
)
|
|
29
|
-
from web3.tools.benchmark.reporting import (
|
|
30
|
-
print_entry,
|
|
31
|
-
print_footer,
|
|
32
|
-
print_header,
|
|
33
|
-
)
|
|
34
|
-
from web3.tools.benchmark.utils import (
|
|
35
|
-
wait_for_aiohttp,
|
|
36
|
-
wait_for_http,
|
|
37
|
-
)
|
|
38
|
-
from web3.types import (
|
|
39
|
-
Wei,
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
KEYFILE_PW = "web3py-test"
|
|
43
|
-
|
|
44
|
-
parser = argparse.ArgumentParser()
|
|
45
|
-
parser.add_argument(
|
|
46
|
-
"--num-calls",
|
|
47
|
-
type=int,
|
|
48
|
-
default=10,
|
|
49
|
-
help="The number of RPC calls to make",
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
# TODO - layers to test:
|
|
53
|
-
# contract.functions.method(...).call()
|
|
54
|
-
# w3.eth.call(...)
|
|
55
|
-
# HTTPProvider.make_request(...)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def build_web3_http(endpoint_uri: str) -> Web3:
|
|
59
|
-
wait_for_http(endpoint_uri)
|
|
60
|
-
_w3 = Web3(
|
|
61
|
-
HTTPProvider(endpoint_uri),
|
|
62
|
-
middleware=[GasPriceStrategyMiddleware, BufferedGasEstimateMiddleware],
|
|
63
|
-
)
|
|
64
|
-
return _w3
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
async def build_async_w3_http(endpoint_uri: str) -> AsyncWeb3:
|
|
68
|
-
await wait_for_aiohttp(endpoint_uri)
|
|
69
|
-
_w3 = AsyncWeb3(
|
|
70
|
-
AsyncHTTPProvider(endpoint_uri),
|
|
71
|
-
middleware=[GasPriceStrategyMiddleware, BufferedGasEstimateMiddleware],
|
|
72
|
-
)
|
|
73
|
-
return _w3
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def sync_benchmark(func: Callable[..., Any], n: int) -> Union[float, str]:
|
|
77
|
-
try:
|
|
78
|
-
starttime = timeit.default_timer()
|
|
79
|
-
for _ in range(n):
|
|
80
|
-
func()
|
|
81
|
-
endtime = timeit.default_timer()
|
|
82
|
-
execution_time = endtime - starttime
|
|
83
|
-
return execution_time
|
|
84
|
-
except Exception:
|
|
85
|
-
return "N/A"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
async def async_benchmark(func: Callable[..., Any], n: int) -> Union[float, str]:
|
|
89
|
-
try:
|
|
90
|
-
starttime = timeit.default_timer()
|
|
91
|
-
for result in asyncio.as_completed([func() for _ in range(n)]):
|
|
92
|
-
await result
|
|
93
|
-
execution_time = timeit.default_timer() - starttime
|
|
94
|
-
return execution_time
|
|
95
|
-
except Exception:
|
|
96
|
-
return "N/A"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def main(logger: logging.Logger, num_calls: int) -> None:
|
|
100
|
-
fixture = GethBenchmarkFixture()
|
|
101
|
-
for built_fixture in fixture.build():
|
|
102
|
-
for _ in built_fixture:
|
|
103
|
-
w3_http = build_web3_http(fixture.endpoint_uri)
|
|
104
|
-
try:
|
|
105
|
-
loop = asyncio.get_running_loop()
|
|
106
|
-
except RuntimeError:
|
|
107
|
-
loop = asyncio.new_event_loop()
|
|
108
|
-
asyncio.set_event_loop(loop)
|
|
109
|
-
|
|
110
|
-
# -- sync -- #
|
|
111
|
-
account = w3_http.eth.accounts[0]
|
|
112
|
-
|
|
113
|
-
# -- async -- #
|
|
114
|
-
async_w3_http = loop.run_until_complete(
|
|
115
|
-
build_async_w3_http(fixture.endpoint_uri)
|
|
116
|
-
)
|
|
117
|
-
async_accounts = loop.run_until_complete(async_w3_http.eth.accounts)
|
|
118
|
-
async_account = async_accounts[0]
|
|
119
|
-
|
|
120
|
-
methods = [
|
|
121
|
-
{
|
|
122
|
-
"name": "eth_gasPrice",
|
|
123
|
-
"params": {},
|
|
124
|
-
"exec": lambda w3_http=w3_http: w3_http.eth.gas_price,
|
|
125
|
-
"async_exec": lambda async_w3_http=async_w3_http: async_w3_http.eth.gas_price, # noqa: E501
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"name": "eth_sendTransaction",
|
|
129
|
-
"params": {},
|
|
130
|
-
"exec": lambda w3_http=w3_http, account=account: w3_http.eth.send_transaction( # noqa: E501
|
|
131
|
-
{
|
|
132
|
-
"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
|
|
133
|
-
"from": account,
|
|
134
|
-
"value": Wei(1),
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
"async_exec": lambda async_w3_http=async_w3_http, async_account=async_account: async_w3_http.eth.send_transaction( # noqa: E501
|
|
138
|
-
{
|
|
139
|
-
"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
|
|
140
|
-
"from": async_account,
|
|
141
|
-
"value": Wei(1),
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"name": "eth_blockNumber",
|
|
147
|
-
"params": {},
|
|
148
|
-
"exec": lambda w3_http=w3_http: w3_http.eth.block_number,
|
|
149
|
-
"async_exec": lambda async_w3_http=async_w3_http: async_w3_http.eth.block_number, # noqa: E501
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"name": "eth_getBlock",
|
|
153
|
-
"params": {},
|
|
154
|
-
"exec": lambda w3_http=w3_http: w3_http.eth.get_block(1),
|
|
155
|
-
"async_exec": lambda async_w3_http=async_w3_http: async_w3_http.eth.get_block( # noqa: E501
|
|
156
|
-
1
|
|
157
|
-
),
|
|
158
|
-
},
|
|
159
|
-
]
|
|
160
|
-
|
|
161
|
-
def benchmark(
|
|
162
|
-
method: Dict[str, Any], loop: asyncio.AbstractEventLoop = loop
|
|
163
|
-
) -> None:
|
|
164
|
-
outcomes: Dict[str, Union[str, float]] = defaultdict(lambda: "N/A")
|
|
165
|
-
outcomes["name"] = method["name"]
|
|
166
|
-
outcomes["HTTPProvider"] = sync_benchmark(
|
|
167
|
-
method["exec"],
|
|
168
|
-
num_calls,
|
|
169
|
-
)
|
|
170
|
-
outcomes["AsyncHTTPProvider"] = loop.run_until_complete(
|
|
171
|
-
async_benchmark(method["async_exec"], num_calls)
|
|
172
|
-
)
|
|
173
|
-
print_entry(logger, outcomes)
|
|
174
|
-
|
|
175
|
-
print_header(logger, num_calls)
|
|
176
|
-
|
|
177
|
-
for method in methods:
|
|
178
|
-
benchmark(method)
|
|
179
|
-
|
|
180
|
-
print_footer(logger)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if __name__ == "__main__":
|
|
184
|
-
args = parser.parse_args()
|
|
185
|
-
|
|
186
|
-
logger = logging.getLogger()
|
|
187
|
-
logger.setLevel(logging.INFO)
|
|
188
|
-
logger.addHandler(logging.StreamHandler(sys.stdout))
|
|
189
|
-
|
|
190
|
-
main(logger, args.num_calls)
|
web3/tools/benchmark/node.py
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import socket
|
|
3
|
-
from subprocess import (
|
|
4
|
-
PIPE,
|
|
5
|
-
Popen,
|
|
6
|
-
check_output,
|
|
7
|
-
)
|
|
8
|
-
from tempfile import (
|
|
9
|
-
TemporaryDirectory,
|
|
10
|
-
)
|
|
11
|
-
from typing import (
|
|
12
|
-
Any,
|
|
13
|
-
Generator,
|
|
14
|
-
Sequence,
|
|
15
|
-
)
|
|
16
|
-
import zipfile
|
|
17
|
-
|
|
18
|
-
from geth.install import (
|
|
19
|
-
get_executable_path,
|
|
20
|
-
install_geth,
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
from web3.tools.benchmark.utils import (
|
|
24
|
-
kill_proc_gracefully,
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
GETH_FIXTURE_ZIP = "geth-1.14.5-fixture.zip"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class GethBenchmarkFixture:
|
|
31
|
-
def __init__(self) -> None:
|
|
32
|
-
self.rpc_port = self._rpc_port()
|
|
33
|
-
self.endpoint_uri = self._endpoint_uri()
|
|
34
|
-
self.geth_binary = self._geth_binary()
|
|
35
|
-
|
|
36
|
-
def build(self) -> Generator[Any, None, None]:
|
|
37
|
-
with TemporaryDirectory() as base_dir:
|
|
38
|
-
zipfile_path = os.path.abspath(
|
|
39
|
-
os.path.join(
|
|
40
|
-
os.path.dirname(__file__),
|
|
41
|
-
"../../../tests/integration/",
|
|
42
|
-
GETH_FIXTURE_ZIP,
|
|
43
|
-
)
|
|
44
|
-
)
|
|
45
|
-
tmp_datadir = os.path.join(str(base_dir), "datadir")
|
|
46
|
-
with zipfile.ZipFile(zipfile_path, "r") as zip_ref:
|
|
47
|
-
zip_ref.extractall(tmp_datadir)
|
|
48
|
-
self.datadir = tmp_datadir
|
|
49
|
-
|
|
50
|
-
genesis_file = os.path.join(self.datadir, "genesis.json")
|
|
51
|
-
|
|
52
|
-
yield self._geth_process(self.datadir, genesis_file, self.rpc_port)
|
|
53
|
-
|
|
54
|
-
def _rpc_port(self) -> str:
|
|
55
|
-
sock = socket.socket()
|
|
56
|
-
sock.bind(("127.0.0.1", 0))
|
|
57
|
-
port = sock.getsockname()[1]
|
|
58
|
-
sock.close()
|
|
59
|
-
return str(port)
|
|
60
|
-
|
|
61
|
-
def _endpoint_uri(self) -> str:
|
|
62
|
-
return f"http://localhost:{self.rpc_port}"
|
|
63
|
-
|
|
64
|
-
def _geth_binary(self) -> str:
|
|
65
|
-
if "GETH_BINARY" in os.environ:
|
|
66
|
-
return os.environ["GETH_BINARY"]
|
|
67
|
-
elif "GETH_VERSION" in os.environ:
|
|
68
|
-
geth_version = os.environ["GETH_VERSION"]
|
|
69
|
-
_geth_binary = get_executable_path(geth_version)
|
|
70
|
-
if not os.path.exists(_geth_binary):
|
|
71
|
-
install_geth(geth_version)
|
|
72
|
-
assert os.path.exists(_geth_binary)
|
|
73
|
-
return _geth_binary
|
|
74
|
-
else:
|
|
75
|
-
return "geth"
|
|
76
|
-
|
|
77
|
-
def _geth_command_arguments(self, datadir: str) -> Sequence[str]:
|
|
78
|
-
return (
|
|
79
|
-
self.geth_binary,
|
|
80
|
-
"--dev",
|
|
81
|
-
"--dev.period",
|
|
82
|
-
"100",
|
|
83
|
-
"--datadir",
|
|
84
|
-
datadir,
|
|
85
|
-
"--nodiscover",
|
|
86
|
-
"--http",
|
|
87
|
-
"--http.port",
|
|
88
|
-
self.rpc_port,
|
|
89
|
-
"--http.api",
|
|
90
|
-
"admin,eth,net,web3",
|
|
91
|
-
"--ipcdisable",
|
|
92
|
-
"--password",
|
|
93
|
-
os.path.join(datadir, "keystore", "pw.txt"),
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
def _geth_process(
|
|
97
|
-
self, datadir: str, genesis_file: str, rpc_port: str
|
|
98
|
-
) -> Generator[Any, None, None]:
|
|
99
|
-
init_datadir_command = (
|
|
100
|
-
self.geth_binary,
|
|
101
|
-
"--datadir",
|
|
102
|
-
str(datadir),
|
|
103
|
-
"init",
|
|
104
|
-
str(genesis_file),
|
|
105
|
-
)
|
|
106
|
-
check_output(
|
|
107
|
-
init_datadir_command,
|
|
108
|
-
stdin=PIPE,
|
|
109
|
-
stderr=PIPE,
|
|
110
|
-
)
|
|
111
|
-
proc = Popen(
|
|
112
|
-
self._geth_command_arguments(datadir),
|
|
113
|
-
stdin=PIPE,
|
|
114
|
-
stdout=PIPE,
|
|
115
|
-
stderr=PIPE,
|
|
116
|
-
)
|
|
117
|
-
try:
|
|
118
|
-
yield proc
|
|
119
|
-
finally:
|
|
120
|
-
kill_proc_gracefully(proc)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from logging import (
|
|
2
|
-
Logger,
|
|
3
|
-
)
|
|
4
|
-
from typing import (
|
|
5
|
-
Any,
|
|
6
|
-
Dict,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def print_header(logger: Logger, num_calls: int) -> None:
|
|
11
|
-
logger.info(
|
|
12
|
-
"|{:^26}|{:^20}|{:^20}|{:^20}|{:^20}|".format(
|
|
13
|
-
f"Method ({num_calls} calls)",
|
|
14
|
-
"HTTPProvider",
|
|
15
|
-
"AsyncHTTProvider",
|
|
16
|
-
"IPCProvider",
|
|
17
|
-
"WebSocketProvider",
|
|
18
|
-
)
|
|
19
|
-
)
|
|
20
|
-
logger.info("-" * 112)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def print_entry(
|
|
24
|
-
logger: Logger,
|
|
25
|
-
method_benchmarks: Dict[str, Any],
|
|
26
|
-
) -> None:
|
|
27
|
-
logger.info(
|
|
28
|
-
"|{:^26}|{:^20.10}|{:^20.10}|{:^20.10}|{:^20.10}|".format(
|
|
29
|
-
method_benchmarks["name"],
|
|
30
|
-
method_benchmarks["HTTPProvider"],
|
|
31
|
-
method_benchmarks["AsyncHTTPProvider"],
|
|
32
|
-
method_benchmarks["IPCProvider"],
|
|
33
|
-
method_benchmarks["WebSocketProvider"],
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def print_footer(logger: Logger) -> None:
|
|
39
|
-
logger.info("-" * 112)
|
web3/tools/benchmark/utils.py
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import signal
|
|
3
|
-
import socket
|
|
4
|
-
import time
|
|
5
|
-
from typing import (
|
|
6
|
-
Any,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
import aiohttp
|
|
10
|
-
import requests
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def wait_for_socket(ipc_path: str, timeout: int = 30) -> None:
|
|
14
|
-
start = time.time()
|
|
15
|
-
while time.time() < start + timeout:
|
|
16
|
-
try:
|
|
17
|
-
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
18
|
-
sock.connect(ipc_path)
|
|
19
|
-
sock.settimeout(timeout)
|
|
20
|
-
except OSError:
|
|
21
|
-
time.sleep(0.01)
|
|
22
|
-
else:
|
|
23
|
-
break
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def wait_for_http(endpoint_uri: str, timeout: int = 60) -> None:
|
|
27
|
-
start = time.time()
|
|
28
|
-
while time.time() < start + timeout:
|
|
29
|
-
try:
|
|
30
|
-
requests.get(endpoint_uri)
|
|
31
|
-
except requests.ConnectionError:
|
|
32
|
-
time.sleep(0.01)
|
|
33
|
-
else:
|
|
34
|
-
break
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
async def wait_for_aiohttp(endpoint_uri: str, timeout: int = 60) -> None:
|
|
38
|
-
start = time.time()
|
|
39
|
-
while time.time() < start + timeout:
|
|
40
|
-
try:
|
|
41
|
-
async with aiohttp.ClientSession() as session:
|
|
42
|
-
await session.get(endpoint_uri)
|
|
43
|
-
except aiohttp.client_exceptions.ClientConnectorError:
|
|
44
|
-
await asyncio.sleep(0.01)
|
|
45
|
-
else:
|
|
46
|
-
break
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def wait_for_popen(proc: Any, timeout: int) -> None:
|
|
50
|
-
start = time.time()
|
|
51
|
-
while time.time() < start + timeout:
|
|
52
|
-
if proc.poll() is None:
|
|
53
|
-
time.sleep(0.01)
|
|
54
|
-
else:
|
|
55
|
-
break
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def kill_proc_gracefully(proc: Any) -> None:
|
|
59
|
-
if proc.poll() is None:
|
|
60
|
-
proc.send_signal(signal.SIGINT)
|
|
61
|
-
wait_for_popen(proc, 13)
|
|
62
|
-
|
|
63
|
-
if proc.poll() is None:
|
|
64
|
-
proc.terminate()
|
|
65
|
-
wait_for_popen(proc, 5)
|
|
66
|
-
|
|
67
|
-
if proc.poll() is None:
|
|
68
|
-
proc.kill()
|
|
69
|
-
wait_for_popen(proc, 2)
|
|
File without changes
|
|
File without changes
|