bisq2 icon indicating copy to clipboard operation
bisq2 copied to clipboard

Add annotation to exclude a field from being used for calculation the hash

Open HenrikJannsen opened this issue 4 months ago • 0 comments

We use the hash of the serialized data (using protobuf serialisation) for various use cases:

  • key for network data storage
  • payload for proof of work (currently we use the full serialized data, but that will be changed to use the hash instead)
  • input for signing data

This tight constraint makes updates and changes very difficult. We want to reduce the scope of the data being used for the hash to the essential data which represents the identity of an object. We could add a ExcludeFromHash annotation which can be used then in the protobuf serialisation to clear those fields from the builder.

https://github.com/bisq-network/bisq2/pull/1935 and https://github.com/bisq-network/bisq2/pull/1936 are attempts to address that problem. Unfortunately it makes the protobuf methods more boilerplace and their API less elegant. We still investigate a more elegant solution to address that problem.

For deploying that we can activate it by adding the feature to the configs, so there is no need for an activation date. Still there will be requires some preparatory work to ensure a smooth rollout.

We could add multiple ExcludeFromHash annotations for the different use cases to allow more fine grained control. But not sure if that is needed and complicates the feature more as needed.

See also: https://github.com/bisq-network/bisq2/issues/1948

HenrikJannsen avatar Mar 28 '24 06:03 HenrikJannsen