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

Support PendingLogsSubscription in eth_subscribe #5617

Open
1 task done
deromik opened this issue Nov 28, 2023 · 8 comments
Open
1 task done

Support PendingLogsSubscription in eth_subscribe #5617

deromik opened this issue Nov 28, 2023 · 8 comments
Assignees
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior

Comments

@deromik
Copy link

deromik commented Nov 28, 2023

Describe the bug

i use the following request to subscribe

{ "id": 1, "jsonrpc": "2.0", "method": "eth_subscribe", "params": [ "logs", { "fromBlock": "pending", "toBlock": "pending", "topics": [], "address": [] } ] }

and it does not return logs during ongoing pending block, this subscription will send the logs back at once only when the block is mined and the data is from latest which is not exactly what i have subscribed on.

#3404 #3320 related

tried on alpha 11 and latest develop

Steps to reproduce

no specific steps to reproduce

Node logs

No response

Platform(s)

Linux (x86)

What version/commit are you on?

ae6f1e3

What database version are you on?

Current database version: 1
Local database version: 1

What type of node are you running?

Full via --full flag

What prune config do you use, if any?

No response

If you've built Reth from source, provide the full command you used

dockerfile from repo built on linux machine

Code of Conduct

  • I agree to follow the Code of Conduct
@deromik deromik added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Nov 28, 2023
@mattsse
Copy link
Collaborator

mattsse commented Nov 28, 2023

which pending block? locally built block or from CL?

@mattsse mattsse changed the title eth_subscribe logs does not return logs during pending block Support PendingLogsSubscription in eth_subscribe Nov 28, 2023
@deromik
Copy link
Author

deromik commented Nov 28, 2023

which pending block? locally built block or from CL?

from CL if i understood you correctly
im running prysmaticlabs/prysm-beacon-chain:v4.0.8

@mattsse
Copy link
Collaborator

mattsse commented Nov 28, 2023

makes sense, need to figure out how to do it

@mattsse mattsse self-assigned this Nov 28, 2023
@mattsse
Copy link
Collaborator

mattsse commented Nov 28, 2023

@deromik do you know how this behaves exactly?

does this resend logs for the same block.number if there's an alternative pending block, or only one update per block.number?

@deromik
Copy link
Author

deromik commented Nov 28, 2023

@deromik do you know how this behaves exactly?

does this resend logs for the same block.number if there's an alternative pending block, or only one update per block.number?

one update with logs from latest block (at this moment it already became latest) in the beginning of the block

something like this

block #1
logs: 0 ->
...
subscribe <-
...
block #1
logs: 0 ->
...
-> new block
block #2
logs: 20 (all logs from block #1) ->
...
block #2
logs: 0 ->
...
block #2
logs: 0 ->

@mattsse
Copy link
Collaborator

mattsse commented Dec 10, 2023

one update with logs from latest block (at this moment it already became latest) in the beginning of the block

sorry I don't understand.

I'm also having trouble understanding the example.

the pending block might change throughout the 12s, so unclear how this is reflected in an active subscription that only targets the pending tag.

For example, let's say there's pending Block A that includes Tx_1 that emits a matching Log which we then send as a new subscription event.
what happens if there's an alternative Block B that includes the same Tx_1 and Log?

@DaniPopes DaniPopes added A-rpc Related to the RPC implementation and removed S-needs-triage This issue needs to be labelled labels Dec 27, 2023
@allnil
Copy link
Contributor

allnil commented Jan 12, 2024

Take it

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 C-bug An unexpected or incorrect behavior
Projects
Status: Todo
Development

No branches or pull requests

4 participants