Skip to content

fix fork host manager gflag#308

Merged
lokax merged 2 commits into
mainfrom
yf-fork-tx
Dec 23, 2025
Merged

fix fork host manager gflag#308
lokax merged 2 commits into
mainfrom
yf-fork-tx

Conversation

@lokax

@lokax lokax commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

Here are some reminders before you submit the pull request

  • Add tests for the change
  • Document changes
  • Reference the link of issue using fixes eloqdb/tx_service#issue_id
  • Reference the link of RFC if exists
  • Pass ./mtr --suite=mono_main,mono_multi,mono_basic

Summary by CodeRabbit

  • Chores

    • Improved transaction service initialization to more reliably select the configured host-manager source.
  • New Features

    • Attach request now exposes renamed configuration fields and adds an optional engine-specific configuration path for attaching a transaction service.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 19, 2025 07:12
@coderabbitai

coderabbitai Bot commented Dec 19, 2025

Copy link
Copy Markdown

Walkthrough

Inverted the boolean decision computing fork_hm_process in InitializeTxService. Updated AttachTxServiceRequest in the protobuf: two fields renamed and a new engine_specific_config_path string field (field 4) added.

Changes

Cohort / File(s) Summary
Initialization Logic Adjustment
core/src/tx_service_init.cpp
Inverted the condition used to compute fork_hm_process in InitializeTxService: the code now uses the negation of CheckCommandLineFlagIsDefault("fork_host_manager"), flipping whether FLAGS_fork_host_manager or the config value is selected.
Protobuf Field Renames & Addition
tx_service/include/proto/cc_request.proto
In AttachTxServiceRequest: renamed field 2 tx_service_bin_pathservice_bin_path; renamed field 3 tx_service_config_pathdata_substrate_config_path; added field 4 engine_specific_config_path (type string).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Attention areas:
    • Confirm the inversion of fork_hm_process is intentional and consistent with startup/runtime expectations and any docs or flags.
    • Audit call sites, tests, and startup scripts that depend on fork_host_manager behavior.
    • Ensure protobuf field renames and the new field are reflected in regenerated stubs and that wire compatibility is preserved where required.

Poem

🐰 I nudged a flag beneath the loam,
Names hopped over to a new home.
A little path arrived to play,
Quiet changes, bright as day.
🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains an empty checklist template with no implementation details, rationale, or issue references filled in. Complete the description by filling in implementation details, the issue number (using 'fixes eloqdb/tx_service#issue_id'), RFC links if applicable, and any other relevant context about the changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'fix fork host manager gflag' accurately describes the main change in the first file (inverting fork_hm_process assignment logic), but the PR includes additional unrelated changes to proto field names. Clarify whether proto field renaming is intentional or should be in a separate PR. If intentional, update title to reflect both changes (e.g., 'Fix fork host manager gflag and rename proto fields').
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch yf-fork-tx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a logic bug in the gflag handling for fork_host_manager and adds a new configuration field to the AttachTxServiceRequest proto message.

  • Corrects inverted logic for checking if the fork_host_manager flag was explicitly set
  • Adds eloqdoc_yaml_config_path field to AttachTxServiceRequest

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
core/src/tx_service_init.cpp Fixes bug where fork_host_manager flag priority was inverted - now correctly uses command-line flag when set, falling back to config file otherwise
tx_service/include/proto/cc_request.proto Adds new eloqdoc_yaml_config_path field to AttachTxServiceRequest message for passing YAML config path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70bb69a and 2a33ec7.

📒 Files selected for processing (2)
  • core/src/tx_service_init.cpp
  • tx_service/include/proto/cc_request.proto
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/tx_service_init.cpp
🔇 Additional comments (2)
tx_service/include/proto/cc_request.proto (2)

647-652: Clarify the connection between field changes and the gflag fix.

The PR title mentions "fix fork host manager gflag", but the relationship between the boolean inversion mentioned in the AI summary and these protobuf field changes is unclear. Could you provide additional context on:

  1. How do these field renames relate to the gflag fix?
  2. What specific issue was the gflag fix addressing?
  3. Is engine_specific_config_path the new field that enables the corrected gflag behavior?

649-650: Clarify whether fields were actually renamed or if these are new definitions.

The fields service_bin_path and data_substrate_config_path do not appear to have been renamed from previous versions—they're only present in this proto file with no prior history. If this is a fresh message definition, the breaking change concern is not applicable. If this represents an actual rename, please confirm the original field names and indicate where they were in use.

Likely an incorrect or invalid review comment.

