Skip to content

Conversation

Gmin2
Copy link
Contributor

@Gmin2 Gmin2 commented Sep 3, 2025

Description

  • Add support for custom Solidity types (enums and structs) in Ethereum event topic0 encoding
  • Automatically resolve enum types to uint8 and struct types to tuple format before keccak256 hashing

Fixes #1772

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

Copy link
Collaborator

@stwiname stwiname left a comment

Choose a reason for hiding this comment

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

Hi @Gmin2, this isn't what were after.

The feature isn't just for generating/importing abis. It's for at runtime when calculating the hash so that in the project manifest where are tuples/structs/enums.

For some more direction, these functions would need to be updated to be able to use ABIs to convert the signatures, like you have done. https://github.com/subquery/subql-ethereum/blob/main/packages/node/src/utils/string.ts#L22-L44

@Gmin2
Copy link
Contributor Author

Gmin2 commented Sep 4, 2025

Hey @stwiname i have made a commit in repo subql-ethereum take a look in it and tell me if thats what yu were looking for and have some doubts there

subquery/subql-ethereum@main...MeshPort-Labs:subql-ethereum:feat/runtime-abi

@stwiname
Copy link
Collaborator

stwiname commented Sep 8, 2025

@Gmin2, this is looking much better. I think for solving the dictionary issue, it would be best to resolve the filters when the project loads so that the updated filters are available everywhere.

If you create a PR with that work then i can provide more feedback

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.

[$1200 in SQT] Support custom types in the topic0 encoding
2 participants