This repository was archived by the owner on May 11, 2026. It is now read-only.
refactor: always allow alias for all spaces#634
Merged
Conversation
Drop the space.voting.aliased opt-in so every space accepts vote/proposal/update-proposal/delete-proposal signed by a valid alias of the author. Promote flag-proposal to EVM as well (it was already allowed on Starknet). See snapshot-labs/workflow#793. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Now that every space is aliased, the optional and Starknet-specific buckets in alias.ts are redundant. Merge them into a single TYPES_EXECUTABLE_BY_ALIAS list and drop the optionalAlias param, isStarknetAddress, getAllowedTypes, and the memoization cache. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ChaituVR
suggested changes
Apr 23, 2026
Member
There was a problem hiding this comment.
We don't want to track the signer on vote, proposal etc? maybe in next PR?
Member
Author
There was a problem hiding this comment.
This would require change in db but I want us to move faster on this and get this merged sooner than later. So yes, that would fit into another PR.
Member
There was a problem hiding this comment.
we can add more test cases:
- verifyAlias('vote', ...) with a valid alias in DB → resolves.
- verifyAlias('proposal', ...) with a valid alias in DB → resolves.
- verifyAlias('update-proposal', ...) with a valid alias in DB → resolves.
- verifyAlias('delete-proposal', ...) with a valid alias in DB → resolves.
- verifyAlias('flag-proposal', ...) with a valid EVM alias in DB → resolves (covers the Starknet → EVM promotion).
- verifyAlias('vote', ...) when DB returns empty → rejects 'wrong alias'.
- verifyAlias('settings', ...) with an alias pair → rejects 'alias not allowed for the type: settings' (already covered, keep).
- verifyAlias('alias', ...) via alias signer → rejects (alias registration itself can't be aliased).
- verifyAlias('vote', ...) where body.address === message.from → resolves without touching DB (no queryAsync call).
6 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes snapshot-labs/workflow#793
Summary
space.voting.aliasedopt-in — every space now acceptsvote,proposal,update-proposal,delete-proposalsigned by a valid alias of the author.flag-proposalto EVM (it was already allowed on Starknet viaTYPES_EXECUTABLE_BY_STARKNET_ALIAS).Kept the diff intentionally minimal (4 lines); the
space.voting.aliasedfield on existing space settings is simply ignored, no migration needed. The three-bucket structure inalias.tsand theoptionalAliasparam stay for now — a follow-up PR can collapse them.Test plan
yarn lintyarn test(needs DB — run in CI)(address=A, alias=B)row inaliases, submit avotesigned by B withmessage.from = Ato a space withoutvoting.aliased. Before: rejected. After: accepted.flag-proposalsigned by an EVM alias of a space admin. Before: rejected. After: accepted.votesigned by B when(A, B)is missing fromaliases→ still rejected withwrong alias(regression check).Follow-ups (separate PRs)
alias.tsinto one flat list; drop the now-always-trueoptionalAliasparameter.signercolumn tovotes/proposals, populated withbody.addresswhen it differs frommessage.from(#793).type(user|agent) to thealiasestable (#793).aliasedfrom thevotingobject in the snapshot.js space JSON schema.🤖 Generated with Claude Code