Skip to content

[SPIN] Add docs for secondary leader election mechanism - #74

Closed
rnbta wants to merge 1 commit into
mainfrom
rnbta/secondary-leader-adr
Closed

[SPIN] Add docs for secondary leader election mechanism#74
rnbta wants to merge 1 commit into
mainfrom
rnbta/secondary-leader-adr

Conversation

@rnbta

@rnbta rnbta commented Apr 10, 2025

Copy link
Copy Markdown
Contributor

aka ADR

Related to QuantumFusion-network/spec#248

@rnbta
rnbta marked this pull request as ready for review April 10, 2025 09:41
@rnbta
rnbta requested review from AlexLgn, Copilot and khssnv April 10, 2025 09:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.


1. **Deterministic Secondary Author:** For any given slot `S`, we already have the primary author `P_primary` determined by `slot_author`. We need to define a deterministic way to find the *secondary* author, `P_secondary`, for that same slot `S`. A simple and common approach is to pick the *next* authority in the current session's round-robin order.

* Modify `slot_author` or add a new function, e.g., `get_slot_authors(slot, session_length, authorities)` that returns `Option<(PrimaryAuthorityId, SecondaryAuthorityId)>`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_slot_authors seems better to me, otherwise, why have only one secondary when we can iterate over all the validators until the list is exhausted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, that's just authority set as a whole then, no?

### Decision Drivers (Optional)


### Alternatives Considered

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consider an alternative to T_wait, I mean with with the secondary leader always on and producing blocks which the rest of the network doesn't finalize while there are blocks from the primary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't finalize but block is produced and included in the chain?

@rnbta

rnbta commented Apr 10, 2025

Copy link
Copy Markdown
Contributor Author

closed in favour of QuantumFusion-network/spec#288

@rnbta rnbta closed this Apr 10, 2025

## Context

The core idea is to allow a designated secondary author to produce a block for a slot if the primary author fails to do so within a reasonable timeframe. Verification must be possible using only the block header and the parent state.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reasonable timeframe
add somewhere description of this timeframe:

  • is it some parameter, e.g. we wait this time until secondary leader starts producing blocks and then switch to next is he fails?
  • or it's metric to be determined later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants