• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperledger / fabric-x-committer / 30988812892
91%

Build:
DEFAULT BRANCH: main
Ran 05 Aug 2026 08:27AM UTC
Jobs 3
Files 132
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Aug 2026 08:23AM UTC coverage: 90.756% (-0.4%) from 91.125%
30988812892

push

github

web-flow
[vc] Add background snapshot hash worker (#714)

[vc] Add background snapshot hash worker

#### Type of change

- New feature
- Test update

#### Description

- Add a single-goroutine background worker (`runSnapshotHashWorker`)
that
  the committer enqueues immediately after a `_snapshot` txID commits
  (before status is reported downstream), driving the `_snapshot` record
  PENDING -> IN_PROGRESS -> COMPLETED.
- Hash algorithm: per-table SHA-256 over rows in primary-key order with
  length-prefixed encoding `len(key)||key||len(value)||value`, combined
  across tables in sorted table-name order. The hashed table set is
  derived from the `ns__meta` namespace registry plus the fixed system
  tables `ns__meta`, `ns__config`, and `tx_status`; `ns__snapshot`,
  `ns__checkpoint`, and `metadata` are excluded as bookkeeping.
  Per-table hashing runs in parallel (bounded by
  `max-workers-for-snapshot-hash`) with keyset-paginated reads
  (`snapshot-hash-batch-size`) against a short-lived pool opened on the
  clone database.
- Status transitions are retried, versioned UPDATEs against the
  `_snapshot` row (`updateSnapshotState`), reusing the
  `decodeSnapshotState`/`encodeSnapshotState` helpers from the
  clone-creation path (#701). Only one snapshot is hashed at a time
  (single serial worker).
- New `ResourceLimitsConfig` knobs: `max-workers-for-snapshot-hash`
  (default 4) and `snapshot-hash-batch-size` (default 1000), documented
  in the sample config and performance-tuning guide.
- Adds `utils/statedb.TxStatusTableName`.

#### Additional details (Optional)

Tests (`service/vc/snapshot_hash_test.go`): deterministic hash across
namespaces and `tx_status`, hash reflects state changes and excludes the
`_snapshot`/`_checkpoint` bookkeeping namespaces, enqueue/decode
guard behavior, end-to-end commit -> COMPLETED via the background
worker, idempotent re-enqueue, and enqueue cancellation handling. All
async assertions use `require.Eventually`, no `time.Sleep`.

... (continued)

202 of 254 new or added lines in 5 files covered. (79.53%)

26 existing lines in 8 files now uncovered.

10770 of 11867 relevant lines covered (90.76%)

33229.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
46
77.23
service/vc/database_snapshot_hash.go
4
83.81
service/vc/database_snapshot.go
2
88.82
-1.42% service/vc/committer.go

Coverage Regressions

Lines Coverage ∆ File
7
76.94
-1.36% service/sidecar/sidecar.go
6
91.94
-2.84% service/coordinator/signature_verifier_manager.go
5
84.43
-1.73% service/sidecar/relay.go
3
64.71
-17.65% utils/serve/server.go
2
94.74
-5.26% utils/statedb/database_connection.go
1
97.5
2.5% mock/coordinator.go
1
95.58
-0.88% mock/vcservice.go
1
88.99
-0.92% loadgen/adapters/broadcast.go
Jobs
ID Job ID Ran Files Coverage
1 db-test - 30988812892.1 05 Aug 2026 08:28AM UTC 132
78.91
GitHub Action Run
2 unit-test - 30988812892.2 05 Aug 2026 08:28AM UTC 95
84.5
GitHub Action Run
3 core-db-test - 30988812892.3 05 Aug 2026 08:27AM UTC 101
47.9
GitHub Action Run
Source Files on build 30988812892
  • Tree
  • List 132
  • Changed 18
  • Source Changed 0
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 26002747 on github
  • Prev Build on main (#30915313864)
  • Next Build on main (#31094313559)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc