Skip to content

feat: add blockTimestamp to logs#5104

Open
andrevmatos wants to merge 2 commits into
ethers-io:mainfrom
andrevmatos:feat/logs_block_timestamp
Open

feat: add blockTimestamp to logs#5104
andrevmatos wants to merge 2 commits into
ethers-io:mainfrom
andrevmatos:feat/logs_block_timestamp

Conversation

@andrevmatos

Copy link
Copy Markdown

Added to JSON-RPC in ethereum/execution-apis#639
Resolves: #1250 (comment)

@andrevmatos

Copy link
Copy Markdown
Author

@ricmoo can you give a look at this one when possible, please?

@andrevmatos

Copy link
Copy Markdown
Author

Related: #5012

@andrevmatos andrevmatos force-pushed the feat/logs_block_timestamp branch from 01fa42e to e8f3a33 Compare April 1, 2026 22:32
andrevmatos added a commit to smartcontractkit/ccip-tools-ts that referenced this pull request May 13, 2026
* ccip: fix caches and logs.blockTimestamp

all 2026 EVM nodes return `blockTimestamp` inside logs payload for both
`eth_getLogs` and `eth_getTransactionReceipt`; still, ethers doesn't
include it in those returned objects;
we fix this by hooking into some methods which get access to the raw
payloads of those requests, and caching the result in
Chain.getBlockTimestamp; see ethers-io/ethers.js#5104
Also, fix some caches, as micro-memoize's maxSize default=1

* prefer log.blockTimestamp over tx.timestamp
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.

Getting block timestamp in contract events without calling the getBlock() promise

1 participant