-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add new LinearCodeAddressGenerator contract #467
Conversation
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.
Left a couple clarifying questions. My main question is whether index
needs to be tracked in contract or some struct's state or if that's relegated to some lower-level state.
Approved but CI failing. Looks like the go assets need to be updated as well. |
I'm back from time off and looking at this today |
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.
Nice!
Nit: I think address(index: 0) should fail |
right thanks @bluesign. |
Co-authored-by: Tarak Ben Youssef <50252200+tarakby@users.noreply.github.com>
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.
Sweet! Thank you @turbolent, feel free to merge
okay. Can you add a little blurb about it in the README with intended import addresses also like there is for other contracts? Once that is added, I'm okay with you merging it |
@joshuahannan Added the contract to the README. I don't know where the code will be deployed, we can add a table once it is. I initially ported the code assuming it would be needed for some migration code in flow-go, but we don't need it anymore. Even though we don't need it for that purpose, I feel like the functionality is still useful. Maybe it can be deployed to the service account? WDYT? |
yeah, I think the service account makes sense. I'm fine with merging this and deploying it on testnet as soon as you think it is ready. |
@joshuahannan It's ready from my side. It would be nice to merge and close this PR, as it's been open for a while. |
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.
Where is this code used? Does it need to be deployed to flow-go bootstrapping? If so, we should create a getter for it in the lib/go/contracts
package. I can do that if needed
The code is not used anywhere. As I mentioned above, I had originally created it / ported it from the Go code for the migration of on-the-fly account storage format in flow-go, but we did not end up needing it after all. I still think it is useful to have the logic available on-chain, as a system contract that can be trusted. |
Sounds like it probably should be included then so we can deploy it as part of flow-go bootstrapping and probably deploy it to testnet and mainnet. I'll add that |
Port the linear code address generator from https://github.com/onflow/flow-go/blob/master/model/flow/address.go to Cadence.
We'll likely need this for the migration code of onflow/cadence#3584, which will be implemented as a Cadence contract.