Skip to content

Remove dead code identified by coverage analysis - #8425

Open
Amaury Chamayou (achamayou) wants to merge 2 commits into
mainfrom
achamayou-special-broccoli
Open

Amaury Chamayou (achamayou) wants to merge 2 commits into
mainfrom
achamayou-special-broccoli

Conversation

@achamayou

Copy link
Copy Markdown
Member

Motivation

The Coverage workflow reports 77.2% line coverage on main. A line-level pass over the report shows that roughly 750 of the ~15,000 missed lines are framework code with no callers at all, left behind by earlier feature removals. Deleting it makes the coverage numbers reflect code that can actually run, and removes maintenance surface. This is the first PR in a series to raise coverage; the follow-ups add tests.

Implementation summary

Deleted, with the removal that orphaned each item:

  • InternalTablesAccess::remove_member, set_recovery_threshold, is_recovery_participant, is_recovery_owner, is_active_member: pre-JS C++ governance actions, superseded by constitution JS (remove_member/set_recovery_threshold actions), no C++ callers remain.
  • HTTP/2 server streaming API (ServerParser::start_stream/send_data/close_stream/set_on_stream_close_callback, HTTP2StreamResponder and HTTP2ServerSession forwarders, the Streaming response state and per-stream close callback) and the unused http2::ClientParser: added for gRPC server streaming (gRPC server streaming #4537), whose only consumer went with gRPC support (Remove experimental gRPC support #6572). Parser now always creates a server session. read_outgoing_callback and respond() are flattened since only the unary path remains; behaviour on that path is unchanged.
  • NetworkTables::get_all_*_tables() tuple builders: fed the auto-generated wrapper endpoints of the classic governance API, removed in Remove deprecated ("classic") governance API #7080.
  • Store::operator== and untyped::Map::operator==: debugging helpers with no users (the only == on stores in tests compares historical::State, which compares pointers).

Relocated: NullTxHistory/NullTxHistoryPendingTx are test-only stubs, so they move from src/node/history.h to src/kv/test/null_tx_history.h next to the other KV test stubs.

Net: -925/+193 lines. No public headers under include/ccf are touched, so no changelog entry.

Safety and compatibility

No runtime behaviour change: every deleted function had zero call sites (verified by repo-wide search, and the build links with no fallout). The one live path edited is HTTP/2 unary responses, where the removed branches were unreachable (Streaming was never set); e2e_logging_http2 passes locally. No wire formats, KV tables or APIs change, so mixed-version operation and recovery are unaffected.

Validation: Debug -DCOVERAGE=ON build, all 61 unit tests, e2e_logging_http2, and cpp-format/copyright/ascii/todo checks pass locally.

Coverage run 35761555333 flagged several blocks of framework code with no
callers, all left behind by earlier removals:

- InternalTablesAccess::remove_member, set_recovery_threshold,
  is_recovery_participant, is_recovery_owner and is_active_member date from
  the pre-JS C++ governance actions and have no remaining callers.
- The HTTP/2 server streaming API (start_stream/send_data/close_stream,
  stream close callbacks, the Streaming response state) and the unused
  http2::ClientParser were added for gRPC server streaming (#4537), whose
  only consumer was removed with gRPC support (#6572).
- NetworkTables::get_all_*_tables tuple builders fed the auto-generated
  wrapper endpoints of the classic governance API, removed in #7080.
- Store::operator== and untyped::Map::operator== are debugging helpers with
  no users.

NullTxHistory is only used by unit tests, so it moves out of
src/node/history.h into src/kv/test/null_tx_history.h.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 22, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review comments remain, and all reviewers assessed it as approval-ready.

Review effort: Lite
Findings: None

What changed in this PR

Removes confirmed dead framework code and relocates test-only transaction history stubs.

Changes:

  • Removes obsolete governance, HTTP/2 streaming, table-builder, and equality helpers.
  • Simplifies HTTP/2 handling to the active unary server path.
  • Moves NullTxHistory utilities into KV tests.
File Change
src/​service/​network_tables.h Removes unused table builders.
src/​node/​rpc/​test/​frontend_test.cpp Updates test includes.
src/​node/​rpc/​test/​frontend_test_infra.h Uses relocated history stub.
src/​node/​rpc/​http2_session.h Removes streaming APIs.
src/​node/​internal_tables_access.h Removes obsolete governance helpers.
src/​node/​history.h Removes test-only stubs.
src/​kv/​untyped_map.h Removes unused equality helper.
src/​kv/​test/​null_tx_history.h Adds relocated history stubs.
src/​kv/​test/​kv_test.cpp Updates test includes.
src/​kv/​store.h Removes unused equality helper.
src/​http/​http2_types.h Removes streaming state and callbacks.
src/​http/​http2_parser.h Simplifies unary server handling.
src/​http/​http2_callbacks.h Simplifies response callbacks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants