-
Notifications
You must be signed in to change notification settings - Fork 490
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
feat: re-introduce __default__
entrypoint
#6170
Comments
+1 to this |
doesn't |
No, replace class allows replacing the class of one single contact at a time. We're in the situation of using a pattern called the beacon proxy that allows you to deploy a new implementation contract and upgrade all proxies simultaneously. Example use case: you're deploying contracts for an applications where you are deploying one contract for each entity. As your application gets new features, you need each entity to support the new features. So you might need to add entrypoints, modify some behaviors, add some storage vars, etc. Currently the only possibility is to have an owner contract that would call With my proposal, entities would simply make a library call to a class that is known to be the most up to date. You only need to change, in one single location, the hash of the latest class |
@enitrat if you had |
Hello, I am sorry but I'm not sure i understood your proposal @iliav-starkware, but here is another description of the issue https://docs.openzeppelin.com/contracts-cairo/0.15.0/upgrades#proxies_in_starknet |
@iliav-starkware using TLDR: Let me know if the problem is clearer with the concrete example of Kakarot. Each EOA in the Kakarot system is represented by a unique starknet contract, such that 1 EOA = 1 Starknet Contract. As such, everytime an account is created within Kakarot, an Account Contract is deployed on Starknet. When we update Kakarot, we often make breaking changes to how these account behave: adding paymaster mechanism, optimising calldata, caching values in the account's storage, creating new entrypoints to access specific informations, etc. Everytime we make such a change, we break the existing compatibility of accounts with Kakarot. If we introduce a new entrypoint, or change the signature of an entrypoint, then the old account becomes unusable within Kakarot, as calling this entrypoint would make the transaction revert. What the proposal achieves is the ability to redirect any call to a contract's entrypoint to a In our case, this means that if inside our |
Feature Request
In Cairo Zero, we had the
__default__
entrypoint. When you tried to invoke an entrypoint that didn't exist in the contract class, your call could be redirected to this__default__
entrypoint and you could handle it as wanted.The main motivation for this is to re-introduce the transparent proxies and beacon proxies pattern. Consider an application where you deploy a contract for your users. Eventually, as your needs grow and you add features, you will need to upgrade potentially all deployed instances by users; which will require a manual action from your users. Then, you're forced to keep compatibility with older versions, which rapidly becomes a pain.
With beacon proxies, you could simply create a pattern where all calls are delegated to an external class, that can be updated in a single contract, by using the
__default__
entrypoint.The text was updated successfully, but these errors were encountered: