-
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
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 and destructible fields, used in Genesis CommitmentId, are of type SmallVec., 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.
sealType: BitcoinOpret
codexId: znwQGVhW-rfRa8el-pNaAsUW-UWxXsB_-4UlC~Tf-TERhBm4#mirage-queen-delphi
name: DemoToken
method: issue
timestamp: "2024-12-18T10:32:00-02:00"
global:
- name: circulating
verified: 10000
- name: name
verified: Demo Token
- name: ticker
verified: DEMO
- name: precision
verified: centiMilli
owned:
- name: owned
seal: b7116550736fbe5d3e234d0141c6bc8d1825f94da78514a3cede5674e9a5eae9:1
data: 10000sealType: BitcoinOpret
codexId: znwQGVhW-rfRa8el-pNaAsUW-UWxXsB_-4UlC~Tf-TERhBm4#mirage-queen-delphi
name: DemoToken
method: issue
timestamp: "2024-12-18T10:32:00-02:00"
global:
- name: name
verified: Demo Token
- name: ticker
verified: DEMO
- name: precision
verified: centiMilli
- name: circulating
verified: 10000
owned:
- name: owned
seal: b7116550736fbe5d3e234d0141c6bc8d1825f94da78514a3cede5674e9a5eae9:1
data: 10000Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested