Documentation
¶
Index ¶
- func ApplyHighestOpCountsToProposal(lggr logger.Logger, proposalPath string, ...) error
- func ComputeHighestOpCountsFromPredecessors(lggr logger.Logger, newProposalData ProposalsOpData, predecessors []PRView) map[mcmstypes.ChainSelector]uint64
- type CLDContext
- type McmOpData
- type PRHead
- type PRNum
- type PRView
- type ProposalsOpData
- type ProposalsPRGraph
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyHighestOpCountsToProposal ¶
func ApplyHighestOpCountsToProposal( lggr logger.Logger, proposalPath string, newOpCounts map[mcmstypes.ChainSelector]uint64, ) error
ApplyHighestOpCountsToProposal updates the proposal file with the new starting op counts.
func ComputeHighestOpCountsFromPredecessors ¶
func ComputeHighestOpCountsFromPredecessors( lggr logger.Logger, newProposalData ProposalsOpData, predecessors []PRView, ) map[mcmstypes.ChainSelector]uint64
ComputeHighestOpCountsFromPredecessors looks at the given predecessors, and for each chain present in 'newProposalData', computes the new starting op count as: current StartingOpCount (from the new proposal) + SUM of the number of ops across ALL predecessors that share the same chain selector AND the same MCM address. We assume that the predecessors are sorted from oldest to newest, so we can log them in that order. Returns:
- newStartPerChain: map[chain] = baseline + sum(ops)
Types ¶
type CLDContext ¶
CLDContext holds the context for the GitHub repository where the PRs are managed.
type McmOpData ¶
func (McmOpData) EndingOpCount ¶
EndingOpCount returns the exclusive end opcount: StartingOpCount + OpsCount. Treat it as the end of a half-open interval [StartingOpCount, EndingOpCount()).
type PRView ¶
type PRView struct {
Number PRNum
CreatedAt time.Time
Body string
Head PRHead
Proposal *mcms.TimelockProposal
ProposalData ProposalsOpData
ProposalFilename string
ProposalContent string
}
type ProposalsOpData ¶
type ProposalsOpData map[mcmstypes.ChainSelector]McmOpData
func ParseProposalOpsData ¶
func ParseProposalOpsData(ctx context.Context, filePath string) (ProposalsOpData, error)
ParseProposalOpsData uses mcms for a local file path (current proposal) to get op counts.
type ProposalsPRGraph ¶
type ProposalsPRGraph struct {
Nodes map[PRNum]*prNode // node lookup by PR number
Topo []PRNum // topologically sorted PR numbers (older -> newer respecting deps)
}
ProposalsPRGraph is a dependency graph of proposals where an edge u -> v means: "u must precede v" (they share at least one MCM on some chain and u is older).
func BuildPRDependencyGraph ¶
func BuildPRDependencyGraph(views []PRView) (*ProposalsPRGraph, error)
BuildPRDependencyGraph creates a DAG with edges ONLY from older -> newer, and only when relatedByMCMOnAnyChain(...) is true. Ties on CreatedAt are broken by PR number (smaller = older).