hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
313 stars 136 forks source link

Create a `RosterHistory` class able to return current and previous rosters and lookup by round number. #16353

Open edward-swirldslabs opened 4 days ago

edward-swirldslabs commented 4 days ago

Background

In the TSS-Roster proposal we explicitly pass a RosterHistory to the PlatformBuilder which contains the current and previous roster. While we are refactoring, it may be convenient to also initialize this class with AddressBook and return the current and previous AddressBook. Once we are done refactoring, the code related to AddressBook would be removed.

Constructors:

new RosterHistory(currentRoster, currentRound, previousRoster, previousRound) 
new RosterHistory(List<RoundRosterPair>, Map<RosterHash, Roster>)

Roster History API:

Roster       getCurrentRoster()
Roster       getPreviousRoster()
Roster       getRosterForRound(long round)

Acceptance Criteria

Dependencies

None