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

Wipe deployment state if hardhat-network has been restarted #653

Merged
merged 5 commits into from
Apr 1, 2024

Conversation

zoeyTM
Copy link
Contributor

@zoeyTM zoeyTM commented Dec 13, 2023

In the past, we've had the intention of keeping ignition-core agnostic of hardhat, however, with this issue, while we do need to store this piece of data (instanceId) somewhere to compare against future runs and journal does seem like the most appropriate place, that would also require breaking that separation of intent between ignition-core and hardhat as instanceId is a hardhat-specific piece of data. we would also need to add a hardhat-specific method to JsonRpcClient to retrieve the instanceId

To maintain that separation, I went a different direction with this implementation. The logic for this feature exists entirely inside hardhat-plugin, but it does require adding one new (small) file to the ignition/deployments directory to map deployment IDs to hardhat instance IDs. I think this approach is preferable since this is a hardhat-specific feature to begin with.

This implementation does have one caveat, and that's in the case of a user

  1. with an existing deployment to a non-hardhat chain
  2. that deployment uses a custom deploymentId
  3. the user tries deploying to hardhat-network using the same custom deploymentId

If those criteria are met, the existing deployment to a non-hardhat chain would be wiped. I think this is a bit of a contrived edge case, so I'm okay with leaving that possibility if needed, but any suggestions on removing that possibility would be more than welcome as well.

resolves #650

@zoeyTM
Copy link
Contributor Author

zoeyTM commented Jan 31, 2024

Also closes #677

@zoeyTM zoeyTM linked an issue Jan 31, 2024 that may be closed by this pull request
@alcuadrado alcuadrado merged commit 68887e4 into development Apr 1, 2024
6 checks passed
@alcuadrado alcuadrado deleted the cleared-node branch April 1, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants