Skip to content
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

Why forc deploy will rebuild code? #6533

Closed
lispking opened this issue Sep 11, 2024 · 6 comments
Closed

Why forc deploy will rebuild code? #6533

lispking opened this issue Sep 11, 2024 · 6 comments

Comments

@lispking
Copy link

Why does the forc build --release command require the code to be rebuilt when executing forc deploy afterwards? This design doesn't seem user-friendly; deploy doesn't need to rebuild the code again, it should simply check if there are artifacts in the release directory.

@sdankel
Copy link
Member

sdankel commented Sep 11, 2024

Hi @lispking, This is done to make sure that what's being deployed is compiled from the latest source code. If we didn't do this, it would be easy for a user to accidentally deploy the wrong (stale) bytecode.

@sdankel sdankel closed this as completed Sep 11, 2024
@lispking
Copy link
Author

lispking commented Sep 11, 2024

Hi @lispking, This is done to make sure that what's being deployed is compiled from the latest source code. If we didn't do this, it would be easy for a user to accidentally deploy the wrong (stale) bytecode.

Understood, but we could consider it as an optional feature, allowing users to avoid recompiling, for instance by adding a 'non-compile' flag. When users add this option, they can reuse the output/release artifacts. @sdankel

@sdankel
Copy link
Member

sdankel commented Sep 11, 2024

Could you explain more about your use case? You said "This design doesn't seem user-friendly", is that just because it takes longer to recompile, or is it something else?

@lispking
Copy link
Author

lispking commented Sep 11, 2024

This is related to the issue here. The amp tool will separate these steps and build these capabilities in. You can see the specific implementation code here.

If you look closely, you'll notice that the code here hardcodes a wallet. In fact, I also want to change this to the 'wallet import' command, which would allow users to input their own private_key and password. This way, users can deploy using their own wallets.

If feasible, I can help implement these patches. @sdankel

@sdankel
Copy link
Member

sdankel commented Sep 11, 2024

I'm still not sure I understand why you need the compile step to be separated from the deploy step, but I'm okay with having a --skip-compile option.

It might require significant refactoring. The current implementation uses the compiler output structures directly rather than reading from the compiled artifact files. I'll reopen this if you want to take it on.

@lispking
Copy link
Author

Yeah. I understand that we should add the --skip-compile option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants