workers: event-manager: event_types: tweak event types #838
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tweaks the event types to make them more ergonomic for historical state indexing. Namely, this includes:
event_id
andevent_timestamp
fields into each event type, so that it is self-contained, making it more easily matchable / handleablematching_pool
field to order placements & updates, to ensure that matching pool movements can be trackedexecution_price
to matches & external matches. While the price itself can be computed from the match result, the timestamp on it is important. We could assume theevent_timestamp
is the timestamp of the fill, but it is important to the frontend that fills are recorded with the timestamp at which the price was sampled, specifically.RelayerEvent
. This unfortunately makes it impossible to deserialize theu128
amount
field, presumable due to Untagged enum does not play nice with u128 serde-rs/serde#1682