-
Notifications
You must be signed in to change notification settings - Fork 51
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
feature: deployment logs #82
Comments
boa needs a way to cache deployments such that:
if rpc borks but we have tx hash, in the next run only fetch contract address iff source code hash is the same. if source code hash changes, just do a new deployment |
@charles-cooper Should we reuse the existing Do we need a separate setting for caching besides the existing The key should be at least |
The implementation currently in #240 works as following:
boa.load("contract.vy", *args, deploy_id=1)
boa.load("contract.vy", *args, deploy_id=1) # this will be cached
boa.load("contract.vy", *args, deploy_id=2) # this will not be cached, different deploy ID
boa.load("contract.vy", *args2, deploy_id=1) # this will not be cached, different constructor args
boa.load("contract2.vy", *args, deploy_id=1) # this will not be cached, different source code
boa.env.set_chain_id(11155111)
boa.load("contract.vy", *args, deploy_id=1) # this will not be cached, different chain ID
|
Alternatively, we could also set the deploy globally so the user doesn't need to override it every time, e.g. boa.env.set_deploy_cache_id(1)
boa.load("contract.vy", *args)
boa.load("contract.vy", *args) # this will be cached
with boa.env.anchor_deploy_cache_id(2):
boa.load("contract.vy", *args) # this will not be cached, different deploy ID |
I think we will also need some sort of a way to save these deployments into a json file. Usually I need to pass these deployments across to other service providers so they can enter it into their config file. Maybe: boa.env.dump_cache(deploy_id=1, filename=filename) |
yea, will be useful to get human readable thing. maybe something that will help is if the deployment log is not stored in a global database, but a database in the current directory. that way there are no weird conflicts between repos (and the deploy log is easier to find too!) |
@charles-cooper are you now on board with this solution? Or what do you suggest? Moving it to the application folder + adding a dump/import should be fine. For that purpose, JSON format might be easier to handle than sqlite. |
no i don't think so -- false cache miss is OK, but false cache hit can be catastrophic |
It might make sense that these are optionally stored in a file so future scripts can grab the most recent deployment. |
log things about deployments (e.g., what is currently being printed in boa/network.py, but maybe also contract / compiler_data) so that interrupted deployments can continue. probably keep it in a leveldb database.
The text was updated successfully, but these errors were encountered: