-
Notifications
You must be signed in to change notification settings - Fork 157
bug: hooks don't get executed for ethflow orders #3388
Description
Problem
User defined hooks associated with ethflow orders don't get executed.
Impact
More advanced use cases that rely on hooks can't be done at the moment with ethflow orders (e.g. swap-and-bridge).
To reproduce
- Create an appdata document that contains pre- or post-hooks
- upload it to the backend
- create ethflow order with that
appdatahash - wait for order to get executed
- check tenderly / etherscan to see if the hook interactions got executed
Expected behaviour
All hook interactions defined in the appdata hash should be executed.
Additional context
There are 2 ways how orders get added to the backend:
- posting the order via the REST API (this is where the appdata handling works correctly)
- autopilot indexes ethflow orders from onchain events
We probably don't do the same appdata handling in the second case. We should load the appdata JSON from the DB using the appdata hash signed in the ethflow order and then parse the JSON and store the nicely extracted data the same way we do it in 1.
Also for context interactions are the only pieces of information from the appdata we persist separately in the DB. For things like partner fees and flashloan hints we load the entire appdata associated with an appdata hash and parse it whenever we need it.