Skip to content

eth/filters: add timestamp to derived logs #31887

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

s1na
Copy link
Contributor

@s1na s1na commented May 23, 2025

@s1na s1na marked this pull request as ready for review May 23, 2025 14:08
@fjl fjl added this to the 1.15.12 milestone May 23, 2025
@s1na s1na changed the title core/types: add timestamp to derived logs eth/filter: add timestamp to derived logs May 23, 2025
@joshstevens19
Copy link

This will be huge when it gets merged 🔥

@fjl fjl changed the title eth/filter: add timestamp to derived logs eth/filters: add timestamp to derived logs May 24, 2025
@MariusVanDerWijden
Copy link
Member

MariusVanDerWijden commented May 26, 2025

I don't really like the idea of adding more redundant fields to the logs. The receipt itself already holds blockhash and blocknumber so the logs having them kinda unnecessarily duplicates the data. Now we are adding the timestamp as well. I think the better approach would be to rework our json api s.th. the whole receipt is always returned and you don't need these unnecessary fields in the log anymore.

Not opposed to merging this, just my 2cents around the spec

edit: also Txindex and Txhash

@s1na
Copy link
Contributor Author

s1na commented May 26, 2025

I don't really like the idea of adding more redundant fields to the logs. The receipt itself already holds blockhash and blocknumber so the logs having them kinda unnecessarily duplicates the data. Now we are adding the timestamp as well. I think the better approach would be to rework our json api s.th. the whole receipt is always returned and you don't need these unnecessary fields in the log anymore.

The idea is to exactly avoid the extra roundtrip for fetching the block. While processing the logs we will anyway have to fetch at least the header and might as well return this data when there is clear demand for it.

I think the better approach would be to rework our json api s.th. the whole receipt is always returned and you don't need these unnecessary fields in the log anymore.

I'm not sure I understand the alternative. If you mean return the whole receipt when people query for logs: it still doesn't contain the timestamp.

@bmoyroud
Copy link

Thanks for opening this @s1na - having blockTimestamp would be a big win as discussed.

It would avoid the extra call to eth_getBlockByNumber for each log & speed up indexing.

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.

5 participants