Skip to content

Conversation

@taylanpince
Copy link
Contributor

This PR updates the block command's --check-logs-bloom flag to filter out logs from transactions with gasPrice == 0. This excludes system transactions on HyperEVM (https://www.quicknode.com/docs/hyperliquid/endpoints#key-implementation-differences), making logs bloom check validation work.

func ValidateLogsWithBlockHeader(logs []types.Log, header *types.Header, optLogsBloomCheck ...LogsBloomCheckFunc) bool {
// Allow callers to override the check logic (e.g. filtering certain logs).
if len(optLogsBloomCheck) > 0 && optLogsBloomCheck[0] != nil {
return optLogsBloomCheck[0](logs, header)
Copy link
Member

@pkieltyka pkieltyka Dec 5, 2025

Choose a reason for hiding this comment

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

if we're just replacing the full logic of the function, then the caller can just call a different function instead of this one..? if you prefer that approach, it works, and we can just have a LogsBloomCheckFunc type exactly as you have.. and on the caller side, it can assign the validation function it wants..

in which case, I'd remove this optLogsBloomCheck argument, and keep the LogsBloomCheckFunc and keep the ConvertLogsToBloom exported like you did.

I think that approach is great. I suggest the following:

type LogsBloomCheckFunc func(logs []types.Log, header *types.Header) bool
type LogsFilterFunc func(logs []types.Log, header *types.Header) []type.Log

func ValidateLogsWithBlockHeader(logs []types.Log, header *types.Header) bool {
  // leave this function as it was, so it adheres to the LogsBloomCheckFunc type
}

.. then really the caller could just call..

if hyperEvm {
  logs = LogsFilterForHyperEVM(logs)
}

ValidateLogsWithBlockHeader(logs, header)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good call, added this. The only difference is I included the block in the LogsFilterFunc params so txns can be used in filtering

@taylanpince taylanpince merged commit 9aca5f2 into master Dec 5, 2025
8 checks passed
@taylanpince taylanpince deleted the ethkit-logs-gasprice-check branch December 5, 2025 18:05
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