string tx_service_config_path = 3;
string service_bin_path = 2;
string data_substrate_config_path = 3;
string engine_specific_config_path = 4;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for usages of engine_specific_config_path across the codebase
echo "=== Searching for engine_specific_config_path usages ==="
rg -n 'engine_specific_config_path' -A 2 -B 2

echo ""
echo "=== Check if field is in the proto definition ==="
rg -n 'engine_specific_config_path' tx_service/include/proto/cc_request.proto -A 1 -B 1

echo ""
echo "=== Search in tx_service_init files ==="
fd -t f 'tx_service_init' --exec rg -l 'engine_specific_config_path' {}

Repository: eloqdata/tx_service

Length of output: 665


🏁 Script executed:

#!/bin/bash
# Search for proto-generated files
echo "=== Looking for generated proto files ==="
fd -t f '\.(pb|cc|h)' | grep -i 'request' | head -20

echo ""
echo "=== Search for any reference to the struct containing this field ==="
rg -n 'struct.*Config.*Path' -A 5

echo ""
echo "=== Look for where cc_request proto is used/imported ==="
rg -n 'cc_request' -A 1 -B 1 | head -30

echo ""
echo "=== Check if there are any TODO or FIXME comments near the field ==="
rg -n 'engine_specific|TODO|FIXME' tx_service/include/proto/cc_request.proto -B 3 -A 3

Repository: eloqdata/tx_service

Length of output: 2324


🏁 Script executed:

#!/bin/bash
# Check the C++ header file
echo "=== Checking cc_request.h ==="
cat tx_service/include/cc/cc_request.h | head -100

echo ""
echo "=== Check what message contains engine_specific_config_path ==="
rg -n 'message.*{' tx_service/include/proto/cc_request.proto -A 50 | grep -B 20 'engine_specific_config_path'

echo ""
echo "=== Search for ForkHostManager references ==="
rg -n 'ForkHostManager' --type=cpp --type=cc -B 1 -A 1 | head -40

Repository: eloqdata/tx_service

Length of output: 3149


🏁 Script executed:

#!/bin/bash
# Read the proto file to find the message containing the field
echo "=== Full view of relevant section in proto file ==="
sed -n '640,660p' tx_service/include/proto/cc_request.proto

echo ""
echo "=== Search for all message definitions around line 651 ==="
sed -n '630,660p' tx_service/include/proto/cc_request.proto

echo ""
echo "=== Search for field access patterns ==="
rg -n '\\.engine_specific_config_path' --type=cpp -B 2 -A 2

echo ""
echo "=== Search for set/assignment patterns ==="
rg -n 'set_engine_specific_config_path' --type=cpp -B 2 -A 2

echo ""
echo "=== Look for mutable field access ==="
rg -n 'mutable_engine_specific_config_path' --type=cpp -B 2 -A 2

Repository: eloqdata/tx_service

Length of output: 1276


🏁 Script executed:

#!/bin/bash
# Search for AttachTxServiceRequest instantiation and usage
echo "=== Search for AttachTxServiceRequest creation/usage ==="
rg -n 'AttachTxServiceRequest' --type=cpp -B 1 -A 3

echo ""
echo "=== Check if field is optional in proto ==="
cat tx_service/include/proto/cc_request.proto | grep -A 10 'message AttachTxServiceRequest'

Repository: eloqdata/tx_service

Length of output: 441


Consuming code for engine_specific_config_path field is missing.

The new field is defined in AttachTxServiceRequest but has no usages anywhere in the codebase. Neither the field nor the containing message is instantiated or accessed by any code. Implement the consuming code to populate and use this field, or remove it if unneeded.

🤖 Prompt for AI Agents
In tx_service/include/proto/cc_request.proto around line 651, the new field
engine_specific_config_path is declared but never consumed; either remove the
field if it is not needed, or update code paths that construct and handle
AttachTxServiceRequest to populate and use it. If keeping the field: identify
where AttachTxServiceRequest instances are created (handlers, client calls,
tests), add a source for the path (service config, CLI flag, environment
variable or per-engine config loader), set the engine_specific_config_path when
building the request, propagate it through any RPC handlers and server-side
processors that read the message, and add unit/integration tests and API docs
for the new behavior. If removing: delete the field from the proto and
regenerate language bindings and remove any dead references or tests.

@lokax lokax merged commit 84f8234 into main Dec 23, 2025
4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jan 7, 2026
5 tasks
@lokax lokax deleted the yf-fork-tx branch February 26, 2026 10:14
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.

3 participants