h-REA / hREA

A ValueFlows / REA economic network coordination system implemented on Holochain and with supplied Javascript GraphQL libraries
https://docs.hrea.io
Other
142 stars 15 forks source link

Inject random data into newly created records to ensure uniqueness. #319

Closed pospi closed 1 year ago

pospi commented 2 years ago

Sometimes, different records have the same field values. We encountered this in #318 where separate EconomicResources might be created by associated EconomicEvents but end up with the same EntryHash, causing uniqueness problems that can affect indexing and other relationships between different bits of data.

To work around this, we should insert some random bytes into an internal storage field upon creating new records, and persist the same value between updates. These values should not be returned in any response data- they are purely for internal use.

This will apply to all record types except ProposedIntent and ProposedTo, which are idempotent entries in that they merely hold values to associate other record types.