dapphub / ds-proxy

a proxy object that can compose transactions on owner's behalf
https://dapp.tools/dappsys/ds-proxy.html
GNU General Public License v3.0
311 stars 76 forks source link

reuse codehash->address caches across multiple DSProxies #2

Closed nmushegian closed 7 years ago

nmushegian commented 7 years ago

e.g. in their factory

nmushegian commented 7 years ago

Looks like there is no caching at all yet. That would be a good place to start or else we will really pollute the chain

NiklasKunkel commented 7 years ago

Can you elaborate on what you mean by this? This sounds similar to ds-robot except for the multiple DSProxies part.

nmushegian commented 7 years ago

That explains my confusion. This should be an issue for DSRobot: suggestion to use factory to cache libs

nmushegian commented 7 years ago

wait no: even in DSProxy, you should have a codehash -> deployment cache, to avoid redundant creates

NiklasKunkel commented 7 years ago

Update, I've created a new branch for the global cache (something I should have done a while ago...). The current commit on master doesn't work so I may roll back master to the last working commit.

After consulting with @nmushegian I've moved the cache to be inside the Proxy Factory rather than the Proxy instance. This makes more sense, all proxys can utilizie the same cache. However for flexibility I've left in the option for a proxy instance to change its cache. This is important because storage costs do not scale linearly. Given a sufficiently large cache, a user may want to avoid having to pay storage costs to cache a new contract in the global cache.

I'm having an issue with DS-Auth at the moment where a setOwner(msg.sender) is failing that is prohibiting me from continuing to test. It's strange that it seems to work fine under "dapp test" conditions but fails on Kovan. Will create a new issue for this.

NiklasKunkel commented 7 years ago

Global cache has been implemented and tested. Closing this issue.