-
Notifications
You must be signed in to change notification settings - Fork 341
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
feat: support realm subpackages #365
Conversation
Thank you very much; I need to figure out the best way to combine your PR and #336. But that’s clearly going in the good direction. |
pkgs/sdk/vm/keeper.go
Outdated
// Add package account. | ||
pkgAcc := vm.acck.NewAccountWithAddress(ctx, pkgAddr) | ||
ga := pkgAcc.(*types.GnoAccount) | ||
ga.PackageAccount = &types.PackageAccount{ | ||
Owner: creator, | ||
} | ||
vm.acck.SetAccount(ctx, ga) |
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.
What do you think about removing this part and make the creator != rootAcc.Owner
recompute the parent realm’s author dynamically?
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.
Hey @anarcher
Thank you very much for this PR. It goes precisely in the good direction.
To be more future-proof, where a contract developer will not have only one top-level realm but multiple ones, including shared ones for organizations. I’ll ask you to revert the extended account with the “owner” part and make runtime computing for permissions.
So basically, only keep (and adapt):
- pgks/std/memfile.go
- pkgs/sdk/vm/keeper.go
In an upcoming PR, I'll add support for realm reservation, linked with a new system-wide namespace realm + team support. And I will extend your work.
Thanks for kind feedback @moul :-)
I like your idea( I will revert the extended account with the “owner” part and then making runtime permission. |
Hi @moul, What do you think about? Do you have better idea? :-) |
Hey @anarcher, I appreciate that you want to help, but I prefer that we split the topic:
My idea is similar to yours but without the chicken-eggs problem :) |
I revert
👍 I'm curious about your idea :-) |
Another my idea about it is that each top-realm( |
Thank you! I’ll rebase and add new comments on my other PR so you can contribute too if you want :) |
Please, check out #375 |
Large program (included smart contracts?) has constructed with packages. Like normal packages (
gno.land/p
), This PR is for realm sub(nested) packages like below.IMHO, Subpackages can be helpful in the versioned or upgradable realm.
For realm's ownership, A creator should be equal to root realm(
gno.land/r/<root>
) and sub realms (gno.land/r/<root>/<sub>
). So I addedPackageAccount.Owner
toGnoAccount
.This is a realm package account
This is an normal account.