-
Notifications
You must be signed in to change notification settings - Fork 66
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
flow-c1 init doesn't work with flow-go's local net #1669
Comments
I assume the local net is not the cause as it fails during initialization. So, you can skip some steps mentioned above |
@turbolent do you have any insight into this? It's definitely failing because that contract is not upgraded to C1. It's pulled from the system contracts library. |
Looking into, can reproduce the problem with $ go run ./cmd/flow init
# github.com/karalabe/usb
In file included from ../../../go/pkg/mod/github.com/karalabe/usb@v0.0.2/libs.go:50:
../../../go/pkg/mod/github.com/karalabe/usb@v0.0.2/libusb/libusb/os/darwin_usb.c:53:29: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdatomic.h:54:41: note: macro marked 'deprecated' here
Enter the name of your project
> Test
account:
directoryWithBasePath: /var/folders/n6/04ql0mr94nq5qj61wz_lcsx40000gn/T/flow-cli-92178280/cadence/contracts
filenameWithBasePath: /var/folders/n6/04ql0mr94nq5qj61wz_lcsx40000gn/T/flow-cli-92178280/cadence/contracts/Counter.cdc
relativeFilenameWithBasePath: cadence/contracts/Counter.cdc
account:
account:
✔ Yes
Select any core contracts you would like to install or skip to continue.
Use arrow keys to navigate, space to select, enter to confirm or skip, q to quit:
[ ] FlowEpoch
[ ] FlowIDTableStaking
[ ] FlowClusterQC
[ ] FlowDKG
> [x] FlowServiceAccount
[ ] NodeVersionBeacon
[ ] RandomBeaconHistory
[ ] FlowStorageFees
[ ] FlowFees
[ ] FlowToken
[ ] FungibleToken
[ ] NonFungibleToken
[ ] MetadataViews
[ ] ViewResolver
[ ] EVM
🔄 Installing selected core contracts and dependencies...
❌ Command Error: error processing dependency: failed to parse program: Parsing failed:
error: `pub` is no longer a valid access keyword
--> :7:0
|
7 | pub contract FlowServiceAccount {
| ^^^
error: `pub` is no longer a valid access keyword
--> :9:4
|
9 | pub event TransactionFeeUpdated(newFee: UFix64)
| ^^^
error: `pub` is no longer a valid access keyword
--> :11:4
|
11 | pub event AccountCreationFeeUpdated(newFee: UFix64)
| ^^^
error: `pub` is no longer a valid access keyword
--> :13:4
|
13 | pub event AccountCreatorAdded(accountCreator: Address)
| ^^^
error: `pub` is no longer a valid access keyword
--> :15:4
|
15 | pub event AccountCreatorRemoved(accountCreator: Address)
| ^^^
error: `pub` is no longer a valid access keyword
--> :17:4
|
17 | pub event IsAccountCreationRestrictedUpdated(isRestricted: Bool)
| ^^^
error: `pub` is no longer a valid access keyword
--> :20:4
|
20 | pub var transactionFee: UFix64
| ^^^
error: `pub` is no longer a valid access keyword
--> :23:4
|
23 | pub var accountCreationFee: UFix64
| ^^^
error: `pub` is no longer a valid access keyword
--> :29:4
|
29 | pub fun initDefaultToken(_ acct: AuthAccount) {
| ^^^
error: restricted types have been removed; replace with the concrete type or an equivalent intersection type
--> :35:35
|
35 | acct.link<&FlowToken.Vault{FungibleToken.Receiver}>(
| ^^^^^^^^^^^^^
|
I'm new to the Why is it prompting the user to deploy any of these contracts? These core contracts are all part of the bootstrapping process, i.e. deployed when the network starts, as the protocol needs them to function. Also, why are the contracts hard-coded to the Mainnet variants? It looks like that causes the contracts to be pulled from Mainnet – and those contracts are not updated to Cadence 1.0 yet. It looks like this was added in PR #1517, and the issue for it, #1482, doesn't mention the reason why this should be done. I'd say the fix is to remove the core contract deployment – unless I'm missing something, it is not only not needed, but won't work. cc @onflow/flow-cadence-execution |
|
I see! Thanks for the explanation 👍
Yeah, that's what I was wondering about above:
Maybe we need to change flow-cli/internal/super/setup.go Line 275 in 2f5c37f
especially for Cadence 1.0, until it's deployed on TN and MN? |
Why does it parse the programs? To get all the imports? |
Yep, I changed that and it appears to get around the issue, but a new issue comes up where it repeatedly asks about the I started a draft PR with the network change, but we probably shouldn't merge until we figure out the And yeah it parses the programs to get the imports of a contract so you don't have to manually copy/paste every contract and its dependencies and then add to your flow.json. Big time saver. More about it on the docs here: https://developers.flow.com/tools/flow-cli/dependency-manager |
I think I might have fixed all the additional issues related to the addition of the previewnet network on this feature. One of the main ones being it now needed to know which aliases needed to be asked for depending on what network is was pulling from. Give this branch a try if you can. The second issue being it kept asking for @gregsantos @jribbink do you mind reviewing/testing this as well since you are familiar with its behavior? Thanks. |
Nice! For the |
I've made a PR 👍 onflow/flow-go#6211 |
Thanks for adding that @jribbink ! |
Going to merge #1671 , but heads up there will still be some minor non-ideal issues until we have a flow go update with the new system contracts update. |
Looks like some contracts are not updated to cadence1. FCL tries to install them on-chain and fails.
Steps to Reproduce
cd flow-go/integration/localnet
make bootstrap && make start
flow-c1 init
FlowServiceAccount
in the listYou should see the error
flow-c1 version Version: v1.21.0-cadence-v1.0.0-preview.28
The text was updated successfully, but these errors were encountered: