This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Contract upgrade tooling: makefile + documentation #293
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3491274
add prettier workflow tooling
snissn 0b12d05
add necessary package json and lock
snissn b99ab65
Apply Prettier formatting
snissn 5b11139
deploy scripts in makefile for ease of readability and usage
snissn 793b083
upgrade readme with explanation of diamond upgrade
snissn 6225914
Merge branch 'mikers/prettierServerCommit2' into mikers/documentation…
snissn 442706c
commit ABI artifacts
auto-commit 23b9214
fix package-lock.json
snissn 4bb9010
fix package-lock.json
snissn 01fb3eb
Merge branch 'mikers/documentationFixes' of github.com:consensus-ship…
snissn 0b0b5ca
Apply Prettier formatting
snissn 01977c9
clean up make file path to use latest deploy subnet actor code
snissn 174c1c6
Merge branch 'mikers/documentationFixes' of github.com:consensus-ship…
snissn 52be4ed
commit ABI artifacts
auto-commit 33dea2b
Merge branch 'dev' into mikers/documentationFixes
adlrocha bd80746
Apply Prettier formatting
adlrocha 1bab656
include info on where the json file is stored
snissn adbfd03
Merge branch 'dev' into mikers/documentationFixes
raulk 4880cc2
update README.md
raulk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# Upgrades IPC Gateway Diamond Facets on an EVM-compatible subnet using hardhat | ||
set -e | ||
|
||
if [ $# -ne 1 ] | ||
then | ||
echo "Expected a single argument with the name of the network to deploy (localnet, calibrationnet, mainnet)" | ||
exit 1 | ||
fi | ||
|
||
NETWORK=$1 | ||
|
||
if [ "$NETWORK" = "auto" ]; then | ||
echo "[*] Automatically getting chainID for network" | ||
source ops/chain-id.sh | ||
fi | ||
|
||
|
||
npx hardhat deploy-subnet-registry --network ${NETWORK} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# Upgrades IPC Gateway Diamond Facets on an EVM-compatible subnet using hardhat | ||
set -e | ||
|
||
if [ $# -ne 1 ] | ||
then | ||
echo "Expected a single argument with the name of the network to deploy (localnet, calibrationnet, mainnet)" | ||
exit 1 | ||
fi | ||
|
||
NETWORK=$1 | ||
|
||
if [ "$NETWORK" = "auto" ]; then | ||
echo "[*] Automatically getting chainID for network" | ||
source ops/chain-id.sh | ||
fi | ||
|
||
|
||
npx hardhat deploy-sa-diamond-and-facets --network ${NETWORK} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can a subnet actor be upgraded if it wasn't initially deployed using hardhat but the
ipc-cli
? This would mean that the deployment assets are not available for deployment.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.
I don't know enough about ipc-cli to answer this question.. does ipc-cli end up calling hardhat?
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.
Unfortunately not, it makes a transaction to the registry to trigger the deployment of a new subnet actor. Is there a way to artificially generate a
desployment.json
to help with the upgrade? We may need to come up with a way to allow updates from subnets deployed from the registry.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.
I think I understand better how this code works and what needs to happen for this to work from doing the internal audit. I think that there's a reasonable way through this where we need to add code in ./src/subnetregistry/RegisterSubnetFacet.sol that includes the diamond cut facets and then we will just need to exapnd the facets on the subnet registry to manage the upgrades. we'll need some sort of management for the equivalent of deployment.json but that might not be so bad and it might make sense to store some of these data items on chain in the registry. One last concern is that we may end up with a system that has too many subnets to upgrade in a single block so we should have a fallback there to paginate and may need to think about whether we need to do this upgrade change in a transaction where contracts are paused during the upgarde if it spans multiple txs
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.
Now tracking here: consensus-shipyard/ipc#497