Context
From PR #909 review (ch4r10t33r, item #5, partial).
PR #909 already collapsed the public ensureBlocksByRootRequest / ensureBlocksByRootRequestToPeer / ensureBlocksByRootRequestWithPeer into a single ensureBlocksByRootRequest(..., preferred_peer: ?[]const u8).
The same pattern exists at the BeamNode layer: fetchBlockByRoots and fetchBlockByRootsFromPeer are both private and could be collapsed into one function with an optional preferred_peer parameter. However, fetchBlockByRoots has 8+ call sites, so the refactor was deferred to avoid churn in the review cycle.
Proposal
Rename fetchBlockByRootsFromPeer → fetchBlockByRoots with a preferred_peer: ?[]const u8 parameter and update all call sites to pass null where no preference exists.
Related: PR #909
Context
From PR #909 review (ch4r10t33r, item #5, partial).
PR #909 already collapsed the public
ensureBlocksByRootRequest/ensureBlocksByRootRequestToPeer/ensureBlocksByRootRequestWithPeerinto a singleensureBlocksByRootRequest(..., preferred_peer: ?[]const u8).The same pattern exists at the
BeamNodelayer:fetchBlockByRootsandfetchBlockByRootsFromPeerare both private and could be collapsed into one function with an optionalpreferred_peerparameter. However,fetchBlockByRootshas 8+ call sites, so the refactor was deferred to avoid churn in the review cycle.Proposal
Rename
fetchBlockByRootsFromPeer→fetchBlockByRootswith apreferred_peer: ?[]const u8parameter and update all call sites to passnullwhere no preference exists.Related: PR #909