-
Notifications
You must be signed in to change notification settings - Fork 45
Description
π Context
Application deployment is one of the most expensive L1 operations in Cartesi Rollups.
This is mostly due to the considerable size of the Application contract bytecode.
We can make this operation cheaper by leveraging the ERC-1167 standard.
The standard describes minimal proxy contracts that help reduce deployment costs.
The original proxy contract is described in EVM bytecode.
Thankfully, OpenZeppelin implements the pattern in Solidity (see Clones).
It even supports embedding arguments into the clone's bytecode.
See the cloneDeterministicWithImmutableArgs and fetchCloneArgs functions.
This is crucial for us to convert immutable variables into the ERC-1167 framework.
To give a notion of the reduction in gas costs, see cartesi/dave#151.
We applied this technique in the PRT contracts and witnessed a 10x reduction in gas costs.
This type of reduction in gas costs is crucial for recurrent deployment, such as tournaments.
But this technique can also have positive effects if applied in single-time deployments, such as applications.
In particular, this can reduce the entrance barrier for app developers to deploy their apps to Mainnet.
βοΈ Solution
- Make
ApplicationFactoryandApplicationimplement ERC-1167 - Measure gas cost changes in application deployment and function calls
Metadata
Metadata
Assignees
Labels
Type
Projects
Status