refactor(tbtc): split node into per-concern files#4193
Open
piotr-roslaniec wants to merge 1 commit into
Open
Conversation
The pkg/tbtc/node.go file had grown to ~1450 LOC covering the node struct plus signing/coordination/inactivity executors, wallet-action proposal handlers, the coordination layer, wallet closure, and block helpers. Split it into per-concern files within the same package: - node.go core struct, constructor, accessors, DKG entry - node_executors.go signing/coordination/inactivity executors - node_proposals.go wallet-action proposal handlers - node_coordination.go coordination layer loop - node_wallet_closure.go closed-wallet archival and closure - node_block.go block-height wait helpers Pure relocation: declarations are moved verbatim, no behavioral change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughTBTC node orchestration was split from ChangesTBTC node orchestration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant BlockCounter
participant Node
participant CoordinationExecutor
participant WalletDispatcher
BlockCounter->>Node: detect coordination window
Node->>CoordinationExecutor: coordinate wallet window
CoordinationExecutor-->>Node: return coordination result
Node->>WalletDispatcher: dispatch corresponding wallet action
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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.
What
Splits the ~1450-LOC
pkg/tbtc/node.gomonolith into per-concern files within the same package:node.gonodestruct,newNode, accessors, DKG entry (joinDKGIfEligible,validateDKG)node_executors.gonode_proposals.gonode_coordination.gorunCoordinationLayer,executeCoordinationProcedure,processCoordinationResult)node_wallet_closure.gonode_block.gonode.godrops from ~1450 to ~300 LOC.Why
node.gowas one of the two largest monoliths in the package and mixed several unrelated concerns, making it hard to navigate. This is the companion to the tBTC chain-adapter split.Safety
Pure relocation, no behavioral change. Declarations are moved verbatim; every top-level declaration body was hashed before and after the split and confirmed byte-for-byte identical. Per-file imports were pruned with
goimports.go build,go vet,gofmt -l, and the fullpkg/tbtctest suite all pass.Since everything stays in
package tbtc, cross-file references resolve unchanged.Summary by CodeRabbit