Skip to content

SPIN secondary leader selection mechanism #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rnbta
Copy link
Collaborator

@rnbta rnbta commented Apr 10, 2025

No description provided.

@rnbta rnbta requested review from kirushik, khssnv, dedok and AlexLgn April 10, 2025 12:45
@rnbta rnbta self-assigned this Apr 10, 2025

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
Collaborator Author

Choose a reason for hiding this comment

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

@khssnv: "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
Collaborator Author

Choose a reason for hiding this comment

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

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

### Decision Drivers (Optional)


### Alternatives Considered
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@khssnv: 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
Collaborator 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?


## 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
Member

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?

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)>`.
* The secondary could be `authorities[(primary_index + 1) % authorities.len()]`. Handle edge cases like only one authority.
Copy link
Member

Choose a reason for hiding this comment

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

Handle edge cases like only one authority.
describe that edge cases are handled by a minimum number of validators, which is regulated by network and staking parameters

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.

2 participants