add debug and trace logs across funding flow#1312
Open
doitian wants to merge 1 commit intonervosnetwork:developfrom
Open
add debug and trace logs across funding flow#1312doitian wants to merge 1 commit intonervosnetwork:developfrom
doitian wants to merge 1 commit intonervosnetwork:developfrom
Conversation
Channel-open failures currently surface only at the retry scheduler without enough context to diagnose where in the funding pipeline things went wrong. Add structured debug/trace logs at each significant stage so operators can correlate failures with amounts, peer/channel ids, and tx hashes. - funding_tx: log build entry, UDT cell collection progress and insufficient-cells gap, balanced tx hash + counts, signing, and peer tx verification context; identify which checked_add overflowed. - ckb actor: log Fund/BuildUnsignedFundingTx/VerifyFundingTx/Sign/ SendTx requests with amounts, source lock hash and outcomes. - in_flight_ckb_tx_actor: derive Debug for InFlightCkbTxKind and include tx_hash + tx_kind in start, send_tx, and tracing-result logs. - network: log entry context (channel_id, attempt, amounts, target peer, tx_hash) for do_update_channel_funding, do_sign_funding_tx, fund, send_tx, and abort_funding.
chenyukang
approved these changes
Apr 28, 2026
Collaborator
chenyukang
left a comment
There was a problem hiding this comment.
Reviewed the changes and found no blocking issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds structured debug and trace level logs throughout the funding flow so
that channel-open failures can be diagnosed without reproducing under a
debugger. Previously, failures only surfaced at the retry scheduler with
the bare
FundingError, leaving operators to guess which stage wentwrong (cell collection, balancing, signing, peer verification, broadcast,
or tracing).
Changes
ckb/funding/funding_tx.rsFundingTxBuilder::build,build_funding_cell,build_udt_inputs_outputs,build_base_from_funding_cell, andbuild_and_balance_tx(amounts, reserves, fee rate, source lock hash,tip block, exclusion-map size).
checked_addoverflowed inbuild_funding_cell."insufficient UDT cells" path showing exact found vs needed.
local and remote tx hashes and counts.
ckb/actor.rs—Fund,BuildUnsignedFundingTx,VerifyFundingTx,Sign, andSendTxhandlers now log requests and outcomes.fiber/in_flight_ckb_tx_actor.rs— deriveDebugforInFlightCkbTxKindand includetx_hash+tx_kindinstart,send_tx_interval,send_tx, andreport_tracing_resultlogs.fiber/network.rs— add entry context (channel_id, attempt,amounts, target peer, tx_hash) for
do_update_channel_funding,do_sign_funding_tx,fund,send_tx, andabort_funding.Verification
cargo check -p fnn -p fiber-bincargo clippy --all-targets --all-features -p fnn -p fiber-bin -- -D warningscargo fmt --allNo behavioral changes; only logging additions and a single derived
Debugimpl.This PR description was generated with AI assistance.