Repository navigation
refactor(common)!: remove unused UniqueKeyViolation/DeadlockDetected re-exports and AuditRegistry/SigRegistry - #2126
Conversation
|
Hey @mbrandenburger 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! PR Checks✅ DCO Sign-off -- All commits have valid sign-offs. Nice work! ❌ GPG Signature -- Heads up! The following commits don't have a verified GPG signature:
You'll need to sign your commits with GPG (e.g. ✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing! ✅ Issue Link -- Linked to #2010 (assigned to you). ⏳ All checks must pass before this PR can be reviewed. You've got this! |
|
Reviewed the fix: correct, no blockers. One optional change before merge, commit message only:
Optional: the new comment at |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
…-exports and AuditRegistry/SigRegistry vault.UniqueKeyViolation and vault.DeadlockDetected re-export the storage-driver sentinels. Nothing outside the vault references them, in FSC or Panurus, and the vault SQL uses upserts, so it never produces a unique-key violation. The commit retry loop now checks dbdriver.DeadlockDetected directly, the same way the committer does. driver.AuditRegistry and driver.SigRegistry have no users. The sig service implements the same methods on its concrete type. Also add godocs to the remaining sigservice.go interfaces, and replace a misleading comment in the retry loop: it returns the error, it does not panic. Closes hyperledger-labs#2010 Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
…cted re-exports and AuditRegistry/SigRegistry Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
d9fb804 to
bf2563a
Compare
…re-exports and AuditRegistry/SigRegistry (hyperledger-labs#2126) vault.UniqueKeyViolation and vault.DeadlockDetected re-export the storage-driver sentinels. Nothing outside the vault references them, in FSC or Panurus, and the vault SQL uses upserts, so it never produces a unique-key violation. The commit retry loop now checks dbdriver.DeadlockDetected directly, the same way the committer does. driver.AuditRegistry and driver.SigRegistry have no users. The sig service implements the same methods on its concrete type. Also add godocs to the remaining sigservice.go interfaces, and replace a misleading comment in the retry loop: it retries a deadlocked batch indefinitely and returns any other error, it does not panic. Breaking: removes the exported vault.UniqueKeyViolation, vault.DeadlockDetected, driver.AuditRegistry and driver.SigRegistry; use platform/view/services/storage/driver.UniqueKeyViolation and DeadlockDetected instead. Closes hyperledger-labs#2010 Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
Fixes #2010
vault.UniqueKeyViolationandvault.DeadlockDetectedre-export the sentinels inplatform/view/services/storage/driver. Nothing outside the vault package uses either one, in FSC or in Panurus. Every unique-key check (sql/common/binding.go,signerinfo.go,auditinfo.go, the sqlite and postgres error mappers) and the committer's retry classification incommitter/failure.gouse the storage-driver sentinels directly. The vault SQL writes only through upserts (ON CONFLICT DO NOTHING/UPDATE), so it never produces a unique-key violation.driver.AuditRegistryanddriver.SigRegistryhave no users; the sig service implements the same methods on its concrete type.Difference from the issue
The issue keeps
DeadlockDetectedas a collapsedvar. It is the same kind of unused re-export, so this PR removes it too. The commit retry loop invault.gonow checksdbdriver.DeadlockDetected, ascommitter/failure.godoes.Other changes in touched files
VerifyingIdentity,SigningIdentityandSigDeserializerinsigservice.gohave Godoc. TheInfodoc states thatauditInfois optional: idemix uses it to add the enrollment ID and fails if it does not match the identity, while x509 ignores it.Compatibility
Breaking only for code that imports the four removed symbols. Both packages are
core/genericanddriverpackages without a compatibility promise. Panurus references only the storage-driverUniqueKeyViolationand none of the removed symbols. Building Panurus against this branch produces the same output as building it againstmain. That build already fails onmain, because Panurus pins FSC v0.24.0 and its mockfsc/mock/fabric_rws.golacksRWSet.GetReadVersion; this PR does not change that.Verification
grep -rn --include='*.go' -E 'UniqueKeyViolation|DeadlockDetected|\b(AuditRegistry|SigRegistry)\b'over all five modules and Panurus finds only the storage-driver sentinels and their direct users.go vet ./...passes in the root, integration, libp2p and cc/query modules.go test -skip Postgres ./platform/common/core/generic/vault/...passes.make checksreports 0 issues; golangci-lint'sunusedcovers the U1000 check. The standalonestaticcheckv0.7.0 named in the issue crashes on Go 1.27 (unexpected expr: *ast.KeyValueExpr), independent of this change.