-
Notifications
You must be signed in to change notification settings - Fork 127
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
fix: fetch all factory deps for a given contract #316
Conversation
chore: impl FetchContract for &[DualCompiledContract] refactor(create:zk): avoid modifying provided list of factory_deps during deploy fix(create:zk): simplify factory dep search algo
4f0ef0d
to
44a5778
Compare
fix(test:zk): proper user factory
feat(zk:create): lookup all factory deps of manually specified deps
feat(test:zk): add scripts for factory tests fix(test:zk): comment out non working test & add FIXME
Lets wait to adding aave-delivery test into the CI before merging this PR. Today should be added :) |
Co-authored-by: Nisheeth Barthwal <nbaztec@gmail.com>
fix(tests:zk): enable `testUserFactory` refactor(compile:zk): `fetch_all_factory_deps` return `Vec<Vec<u8>>`
fix(zk:factory_dep): load from storage first, then persisted deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love the tests ❤️
refactor(zk): remove persisted factory deps from `StorageView` refactor(zk:call): remove dead code
let persisted_factory_deps = self.persisted_factory_deps.clone(); | ||
// and extend it for future calls | ||
self.persisted_factory_deps | ||
.extend(factory_deps.iter().map(|dep| (hash_bytecode(dep), dep.clone()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow up, we should try to remove this part, and perhaps extend it only with the bytecodes
returned from the era vm. So in theory, every known bytecode will reside here. Or perhaps we can also think if it's easier to support it directly in the Backend
and via some changes to DatabaseExt
to actually store the factory_deps directly in the storage. But that all can be a later refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor doc related changes otherwise LGTM
Co-authored-by: Nisheeth Barthwal <nbaztec@gmail.com>
Motivation
Currently deploying factory-style contracts requires specifying almost all dependencies manually (via something like
--factory-deps
).Addressing this issue would resolve #295 as well.
Solution
Use the factory deps information provided by the compiler and bundle them in the transactions when creating contracts with factory dependencies, also performing a search to find any nested dependencies, since the compiler only returns the first level of dependencies.
Notes
The following tests fail:
testUserFactory