-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Best PreVote Candidate algorithm
- Loading branch information
Oleksandr
committed
Jan 15, 2025
1 parent
2c3812f
commit b9cfa61
Showing
9 changed files
with
303 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/limechain/grandpa/state/GrandpaRound.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.limechain.grandpa.state; | ||
|
||
import com.limechain.network.protocol.grandpa.messages.catchup.res.SignedVote; | ||
import com.limechain.network.protocol.grandpa.messages.commit.Vote; | ||
import io.emeraldpay.polkaj.types.Hash256; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.math.BigInteger; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
@Getter | ||
@Setter | ||
public class GrandpaRound { | ||
|
||
private GrandpaRound previous; | ||
private BigInteger roundNumber; | ||
|
||
private Vote preVotedBlock; | ||
private Vote bestFinalCandidate; | ||
|
||
private Map<Hash256, SignedVote> preVotes = new ConcurrentHashMap<>(); | ||
private Map<Hash256, SignedVote> preCommits = new ConcurrentHashMap<>(); | ||
private Map<Hash256, SignedVote> primaryProposals = new ConcurrentHashMap<>(); | ||
|
||
private Map<Hash256, Set<SignedVote>> pvEquivocations = new ConcurrentHashMap<>(); | ||
private Map<Hash256, Set<SignedVote>> pcEquivocations = new ConcurrentHashMap<>(); | ||
} |
Oops, something went wrong.