fix: read node certification from NodeStored event payload#214
Open
sameh-farouk wants to merge 1 commit intomaster-cleanup-improvementsfrom
Open
fix: read node certification from NodeStored event payload#214sameh-farouk wants to merge 1 commit intomaster-cleanup-improvementsfrom
sameh-farouk wants to merge 1 commit intomaster-cleanup-improvementsfrom
Conversation
This was referenced Apr 1, 2026
Closed
ada6153 to
f5de569
Compare
3936a00 to
87bda91
Compare
4efd53f to
23cb0b5
Compare
87bda91 to
89ea8cc
Compare
nodeStored hardcoded certification to Diy and never read the actual value from the event payload. Since spec v107, create_node assigns certification from the farming policy (which can be Certified), but the processor ignored it. Nodes created under a Certified farming policy showed as Diy in GraphQL. Now reads certification from the event for all versions that include it: certificationType for v28/v43, certification for v63/v105/v118. The v9 default (Diy) is preserved since v9 Node has no certification field. This matches the pattern already used in nodeUpdated. Fixes: #193 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23cb0b5 to
8ff1cc7
Compare
89ea8cc to
5a438e7
Compare
Member
Author
|
Tested on a test vm |
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
Fixes #193 — inconsistent node certification between chain and GraphQL.
nodeStoredhardcodedcertification = Diyand never read the actual value from theNodeStoredevent payload. Since spec v107,create_nodeassigns certification from the farming policy (which can beCertified), but the processor ignored it.Root cause
On-chain,
_create_nodesetsnew_node.certification = farming_policy.node_certificationand emitsNodeStoredwith the full node struct. The processor received this event but always storedDiy. NoNodeCertificationSetevent is emitted on node creation (never has been, in any spec version), so there was no other path to capture the initial certification.Verification
All 26 affected devnet nodes are associated with farming policy 3 (
nodeCertification: Certified), confirming the root cause.Fix
Read certification from the
NodeStoredevent payload for each version that includes it:Diydefault preserved (correct)certificationType.__kindviaparseNodeCertificationcertification.__kindviaparseNodeCertificationcertification.__kindviaparseNodeCertificationThis matches the pattern already used in
nodeUpdated.Regression safety
isVxxbranch executes per event (mutually exclusive hash checks)Diydefault (line 75) is set before any version-specific block, so it's always overridden for v28+Diyis correctnodeUpdatedandnodeCertificationSethandlers are unchangednpm run buildpassesTest plan
npm run buildpassesCertified