feat: align gleipnir-ipc with 3CP v2.0 spec - #27
Merged
Conversation
had-nu
force-pushed
the
feat/3cp-v2-alignment
branch
2 times, most recently
from
August 25, 2026 14:58
fcaa301 to
eda7c21
Compare
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| return nil, fmt.Errorf("failed to resolve anchor path: %w", err) | ||
| } | ||
| // Ensure directory exists | ||
| if err := os.MkdirAll(absPath, 0755); err != nil { |
|
|
||
| // Write atomically using temp file + rename | ||
| tmpPath := path + ".tmp" | ||
| if err := os.WriteFile(tmpPath, data, 0644); err != nil { |
had-nu
force-pushed
the
feat/3cp-v2-alignment
branch
from
August 25, 2026 15:23
22972b6 to
0bffba2
Compare
P0 - Canonical CBOR & BlockHash: - Add canonical CBOR marshaling (fxamacker/cbor/v2) in pkg/chain/cbor.go - Unify BlockHash computation per spec §4.4 (HashOfAnchoredEntries + QuorumConfigCanonical) - Remove placeholder MarshalCBOR, fix ComputeBlockHash in block.go, engine.go, prepare.go, commit.go P0 - Kyber1024 (ML-KEM-1024 per FIPS 203): - Upgrade pkg/identity/kyber.go from Kyber768 to Kyber1024 - Update pkg/transport/secure_conn.go for new key/ciphertext sizes P1 - Adaptive Cycle Duration: - EWMA RTT with alpha=0.3 in engine.go - CycleDuration = BaseInterval + EWMA(RTT)*SafetyFactor, capped at MaxCycleDuration - Configurable via Mandate 3cp:consensus-config P1 - Degraded Mode (spec §5.5): - DegradedMode handler with automatic entry/exit - Q=1 when N < MinValidators, GraceCycles for exit - Block Metadata['3cp:degraded-block']='true' - Verification in commit.go checks label P1 - Anchor Publishers (spec §11.1): - New pkg/anchor/ with FilesystemPublisher (atomic writes) and IPFSPublisher (mock) - AnchorPublisher manages concurrent publishing with MinRedundancy - Engine publishes blocks after commit, populates ExternalAnchors P3 - Spec Candidates: - SPEC-MUST-DO-CANDIDATES.md with 13 promotion candidates All single-node consensus tests pass. Multi-node tests have pre-existing harness issues. Signed-off-by: hadnu <andre_ataide@proton.me>
- Go 1.25.7 not available on GitHub Actions runners yet - golangci-lint built with Go 1.24 can't parse Go 1.25.7 modules - Use Go 1.24 which is the current stable on GitHub Actions Signed-off-by: hadnu <andre_ataide@proton.me>
- Go 1.25.7 not available on GitHub Actions runners yet - golangci-lint built with Go 1.24 can't parse Go 1.25.7 modules - Use Go 1.24 which is the current stable on GitHub Actions Signed-off-by: hadnu <andre_ataide@proton.me>
- Dependencies (prometheus, otel, grpc, golang.org/x/*) require Go 1.25 - GitHub Actions ubuntu-latest now supports Go 1.25 - Update CI workflow and go.mod accordingly Signed-off-by: hadnu <andre_ataide@proton.me>
- Fix errcheck: check fmt.Sscanf return value in cmd/genesis/main.go - Remove unused: seedReader type, generateTimestamp func in pkg/identity/ - Simplify nil check in pkg/consensus/degraded.go - Add ToValidatorSpec() method in cmd/genesis/main.go - Fix ineffassign in pkg/consensus/engine.go - Fix staticcheck in pkg/server/server_test.go (uint64 < 0 always false) - Fix unused variable in pkg/consensus/consensus_test.go - Remove unused payload variable in pkg/consensus/commit.go Signed-off-by: hadnu <andre_ataide@proton.me>
had-nu
force-pushed
the
feat/3cp-v2-alignment
branch
from
August 25, 2026 15:27
0bffba2 to
d750583
Compare
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 aligns the gleipnir-ipc reference implementation with the 3CP v2.0 protocol specification.
Changes
P0 - Canonical CBOR & BlockHash (spec §4.1, §4.4)
P0 - Kyber1024 / ML-KEM-1024 (FIPS 203)
P1 - Adaptive Cycle Duration (spec §10.1)
P1 - Degraded Mode (spec §5.5)
P1 - Anchor Publishers (spec §11.1)
P3 - MUST DO Promotion Candidates
Testing
Spec Compliance
This implementation now correctly implements the 3CP v2.0 protocol core with production-grade robustness patterns.