Revert network key encryption, fix findings in original code - #2841
Revert network key encryption, fix findings in original code#2841nkryuchkov wants to merge 4 commits into
Conversation
This reverts commit c2fb7be.
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Greptile SummaryThis PR reverts the persisted P2P network key encryption from PRs #2765 and #2838, restoring plaintext-only key storage to reduce rollout risk. The rollback bridge (
Confidence Score: 5/5Safe to merge — this is a targeted revert to plaintext-only P2P key storage, with the bridging migration already deployed on stage. The change removes well-scoped encryption wiring (endpoints, identity store protection hooks, AES helpers) and restores the simple plaintext read/write path. Previously identified issues with nil-pointer ordering and silent DB error swallowing in identity/store.go have been properly addressed in this version. A repo-wide grep confirms no stale callers remain for any of the deleted symbols. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Node as SSV Node (startup)
participant P2P as setupP2P()
participant IS as identityStore
participant DB as BadgerDB
Node->>P2P: setupP2P(logger, db)
P2P->>IS: NewIdentityStore(logger, db)
P2P->>IS: SetupNetworkKey(skEncoded)
IS->>DB: Get("p2p-", "private-key")
alt Key found in DB
DB-->>IS: (obj, true, nil)
IS->>IS: decode(obj.Value) → gcrypto.ToECDSA
IS-->>P2P: privateKey (plaintext)
else No key in DB
DB-->>IS: (_, false, nil)
IS->>IS: ECDSAPrivateKey(skEncoded) — generate/parse
IS->>DB: Set("p2p-", "private-key", gcrypto.FromECDSA(key))
IS-->>P2P: privateKey (plaintext)
end
P2P-->>Node: P2PNetwork
Reviews (2): Last reviewed commit: "fix review comments" | Re-trigger Greptile |
|
@greptileai review this again |
| "fmt" | ||
|
|
||
| gcrypto "github.com/ethereum/go-ethereum/crypto" | ||
| "github.com/pkg/errors" |
There was a problem hiding this comment.
Hey, just to check something — was switching back to pkg/errors here intentional? #2825 just replaced it with stdlib repo-wide, and after this revert lands identity/store.go looks like the only file still importing github.com/pkg/errors (now // indirect in go.mod). Happy to keep it as faithful-revert if you'd rather, just figured worth flagging.
|
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 30 days if there are no updates. Please comment if you would like to keep it open. |
Summary
Revert #2765 and #2838.
Why
We decided to move persisted P2P network key encryption to a future release to reduce rollout risk.
#2838 was a temporary rollback bridge that downgraded already-migrated stage DBs back to plaintext. Now that it has been deployed, we can remove both:
What changed
stagechanges unrelated to#2765and#2838identity/store.go:pk.Curvessvsigner/ekm/signer_storage.goto<= nonceSizeTesting
go test ./identity ./cli/operatorgo test ./ekminssvsigner/make golangci-lintmake deadcode-lint