Skip to content

[LN Decentralization E] Extend PendingTree to support pending blocks #8332

@durkmurder

Description

@durkmurder

Context

Currently PendingTree works as part of the follower pipeline for processing batches of certified blocks that are formed by the cache.

PendingTree can be utilized for the participant pipeline but it needs to support both certified blocks and pending blocks, to do this we can extend the PendingTree to operate in two modes(certified and pending blocks).

The vertex in current implementation is represented as:

type PendingBlockVertex struct {
	flow.CertifiedBlock
	connectedToFinalized bool
}

The proposed vertex structure would be:

type PendingBlockVertex struct {
	Proposal             flow.Proposal // always present
	CertifyingQC         *flow.QuorumCertificate // can be nil, if not nil - certified block, if nil - pending block
	connectedToFinalized bool
}

In new vertex structure we have a clear differentiation if it's a pending block or a certified block by observing CertifyingQC field.

Other logic remains largely the same, the only difference would be that the API will change slightly:

instead of AddBlocks we introduce AddCertifiedBlocks([]flow.CertifiedBlock) ([]flow.CertifiedBlock, []flow.Proposal)
and AddPendingBlocks([]flow.Proposal) ([]flow.CertifiedBlock, []flow.Proposal).
Both of them return a pair of block slices that are connected to the finalized state, the difference is that first return value is for certified blocks and second for pending blocks.

Metadata

Metadata

Assignees

Labels

PreserveStale Bot repellentProtocolTeam: Issues assigned to the Protocol Pillar.S-BFT

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions