Skip to content
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

Deprecate Geth miner namespace #2857

Closed
wants to merge 84 commits into from
Closed

Conversation

e3243eric
Copy link
Contributor

@e3243eric e3243eric commented Mar 2, 2023

What was wrong?

Closes #2856

Geth removed support for their miner API.

How was it fixed?

Change GethMiner methods to DeprecatedMethod.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@e3243eric
Copy link
Contributor Author

e3243eric commented Mar 2, 2023

I'm wondering why the tests in tests/core/mining-module are always skipped.

@kclowes
Copy link
Collaborator

kclowes commented Mar 6, 2023

Thank you!

I'm wondering why the tests in tests/core/mining-module are always skipped.

The core tests run with the eth-tester provider which doesn't have mining implemented.

I'm hoping I'll be able to review this later in the week!

@e3243eric e3243eric force-pushed the geth-miner branch 3 times, most recently from dd72dd6 to 67425f3 Compare March 13, 2023 13:51
Copy link
Contributor

@reedsa reedsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit about the newsfragment filename, otherwise lgtm! @kclowes do you have any feedback here?

newsfragments/2857.removal.rst Outdated Show resolved Hide resolved
tests/core/mining-module/test_miner_start.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviving this PR, @reedsa!

@e3243eric I made a comment around the messaging in the DeprecatedMethod class, let me know what you think. I'm happy to make that update if you don't want/have time to, just let me know!

Thanks for taking it on!

web3/_utils/miner.py Outdated Show resolved Hide resolved
fselmo added 22 commits January 18, 2024 16:57
- Refactor middlewares as classes with request processors and response processors
- Apply this refactor to some existing middlewares and test
  - gas_price_strategy_middleware
  - validation / formatting middleware
  - attrdict_middleware
  - (incomplete) ens_name_to_address_middleware
- Refactor the exception_retry_middleware to be a configuration on the http providers
- Remove all caching middleware.
- Refactor request caching via configurations on the provider classes and decorators on their respective ``make_request()`` methods.
- This middleware depends on a request always being made when middleware are processed. This isn't how the middleware is processed for websockets and the separation of middleware into request param processing and response processing further helps with being able to support batch requests. Remove all middleware that were dependent on a request always being sandwiched between request processing and response processing.
- Add a ``RequestMocker`` class with ``request_mocker`` pytest fixture to fascilitate request mocking now that the middleware doesn't sequester the ``make_request()`` call. Since we can't swap the ``make_request()`` on the fly, mock results and errors using this test utility class.
- Linting
- Some cleanup along the way
- In the middleware refactor, we weren't accounting for manipulating the ``method``, only the params. Allow for this kind of manipulation as it is necessary for ``sign_and_send_raw_middleware``, for example.
…leware class

- Use a repr() for the middleware onion name when a non-hashable, such as the curried `build` method on a web3middlewarebuilder is used.
- Add support back for ``local_filter_middleware`` by overriding the ``_wrap_make_request()`` of the base middleware class. If this method is overridden, the ``make_request`` can be effectively replaced if a request is not needed.
- closes ethereum#2995
- ``ens_name_to_address_middleware`` would return the ``bytes`` address, rather than checksummed address. Since this happens after the ``request_formatters`` have been applied, this would override the results from the ``ABI_REQUEST_FORMATTERS`` which take ``address`` types and format them to a checksummed hex address.
…ware

- Use request_mocker where we can
- result_processors take care of the formatting... this was causing the ``None`` value for logsBloom to raise when mocked
- The middleware changed names in the refactor, but this commit puts the finishing touches and closes ethereum#899
- Make request caching more robust by re-introducing the lock from the middleware as well as checking for "error" and None responses and not caching those.
- Re-introduce the tests for the simple_cache_middleware as caching utils tests.

[Unrelated]

- Keep the decorator logic on ``make_request`` when using the ``request_mocker`` fixture so we can still utilized the request mocker for testing cached requests.
fselmo and others added 9 commits February 7, 2024 10:50
- Add formatters for "blobGasUsed", "excessBlobGas", and "parentBeaconBlockRoot"
- Add fields to block api tests
- State overrid is used in more requests than just ``eth_call``.
  We should use a more generic name that suits this type more.
  ``StateOverride`` seems the most appropriate here.
….blockNumber` (ethereum#3228)

* Sort events by logIndex

* Test for contract event logs to ensure sort order

* Add doc for get_logs sort order

* Update sort by block number and log index

* newsfragment for ethereum#3228
* Rename fixture file, updates to circle config

* Add newsfragment
@reedsa reedsa force-pushed the geth-miner branch 4 times, most recently from a275217 to 915bcc1 Compare February 20, 2024 22:12
@reedsa reedsa requested review from fselmo, pacrob and kclowes February 20, 2024 22:25
Copy link
Contributor

@pacrob pacrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! - but should be to v6, removed for v7, yes?

@fselmo
Copy link
Collaborator

fselmo commented Feb 21, 2024

lgtm! - but should be to v6, removed for v7, yes?

Yep, along with #3236, this should close it all out

@fselmo fselmo changed the base branch from main to v6 February 21, 2024 20:24
@fselmo fselmo added the deprecate in v6 Deprecations that need to be made in v6 branch and are set to be removed in the v7 branch label Feb 21, 2024
@reedsa
Copy link
Contributor

reedsa commented Feb 21, 2024

Rebased this against main by mistake, closing in favor of #3238

@reedsa reedsa closed this Feb 21, 2024
reedsa added a commit to reedsa/web3.py that referenced this pull request Feb 21, 2024
reedsa added a commit to reedsa/web3.py that referenced this pull request Mar 4, 2024
reedsa added a commit that referenced this pull request Mar 4, 2024
* Deprecate Geth miner namespace

* `DeprecatedMethod` class takes `msg` kwarg for custom warnings

* Remove warn check from geth fixture generation script

* Refactor DeprecatedMethod.__get__ warning

* Newsfragment for #2857

---------

Co-authored-by: e3243eric <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecate in v6 Deprecations that need to be made in v6 branch and are set to be removed in the v7 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate miner namespace support and tests
7 participants