zkparty / trusted-setup-frontend

The KZG Ceremony web browser implementation
https://ceremony.ethereum.org
229 stars 66 forks source link

# Background #225

Open Vtalike opened 7 months ago

Vtalike commented 7 months ago

Background

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.

Criteria

最初由 @bvrooman 在 https://github.com/FuelLabs/fuel-core/issues/1654 发布