Updated the new_uuid implementation to include the transaction_hash
New unit test to reproduce the issue
Clened the account_nfts test code
Motivation and Context
The engine implementation of the new_uuid function, used when generating a random id (e.g. non fungibles), does cause a duplication id issue on objects generated inside the scope of the same EntityId.
This happens because the new_uuid only uses a the entity_id and a increasing integer to generate a new random uuid. On separated transactions that generate random uuids in the same EntityId this can end up in a duplication.
This PR adds the transaction_hash to to the new_uuid generation, avoiding separated transactions to generate the same uuids even if the EntityId is the same.
How Has This Been Tested?
New engine unit test mint_multiple_times that reproduces the problem. With the fix the new test pass.
What process can a PR reviewer use to test or verify this change?
See previous section
Breaking Changes
[ ] None
[ ] Requires data directory to be deleted
[x] BREAKING CHANGE: consensus change on engine uuid generation, so VNs without this change will not reach consensus with VNs that have this change.
Description
new_uuid
implementation to include thetransaction_hash
account_nfts
test codeMotivation and Context
The engine implementation of the
new_uuid
function, used when generating a random id (e.g. non fungibles), does cause a duplication id issue on objects generated inside the scope of the same EntityId.This happens because the
new_uuid
only uses a theentity_id
and a increasing integer to generate a new random uuid. On separated transactions that generate random uuids in the same EntityId this can end up in a duplication.This PR adds the
transaction_hash
to to thenew_uuid
generation, avoiding separated transactions to generate the same uuids even if the EntityId is the same.How Has This Been Tested?
New
engine
unit testmint_multiple_times
that reproduces the problem. With the fix the new test pass.What process can a PR reviewer use to test or verify this change?
See previous section
Breaking Changes