hyperledger / hyperledger/fabric-x-common

I-3: [proto] Unified SidecarService and clone deletion RPC

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
dependencies enhancement snapshot
Dominant language
Go
Stars
21
Forks
15
Avg merge
2d 19h
Merged PRs (30d)
20

Description

# PR-03 — fabric-x-common: consolidated SidecarService + DeleteDBCloneForSnapshot

**Repo**: `github.com/hyperledger/fabric-x-common` (NOT this repo)
**Tasks**: T057 (consolidation), T055, T056 (DeleteDB message + RPC) — see `the feature task breakdown`.
**Depends on**: PR-01 (snapshot read protos exist).
**Blocks**: PR-05 (go.mod bump), and transitively PR-09 (committer migrates `RegisterService`) and PR-17 (committer implements DeleteDB).

## Why this PR exists

The contracts (`the applicable API contract`) describe a **unified `SidecarService`** that consolidates the sidecar's block delivery, block query, and notification surfaces, and carries the `DeleteDBCloneForSnapshot` mutation. Today the sidecar registers **three separate servers** — `peer.RegisterDeliverServer`, `committerpb.RegisterBlockQueryServiceServer`, `committerpb.RegisterNotifierServer` (`service/sidecar/sidecar.go` `RegisterService`) — and v0.2.7 `committerpb` has **no `SidecarService`**. This PR defines that service in the shared module so later committer PRs can consume it. Without it, PR-09/PR-17 reference a proto service that does not exist.

## Scope

Define the consolidated service and the clone-deletion mutation in `fabric-x-common`. Proto/generated code only — no behavior lives here.

- **T057** — add a unified `SidecarService` to `committerpb` that includes the existing block-delivery, block-query, and notification RPCs (fold the current `BlockQueryService` + `Notifier` method sets, and the Fabric `Deliver` stream, into one service definition) so a single server can back all sidecar client traffic. Keep the old service definitions available during migration if a clean cutover is not possible in one release; document whichever choice you make in the proto comments.
- **T055** — add `DeleteDBCloneForSnapshotRequest { string tx_id = 1; }` exactly per `the applicable API contract`.
- **T056** — add the mutation RPC to `SidecarService`:

```protobuf
rpc DeleteDBCloneForSnapshot(DeleteDBCloneForSnapshotRequest)
returns (google.protobuf.Empty) {};
```

Keep all **reads** (going through `GetRows`, per PR-01) on `QueryService`. Do **not** add this mutation to `QueryService`.

## Out of scope

- Committer `RegisterService` migration → PR-09 (this repo).
- VC clone deletion (admin-triggered only, no retention) → PR-17 (this repo).
- `SnapshotState` and namespace constants → PR-01. No `SnapshotQuery`/other query messages exist — `QueryService` is unchanged, reads use `GetRows`.
- Config policies → PR-02. hold/halt proto → PR-04.

## Verification

```bash
# in the fabric-x-common checkout
make proto
make build
git diff --stat # only proto + generated files changed
```

Confirm generated client/server interfaces expose the unified `SidecarService` with `DeleteDBCloneForSnapshot` plus the consolidated delivery/query/notification methods, and `make proto` produces no inconsistent output.

## Done criteria

- Unified `SidecarService` defined; `DeleteDBCloneForSnapshotRequest` matches the contract.
- `QueryService` remains read-only.
- No committer implementation included.
- One coherent commit; PR opened; **advance the shared tag** PR-05 will pin.

---
Part of EPIC #571 — Snapshot and Checkpointing (tracking epic in fabric-x-committer).

Contributor guide

No contributing guide indexed for this repository

Research direction

In the fabric-x-common checkout, start with the existing committerpb service definitions and generated output; the issue does not name their paths. Run make proto and make build, then verify that the generated SidecarService exposes the consolidated methods and DeleteDBCloneForSnapshot, QueryService remains read-only, and only proto and generated files changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.