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

feat: port filters to EDR provider #4747

Merged
merged 41 commits into from
Jan 11, 2024
Merged

feat: port filters to EDR provider #4747

merged 41 commits into from
Jan 11, 2024

Conversation

Wodann
Copy link
Member

@Wodann Wodann commented Jan 9, 2024

No description provided.

@Wodann Wodann added the area:edr label Jan 9, 2024
@Wodann Wodann self-assigned this Jan 9, 2024
Copy link

changeset-bot bot commented Jan 9, 2024

⚠️ No Changeset found

Latest commit: 10606d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2024 8:08pm

@Wodann Wodann changed the title Edr/feat/filters feat: port filters to EDR provider Jan 9, 2024
@Wodann Wodann marked this pull request as ready for review January 10, 2024 19:59
@Wodann Wodann requested a review from agostbiro January 10, 2024 19:59
Copy link
Member

@agostbiro agostbiro left a comment

Choose a reason for hiding this comment

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

Thanks, Rust part LGTM! There is just one small thing that we could potentially improve where I left a comment, but feel free to merge without it as it was there prior.

CacheableLogFilterRange::Hash(_) => Some(Self::finalize(hasher)),
CacheableLogFilterRange::Range { to_block, .. } => {
// TODO should we check that to < from?
Self::needs_safety_check(hasher, to_block)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what's the expected behavior if to < from, but to be safe, we could potentially check the safety of the max of to and from. Wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

For Alchemy, if to < from, you get this error:

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found."}}

so using the maximum of those two wouldn't resolve the issue, I think. We might just have to prohibit caching if this occurs?

@agostbiro
Copy link
Member

Sorry, one more thing: I think the websocket tests should be passing now as well, could you try to enable them and fix any potential issues?

@Wodann
Copy link
Member Author

Wodann commented Jan 11, 2024

Sorry, one more thing: I think the websocket tests should be passing now as well, could you try to enable them and fix any potential issues?

The "plain websocket" tests indeed work now, but the ethers.WebSocketProvider tests don't yet. I'll leave this for a separate task, if you don't mind.

@fvictorio can you shine some light on how we'd want to implement ethers.WebSocketProvider in this case?

@Wodann Wodann merged commit e1fbd84 into edr/main Jan 11, 2024
67 of 70 checks passed
@Wodann Wodann deleted the edr/feat/filters branch January 11, 2024 20:07
@Wodann Wodann linked an issue Jan 12, 2024 that may be closed by this pull request
5 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port Hardhat Node filters
3 participants