Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# Background #225

Open
4 tasks
Vtalike opened this issue Feb 24, 2024 · 0 comments
Open
4 tasks

# Background #225

Vtalike opened this issue Feb 24, 2024 · 0 comments

Comments

@Vtalike
Copy link

Vtalike commented Feb 24, 2024

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

最初由 @bvroomanFuelLabs/fuel-core#1654 发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant