Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

feature request: Add an optional "signature" field to the eventHandlers. #64

Open
LiRiu opened this issue Aug 17, 2023 · 1 comment
Open
Labels
feature good first issue Good for newcomers

Comments

@LiRiu
Copy link
Collaborator

LiRiu commented Aug 17, 2023

The "eventHandlers" field in the current configuration file only supports two fields: "event define" and "handle function".

      eventHandlers:
        - event: OrderFulfilled(bytes32,address,address,address,tuple[],tuple[])
          handler: handleEvents

If the event contains dynamic data types, it can be a bit challenging to define.
For example, the OrderFulfilled event in the opensea.seaport protocol includes two dynamic struct types. These "dynamic events" are not fully expressed on etherscan and only record tuple[].
If the developer only defines the dynamic type field as tuple[] (as written in the above YAML), then esig will calculate incorrectly. It won't be able to filter the correct events.

advice

Add a "signature" field to the eventHandlers in the configuration file. Use it to directly assign the value of esig.

@nom4dv3
Copy link
Member

nom4dv3 commented Sep 1, 2023

Good point. Yes I can see the actual event def in your code:
OrderFulfilled(bytes32,address,address,address,(uint8,address,uint256,uint256)[],(uint8,address,uint256,uint256,address)[]) , a bit hard to write I agree.

Maybe we can add this pattern:

      eventHandlers:
        - signature: "0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31"
          handler: handleEvents

If both exists, hyperoracle node needs to validate the consistency of them, and use the signature directly if valid, discard zkgraph if not.

      eventHandlers:
        - event: "OrderFulfilled(bytes32,address,address,address,tuple[],tuple[])"
          signature: "0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31"
          handler: handleEvents

@nom4dv3 nom4dv3 added feature good first issue Good for newcomers labels Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants