Replies: 1 comment 1 reply
-
Yes, that is an intendent behaviour. We have the same in RGB all previous versions, as well as in bitcoin - or any other transactions. Ordering of intputs and outputs is a part of non-deterministic Turing machine, as well as the graph of transactions. If it were made in a deterministic order, we for instance would never have Opret scheme. There is no point of having inputs or outputs in any transaction-based distributed system to be a map and not a vec, where the order is set not by an algorithm but by a willing agent external to the system |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found a bug during the Sonic project review:
I noticed that the GenesisID changes according to the order of data added when issuing a contract.
After investigating, I noticed that the
immutable
anddestructible
fields, used in GenesisCommitmentId,
are of typeSmallVec.
, i.e, we have no ordering guarantees.We could use the
TinyOrdMap
type, for example, to guarantee that regardless of the order of the entries, we will produce the same GenesisID, which consequently makes the same ContractID.To reproduce the error, use the two YAMLs I added below. In them, I reversed the order of the circulating fields in them.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions