Skip to content

Commit

Permalink
update eth_getLogs+timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
sambacha authored Feb 23, 2024
1 parent b6ad722 commit f9ed6ed
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions eth_getLogs+timestamp/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
title: Extending eth_getLogs to also return blockTimestamp
authors: wighawag
source: <https://github.com/ethereum/execution-apis/issues/295>
description: A Proposal for adding blockTimestamp to logs object returned by eth_getLogs and related requests
---

# `eth_getLogs` with `blockTimestamp`

A Proposal for adding blockTimestamp to logs object returned by eth_getLogs and related requests
Expand All @@ -19,7 +26,7 @@ Ideally, the log object returned by `eth_getLogs` would include the block’s ti

Here is the spec for `eth_getLogs` with the added `blockTimestamp` field

### `eth_getLogs` {#eth_getlogs}
### `eth_getLogs`

Returns an array of all logs matching a given filter object.

Expand All @@ -33,7 +40,7 @@ Returns an array of all logs matching a given filter object.
- `topics`: `Array of DATA`, - (optional) Array of 32 Bytes `DATA` topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options.
- `blockhash`: `DATA`, 32 Bytes - (optional, **future**) With the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash `blockHash`. Using `blockHash` is equivalent to `fromBlock` = `toBlock` = the block number with hash `blockHash`. If `blockHash` is present in in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.

```
```jsonc
params: [
{
topics: [
Expand All @@ -53,7 +60,7 @@ params: [
- `transactionHash`: `DATA`, 32 Bytes - hash of the transactions this log was created from. `null` when its pending log.
- `blockHash`: `DATA`, 32 Bytes - hash of the block where this log was in. `null` when its pending. `null` when its pending log.
- `blockNumber`: `QUANTITY` - the block number where this log was in. `null` when its pending. `null` when its pending log.
**\- `blockTimestamp`: `QUANTITY` - the unix timestamp for when the block where this log was in, was collated. `null` when its pending. `null` when its pending log.**
- `blockTimestamp`: `QUANTITY` - the unix timestamp for when the block where this log was in, was collated. `null` when its pending. `null` when its pending log.**
- `address`: `DATA`, 20 Bytes - address from which this log originated.
- `data`: `DATA` - contains one or more 32 Bytes non-indexed arguments of the log.
- `topics`: `Array of DATA` - Array of 0 to 4 32 Bytes `DATA` of indexed log arguments. (In _solidity_: The first topic is the _hash_ of the signature of the event (e.g. `Deposit(address,bytes32,uint256)`), except you declared the event with the `anonymous` specifier.)

0 comments on commit f9ed6ed

Please sign in to comment.