engine icon indicating copy to clipboard operation
engine copied to clipboard

Service hash calculation (tasks and events)

Open antho1404 opened this issue 4 years ago • 1 comments

Similar to https://github.com/mesg-foundation/engine/issues/1707 the order of tasks and events in a service doesn't impact the behavior of the service so it might be interesting that 2 services with the same events and same tasks produce the same hash whatever the defined order.

We could sort the tasks/events based on the key or based on any order that we estimate more performant.

Originally posted by @antho1404 in https://github.com/mesg-foundation/engine/pull/1692

antho1404 avatar Mar 06 '20 02:03 antho1404

Similar answer than https://github.com/mesg-foundation/engine/issues/1707#issuecomment-596325792 but with the following addition: what about the order of the parameters? why is this case they should not be shorted by key?

I think if the structure of data has an order, the hash-serializer should take it into account. The solution here should be to change the structure of data to use one where the order is not important (map), but I don't think this is a required modification.

The compiler should order it by key if it wants to, not the hash-serializer.

NicolasMahe avatar Mar 09 '20 04:03 NicolasMahe