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

Improve definition of log filter topic JSON type #169

Merged
merged 3 commits into from
Jan 28, 2022

Conversation

fjl
Copy link
Collaborator

@fjl fjl commented Jan 25, 2022

There were two problems in the type definition of the log filter "topics" field:

  • Topics must be encoded as bytes32 instead of uint256. Implementations reject hex topics with less than 32 bytes.
  • Items of the topic list can be given as a single topic or as an array of multiple topics. In the latter case, the filter returns logs with any of the given topics.

Example: the filter below matches logs with

  • any topic in the first position
  • topic 0xd783efa4... in the second position
  • topic 0x1ddcc4de... OR 0x77d14ee1... in the third position.
{
  "topics": [
    [],
    "0xd783efa4d392943503f28438ad5830b2d5964696ffc285f338585e9fe0a37a05",
    ["0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "0x77d14e10470b5850332524f8cd6f69ad21f070ce92dca33ab2858300242ef2f1"]
  ]
}

Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

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

Thank you for this correction.

@lightclient lightclient merged commit 3a00485 into ethereum:main Jan 28, 2022
@fjl
Copy link
Collaborator Author

fjl commented Jan 28, 2022

Please also check #129

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.

2 participants