Repository navigation
feat(frontend): CRDT Merkle-DAG Cryptographic Signatures, Compaction & 3-Way Partition Reconciliation (#309) - #332
Closed
huangji6693-max wants to merge 1 commit into
Conversation
…& 3-Way Partition Reconciliation (LynxXProtocol#309)
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
5 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 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
Closes #309
/claim #309
Implements cryptographic node signing (Ed25519 via
@stellar/stellar-sdkKeypair), Byzantine signature quarantine, Merkle-DAG compaction (>= 60%storage reduction on superseded intermediate milestone updates), and 3-way network partition reconciliation for the offline-first CRDT Merkle-DAG sync layer.Key Changes
merkleDAG.ts,secureVectorClock.ts):signDAGNode,createSignedDAGNode,verifyNodeSignature, andaddSignedNodeonMerkleDAGusing Stellar Ed25519 (Keypair.fromSecret/Keypair.fromPublicKey) over canonical node digests (hash|author|timestamp|parents|payload).createEd25519VectorClock,verifyEd25519VectorClock, andpruneSaturatedVectorClockinsecureVectorClock.tsto protect vector clock increments against Sybil clock-inflation and replay attacks.byzantineHealer.ts):QuarantineReasonwith'bad-signature'and integratedverifyNodeSignatureintoByzantineHealer.heal()so nodes with forged or tampered Ed25519 signatures are immediately quarantined before causal ancestor closure.merkleDAG.ts):encodeMilestonePayload,decodeMilestonePayload, andmaterializeMilestoneStatewith deterministic causal + LWW (timestamp,author,id) ordering.compact()to prune superseded intermediate milestone operations into a signed checkpoint while preserving all terminal heads and final materialized milestone state, achieving >75% storage reduction (exceeding the>= 60%requirement).reconcileThreeWay(replicaA, replicaB, replicaC)to heal 3-way network partitions and deterministically converge all replicas onto the same materialized state and unified multi-parent merge head.Verification
vitest):npx vitest run src/lib/crdt/merkleDAG.test.ts src/lib/crdt/secureVectorClock.test.ts src/lib/crdt/byzantineHealer.test.ts→ 43 / 43 passing'bad-signature'quarantine,>= 60%DAG compaction storage reduction (78.6%measured on 500 intermediate updates), and 3-way partition convergence.npm run lint(oxlint) → 0 errorsnpx tsc -b --noEmit→ 0 errorsnode scripts/ci/check-numeric-ids.mjs→ PASSED