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: pending logs subscription #6108

Closed
wants to merge 15 commits into from

Conversation

allnil
Copy link
Contributor

@allnil allnil commented Jan 17, 2024

draft for pending logs subscription #5617

@allnil allnil marked this pull request as draft January 17, 2024 20:58
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this is exactly what we want yes.

Atm this would only support the pending block received by the engine.

I believe we also want to support the locally built pending block by EthApi
what we can do here is to also add a watch channel and set the new pending block there:

https://github.com/paradigmxyz/reth/blob/main/crates/rpc/rpc/src/eth/api/mod.rs#L339-L342

then we can a new wrapper type that combines both watchers, the from the CL and the local one

crates/rpc/rpc/src/eth/pubsub.rs Show resolved Hide resolved
crates/storage/provider/src/traits/chain.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/pubsub.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/pubsub.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

okay, overall this is pretty close to the functionality we want,

with watch channels and on demand receivers, there's no need to create them outside the struct that's holding the sender, because new receivers can be created on demand, so we want this to happen inside the new function instead.

struct A {watch::Sender}

impl A {

fn new() {
  Self {watch::channel()}
}

fn listener(&self) -> Receiver {
  self.watcher.subscribe()
}

}

crates/rpc/rpc-builder/src/auth.rs Outdated Show resolved Hide resolved
crates/rpc/rpc-builder/src/lib.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
@mattsse mattsse marked this pull request as ready for review January 22, 2024 22:20
@mattsse mattsse requested a review from onbjerg as a code owner January 22, 2024 22:20
@allnil allnil requested a review from mattsse January 30, 2024 18:27
@mattsse
Copy link
Collaborator

mattsse commented Feb 1, 2024

this is great!

this is now blocked by #6104

@mattsse mattsse added S-blocked This cannot more forward until something else changes A-rpc Related to the RPC implementation labels Feb 1, 2024
@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Mar 3, 2024
@github-actions github-actions bot closed this Mar 11, 2024
@mattsse mattsse reopened this Mar 11, 2024
@mattsse mattsse requested a review from shekhirin as a code owner March 11, 2024 03:21
@mattsse mattsse added M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Mar 11, 2024
@gakonst gakonst requested a review from emhane as a code owner July 30, 2024 00:45
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

sorry, this went stale but with the current design this is slightly difficult, we can solve this much easier now

@mattsse mattsse closed this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity S-blocked This cannot more forward until something else changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants