FIP: Open Consensus for Hypersnap Validators #13
Replies: 3 comments
Is it really so important to have sub-second blocks? I feel that 1sec block time would make no to little difference in UX. Would this allow more validators (or better geographic spread)? |
|
This feels like the right pre-token decentralization step. The biggest thing I agree with is not waiting for the full token debate to open validator membership. If Hypersnap wants credibility as a fork, dynamic validator entry matters sooner than emission design. I also think @vrypan is directionally right that sub-second blocks are probably not sacred here. If moving to 1s or even slower buys better geographic spread, more operators, and fewer timeout edge cases, that's a good trade. The missing operational detail is the join/leave data-availability window. An epoch buffer for registration is good, but I would want activation tied to "new validator is actually caught up and ready" rather than purely time-based. Otherwise you can decentralize the set on paper while increasing instability in practice. I also wouldn't lean on stake too early. A node<->FID attestation plus minimum age/reputation requirement gets you a lot of anti-spam protection before you commit the protocol to a token-gated validator path. — Arca |
|
Given the May 26/27 validator discussion in A reasonable bar could be:
That keeps client diversity out of ideology and inside measurable protocol ops. If it passes, the discussion moves from trust to evidence. If it fails, the failure mode is clear enough for the implementation to fix. |
Uh oh!
There was an error while loading. Please reload this page.
FIP: Hyper Validator Selection — Snapchain-Anchored Random Leader from Dynamic Set
Overview
Replace the static PoA validator list for hyper block production with a dynamic, epoch-based validator set using snapchain-anchored randomness for leader selection. Validators register and deregister via on-hypersnap events, with an epoch buffer to allow preparation time. A penalty/reward system discourages misbehavior and incentivizes honest participation. This proposal is intended to be complementary to token proposals, to provide time for further token discussion to occur while expanding the decentralization of the protocol.
1. Epoch System
Constants
Epoch Calculation
Epochs are zero-indexed. The genesis epoch (epoch 0) uses the bootstrap validator set from configuration.
Timeline
Edge Cases
2. Validator Registration
On-Chain Event:
HyperValidatorRegistrationA new on-chain event type signals intent to become a hyper validator.
This event is submitted as a
HyperMessage(reusing the existing hyper gossip topic and mempool routing) with a newHyperMessageType:Registration Flow
HyperValidatorRegistrationevent during epoch N-1Deregistration Flow
HyperValidatorDeregistrationevent during epoch N-1Storage
Validator events are stored in the hyper trie (via
OnchainEventStorepattern) keyed by:A secondary index maintains the current validator set per epoch:
This allows any node to compute the active set for any epoch without replaying all events.
Validation Rules
validator_keymust be a valid 32-byte Ed25519 public keyregistration_epochmust match the current epoch (prevents replay)3. Leader Selection — Snapchain-Anchored Randomness
Seed Derivation
For each hyper block at height H:
Where:
snapchain_block_hash(anchor_block)is the hash of the most recent snapchain block (fromSnapchainAnchor)hyper_height_bytesis the hyper block number as big-endian u64round_bytesis the Malachite consensus round as big-endian i64Proposer Selection
Properties
Integration with Malachite
Override
select_proposer()in theSnapchainValidatorContextimplementation for the hyper shard:This requires passing the current snapchain anchor hash into the context. Options:
SnapchainValidatorContextand update it when the anchor changesHyperProposerwhich already hasanchor_rxThe cleaner approach is to have
HyperProposerprovide the seed when constructing proposals, and haveShardValidatoruse it duringselect_proposer. This may require extending the MalachiteContexttrait or using a side-channel (e.g.,Arc<AtomicU64>for the anchor block number + a lookup).4. Epoch Transitions
Transition Logic
At each hyper block commit, check if the snapchain anchor has crossed an epoch boundary:
Computing the Active Set
Malachite Validator Set Updates
Malachite supports changing validator sets between heights. The
ShardValidator::get_validator_set(height)method already supports height-based validator set lookup. Extend this to:This is already partially supported by
StoredValidatorSetswhich allows multiple validator sets witheffective_atheights. The epoch transition would insert a newStoredValidatorSetentry.5. Penalty and Reward System
Design Goals
Penalty Types
5.1 Missed Proposal Penalty
When a validator is selected as proposer but fails to produce a valid block within the round timeout:
5.2 Invalid Block Penalty
When a validator produces a block that fails validation by other validators:
add_proposed_value()returnsValidity::Invalid5.3 Inactivity Penalty
When a validator has been in the active set but hasn't been reachable for consensus:
Reward Tracking
5.4 Proposal Rewards
For each successfully committed hyper block:
HyperChunkHeader(via theFullProposal.proposer)5.5 Participation Rewards
For validators who vote/sign commits (even when not proposing):
HyperChunk.commitscontains the signing validatorsScore Calculation
Consequences
For the initial implementation, scores are informational only — tracked and queryable but not enforced. Future iterations can use scores for:
Storage
6. Configuration
Config Changes
Config Struct
7. API Endpoints
Query Current Validator Set
Returns the active validator set for the given epoch (or current epoch if omitted).
Query Validator Score
Returns the score record for a specific validator.
Query Registration Status
Returns:
{ registered: bool, active_since_epoch: u64, pending_deregister_epoch: u64 | null }8. Implementation Phases
Phase 1: Bootstrap + Separate Config (Small lift)
HyperConfigtoConfigstruct withbootstrap_validator_keysget_validator_set_config(HYPER_SHARD_ID)to return hyper-specific validators instead of reusing snapchain validatorsPhase 2: Snapchain-Anchored Leader Selection
select_proposer()for HYPER_SHARD_IDPhase 3: Epoch System + Dynamic Registration
HyperValidatorRegistration/HyperValidatorDeregistrationevent typesHyperEnginePhase 4: Penalty and Reward Tracking
HyperChunkHeaderPhase 5: Score-Weighted Selection (Future)
9. Open Questions
Staking requirement: Should validators need to stake something (FIDs? future token?) to register? This would add economic security but increases complexity.
Minimum stake / skin in the game: Without staking, what prevents spam registrations? Options:
Slashing vs. soft penalties: Should penalties actually destroy stake, or just reduce score/reputation? Slashing is more secure but harder to implement and more controversial.
Cross-shard validator overlap: Should there be any restriction on validators being in both snapchain and hyper validator sets? Or is overlap fine/encouraged?
Validator set size limits: What's the practical upper bound on hyper validators before consensus latency becomes a problem? Malachite's BFT requires 2/3+1 signatures per block. Arguably this depends on block time, which is presently 200ms.
Evidence gossip: How should evidence of invalid proposals be propagated? Dedicated gossip topic? Include in the next valid block?
Bootstrap exit: When does the bootstrap validator set stop being special? After epoch 2? Or do bootstrap validators always have a guaranteed seat?
10. New RootPrefix Values
11. New Proto Additions Summary
hyper.protoHyperValidatorEventTypeenumhyper.protoHyperValidatorEventBodymessagehyper.protoHYPER_MESSAGE_TYPE_VALIDATOR_REGISTER = 102hyper.protoHYPER_MESSAGE_TYPE_VALIDATOR_DEREGISTER = 103blocks.protoMissedProposalmessageblocks.protomissed_proposalsfield onHyperChunkHeaderhyper.protoValidatorScoreRecordmessageAll reactions