[CAP-46-02] Updated contract lifecycle CAP.#1315
Merged
sisuresh merged 1 commit intostellar:masterfrom Nov 4, 2022
Merged
Conversation
core/cap-0046.md
Outdated
Comment on lines
560
to
577
| + union switch (ContractIDType type) | ||
| + { | ||
| + case CONTRACT_ID_FROM_PUBLIC_KEY: | ||
| + struct | ||
| + { | ||
| + union switch (ContractIDPublicKeyType type) | ||
| + { | ||
| + case CONTRACT_ID_PUBLIC_KEY_SOURCE_ACCOUNT: | ||
| + void; | ||
| + case CONTRACT_ID_PUBLIC_KEY_ED25519: | ||
| + struct | ||
| + { | ||
| + uint256 key; | ||
| + Signature signature; | ||
| + } ed25519KeyWithSignature; | ||
| + } keySource; | ||
| + uint256 salt; | ||
| + } publicKey; |
Member
There was a problem hiding this comment.
Fyi I have this lurking memory that some of the SDKs don't do well with many nested layers of anonymous types, and we might need to make each layer in this XDR type a named type. We can see how it plays out first, but definitely remember experiencing some pain with structures defined anonymously with more than 2 levels deep in the past.
Contributor
Author
There was a problem hiding this comment.
Sounds good, reduced the nesting. I still left a couple anonymous structs, but as they're no longer nested this shouldn't hopefully be a problem.
The main updates: - Change `InvokeHostFunctionOp` to use XDR for contract creation args, as it's getting quite complex and doesn't ever need to be called from the contracts. - Decouple WASM sources from the contract instances in order to deduplicate contracts that share their code. - Change the contract-from-contract creation to use the code reference instead of the actual code - Removed some outdated parts that don't allow well with the current implementation/vision
f239db8 to
67b8add
Compare
sisuresh
approved these changes
Nov 4, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: This includes the configuration update commit that belongs to #1291, so the diff from CAP-46-09 commit should be ignored while reviewing this.
The main updates:
InvokeHostFunctionOpto use XDR for contract creation args, as it's getting quite complex and doesn't ever need to be called from the contracts.Some debatable decisions:
ed25519key for now. This is not because I necessarily think we should never have those, but because I'd like to make sure it would align with the auth patterns in case if we change them.