You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(covenantsigner): apply audit findings from #3935 rebased onto current base (#3940)
## Problem
PR #3935 was merged into `fix/review-findings`, an intermediate base
branch that was never integrated into
`feat/psbt-covenant-final-project-pr`. This left
`feat/psbt-covenant-final-project-pr` without the audit-finding fixes
that #3935 implemented (createOrDedup mutex extraction, healthz auth
bypass restriction, canonical JSON for handoff payload, error message
improvements, gosec hardening, and more).
## Solution
This PR cherry-picks the squash commit of #3935 onto the current state
of `feat/psbt-covenant-final-project-pr`, which already contains PR
#3933 (Maclane's fault-isolation work plus his subsequent fixes for the
review comments raised on that PR). Three files required manual conflict
resolution where #3935 and #3933 made overlapping changes addressing the
same concerns. In `pkg/tbtc/signer_approval_certificate.go`, the
`ErrMissingWalletID` and `ErrMissingMembersIDsHash` sentinel errors from
#3935 were dropped because Maclane's `ensureWalletRegistryDataAvailable`
function already covers the same case and is in active use; keeping both
would have left the sentinels as dead code. In
`pkg/covenantsigner/server_test.go`, the test rewrite from #3935 (which
depended on a `serviceCtx` parameter to `newHandler`) was reverted in
favor of the existing middleware-based test, which already exercises the
`context.WithoutCancel(r.Context())` detachment path. In
`pkg/covenantsigner/store_test.go`, the test rename collision was
resolved by taking #3935's name
(`TestStoreLoadResolvesInvalidUpdatedAtForDuplicateRouteKeys`).
Three additional cleanups followed from the merge mechanics: the godoc
on `WalletChainData.MembersIDsHash` was updated to reference
`ensureWalletRegistryDataAvailable` instead of the dropped sentinels, an
orphaned `cancelService()` call was removed from `server.go` (its
`serviceCtx` infrastructure did not auto-merge), and a duplicate
`delete(s.byRequestID, existingID)` was deduplicated in `store.go`'s
load path.
## Tests
All tests across `pkg/covenantsigner`, `pkg/tbtc`, and
`pkg/chain/ethereum` pass. A behavioral diff against the base branch
shows identical build, vet, and file-listing outputs, with all `ok`
lines matching except for timing variation. The two adapter tests added
by Maclane (`TestMakeWalletChainData...`) and the two
registry-unavailable tests for the issue-and-verify signer approval
paths are preserved and pass.
0 commit comments