feat: add plugin-owned primitive registry and firmware-gated reqs#728
Open
yilmazbahadir wants to merge 4 commits intodevfrom
Open
feat: add plugin-owned primitive registry and firmware-gated reqs#728yilmazbahadir wants to merge 4 commits intodevfrom
yilmazbahadir wants to merge 4 commits intodevfrom
Conversation
…ents Migrate EVM/Solana/Cosmos/XRP lattice signers to resolve primitives via registry, add transactional chain registration, and extend unit test coverage.
70f9fae to
a83c402
Compare
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d308cf86e2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…imitives on unregister Add lattice signer fallback to EXTERNAL.SIGNING when resolvePrimitive is absent, and remove plugin-owned primitive definitions during unregisterChain to prevent stale conflicts.
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.
📝 Summary
This PR implements a plugin-owned primitive registry so adding/migrating chains no longer requires broad SDK helper coupling.
It introduces primitive definitions/requirements on chain plugins, migrates current Lattice signers (
evm,solana,cosmos,xrp) to runtime primitive resolution, and enforces explicit firmware gating viaminFirmware(nobaselineshorthand).🔧 Context / Implementation
PrimitiveKind,PrimitiveDefinition,PrimitiveRequirement,PluginPrimitivesprimitives?: PluginPrimitivesonChainPlugincreatePrimitiveRegistry,preflight, atomicregister,resolve,resolveOrThrow,reverseResolve,has,list,reset(test isolation)EXTERNAL.SIGNING.{HASHES,CURVES,ENCODINGS}minFirmwareuseChain()before signer creation.evm,solana,cosmos,xrp) tocontext.resolvePrimitive(...)for signing primitive codes.SECP256K1,KECCAK256,EVMED25519,NONE,SOLANASECP256K1,SHA256,COSMOSSECP256K1,SHA512HALF,XRPmin firmware: 0.18.0).GET_ADDR_FLAGSand existinggetFwVersionConst()behavior unchanged in this PR.Concrete developer experience — what a new chain plugin author writes:
🧪 Test Plan
pnpm --filter @gridplus/chain-core typecheckpnpm --filter gridplus-sdk typecheckpnpm --filter gridplus-sdk test-unitExpected result: all commands pass, registration remains fail-safe/transactional, and signer payloads resolve primitive codes via registry with correct firmware gating behavior.
🖼️ Screenshots (if applicable)