You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ContractsInfo type is current the tuple (Salt, Bytes32) where the Salt records the salt used to create the contract, and the Bytes32 is the Merkle root of the given contract. The salt is non-protocol level data, while the Merkle root is protocol level data. This coupling of non-protocol and protocol level data is unnecessary, and we can decouple these data points.
Solution
One solution stems from recognizing that we do not need to store the Merkle root in on-chain storage. During CROO execution, we can instead recalculate the contract's Merkle root from the contract data loaded from storage. This removes the dependency on ContractInfo during CROO and other on-chain operations. We can then remove the Merkle root from the ContractsInfo type and store only the salt, allowing ContractsInfo to be an off-chain only data type.
With the simplified ContractsInfo type, we can apply the versioned enum idiom to allow simple upgrades.
During CROO, the contract's root is recalculated reading the contract data from storage and applying the root calculation (feat: Remove ContractsInfo fuel-vm#673)
Background
The
ContractsInfo
type is current the tuple(Salt, Bytes32)
where theSalt
records the salt used to create the contract, and theBytes32
is the Merkle root of the given contract. The salt is non-protocol level data, while the Merkle root is protocol level data. This coupling of non-protocol and protocol level data is unnecessary, and we can decouple these data points.Solution
One solution stems from recognizing that we do not need to store the Merkle root in on-chain storage. During
CROO
execution, we can instead recalculate the contract's Merkle root from the contract data loaded from storage. This removes the dependency onContractInfo
duringCROO
and other on-chain operations. We can then remove the Merkle root from theContractsInfo
type and store only the salt, allowingContractsInfo
to be anoff-chain
only data type.With the simplified
ContractsInfo
type, we can apply the versioned enum idiom to allow simple upgrades.Criteria
ContractsInfo
table infuel-vm
(feat: Remove ContractsInfo fuel-vm#673)CROO
, the contract's root is recalculated reading the contract data from storage and applying the root calculation (feat: Remove ContractsInfo fuel-vm#673)ContractsInfo
type is versioned using an enum (feat: AddContractInfo
table and versionableContractInfoType
to on-chain storage #1657)[ ] MoveContractInfo
table to off-chain databaseThe text was updated successfully, but these errors were encountered: