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

LogTopic - empty list is wildcard log topic #8420

Merged
merged 7 commits into from
Mar 18, 2025

Conversation

macfarla
Copy link
Contributor

@macfarla macfarla commented Mar 14, 2025

PR description

this makes besu match our own documentation of log topics https://besu.hyperledger.org/public-networks/concepts/events-and-logs#topic-filters

Fixed Issue(s)

also fixes rpc-compat hive test eth_getLogs/topic-wildcard

Description:queries for logs with two topics, performing a wildcard match in topic position zeroDetails:

{"jsonrpc":"2.0","id":1,"method":"eth_getLogs",
  "params":[{"address":null,"fromBlock":"0x3","toBlock":"0x6",
    "topics":[[],["0x4238ace0bf7e66fd40fea01bdf43f4f30423f48432efd0da3af5fcb17a977fd4"]]}]}

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: Sally MacFarlane <[email protected]>
final Log log = new Log(address, data, Lists.newArrayList(topic1, topic2));

assertThat(query.matches(log)).isFalse();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note there are 2 LogsQueryTest classes - I think the other one has clearer structure so I added a test there and removed this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

prob should combine them - in a separate PR

Copy link
Contributor

@pinges pinges left a comment

Choose a reason for hiding this comment

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

LGTM

@macfarla macfarla enabled auto-merge (squash) March 18, 2025 04:10
@macfarla macfarla merged commit c99bdbd into hyperledger:main Mar 18, 2025
43 checks passed
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.

3 participants