refactor(lee): refactor private kinds - #660
Open
agureev wants to merge 1 commit into
Open
Conversation
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.
🎯 Purpose
This refactor is the first step in the environment unification task with the "north star" being #650.
Its goal is twofold:
reduce amount of production code by getting rid of combinatorial enum structure in favor of a united
PrivateWitnessstruct carrying information about init/updates and common info such as nullifier and key information all account carry regardless of kind.ensure an interface which is easier to update if we introduce more keys (either shared or specific to the account kind) such as the authorization key for the regular private accounts. this way there is a centralized struct to update instead of disjoint enums.
Hence this will make authorization key addition more seemless.
As authorization information is currently determined protocol-wide (e.g. enforcing authorization for all regular private accounts) removing separate authorization-varying enum information does not impact the logic.
⚙️ Approach
The approach is to replace the combinatorial private
InputAccountIdentityenum by aPrivate(WitnessKind)enum variant withWitnessKindstruct specifying whether an account is init or updated.NullifierWitnessstruct carrying information about init/update of the account plaintextPrivateWitnessstruct carrying common private account information such as identifier and npk/vpkInputAccountIdentityprivate enums with onePrivate(PrivateWitness)enum.🧪 How to Test
RISC0_DEV_MODE=1 cargo nextest run --workspace --exclude integration_tests --all-features --no-fail-fast🔗 Dependencies
#604
🔜 Future Work
Further environment unification tasks guiding towards #650.
📋 PR Completion Checklist