Skip to content

Conversation

@tibor-reiss
Copy link
Contributor

@tibor-reiss tibor-reiss commented Apr 26, 2025

What was wrong?

Closes #3683

How was it fixed?

Warn users that eth.get_uncle* will be dropped in v8.

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

t18AHHmB

@tibor-reiss tibor-reiss changed the title I3683 deprecate get uncle Deprecate eth.get_uncle* methods Apr 26, 2025
@tibor-reiss tibor-reiss force-pushed the i3683_deprecate_get_uncle branch from e1fe0d6 to 6b6b769 Compare April 26, 2025 09:21
@tibor-reiss
Copy link
Contributor Author

wdyt @kclowes?

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.

Thank you for the PR! There were just a few nits that I left that should be addressed. We'll also need to add the warning to the AsyncEth module as well. Let me know if you want me to pick it up.

self, w3: "Web3", empty_block: BlockData
) -> None:
uncle_count = w3.eth.get_uncle_count(empty_block["hash"])
with pytest.warns(DeprecationWarning):
Copy link
Collaborator

Choose a reason for hiding this comment

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

We like to match on the message for deprecation warnings, so this would just need a match=r"All get_uncle\* methods have been deprecated"

self, w3: "Web3", empty_block: BlockData
) -> None:
uncle_count = w3.eth.get_uncle_count(empty_block["number"])
with pytest.warns(DeprecationWarning):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, add match keyword

@tibor-reiss tibor-reiss force-pushed the i3683_deprecate_get_uncle branch 4 times, most recently from 33c1be1 to 46fb659 Compare April 28, 2025 20:18
@tibor-reiss
Copy link
Contributor Author

Thank you for the PR! There were just a few nits that I left that should be addressed. We'll also need to add the warning to the AsyncEth module as well. Let me know if you want me to pick it up.

Thanks for the feedback. Idk how I missed the async method, my bad. Is the double underscore version ok, or shall I just add the warning into the async function please?

Afais the failing tests are not connected to the change, but let me know if otherwise.

@tibor-reiss tibor-reiss requested a review from kclowes April 28, 2025 20:23
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 the updates! I left a comment on the async methods to give you some direction there. Let me know if that doesn't work, or if this is turning into more work than you signed up for and you want to hand it off!

@tibor-reiss tibor-reiss force-pushed the i3683_deprecate_get_uncle branch from 46fb659 to 6b0d8a7 Compare April 29, 2025 05:50
@kclowes
Copy link
Collaborator

kclowes commented Apr 30, 2025

Actually, I'm looking at this, and I think we can just use the deprecated_for decorator. Sorry for the misdirection. If you want to be fancy, you could update the message so that it makes a little more sense, but I'm also fine if you just do something like: @deprecated_for('nothing').

@tibor-reiss tibor-reiss force-pushed the i3683_deprecate_get_uncle branch 3 times, most recently from 20c62ea to 3d66182 Compare May 1, 2025 07:58
@tibor-reiss tibor-reiss force-pushed the i3683_deprecate_get_uncle branch from 3d66182 to 852ec90 Compare May 1, 2025 08:03
@tibor-reiss
Copy link
Contributor Author

Actually, I'm looking at this, and I think we can just use the deprecated_for decorator. Sorry for the misdirection. If you want to be fancy, you could update the message so that it makes a little more sense, but I'm also fine if you just do something like: @deprecated_for('nothing').

No problem, I have replaced now with deprecated_for.

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.

Looks good to me! Thanks @tibor-reiss!

@kclowes kclowes merged commit 29f0d3b into ethereum:main May 7, 2025
85 checks passed
Copy link

@M66rr M66rr left a comment

Choose a reason for hiding this comment

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

Done ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate get_uncle* endpoints

3 participants