Enable storing of multiple meta-elections in parallel

Description

Sometimes we will need access to data about meta-elections that we have already decided, in order to detect some kinds of malice.

The task is to replace meta_votes: BTreeMap<Hash, BTreeMap<S:ublicId, Vec<MetaVote>>> with meta_votes: BTreeMap<Hash, BTreeMap<Hash, BTreeMap<S:ublicId, Vec<MetaVote>>>>, where the first hash is the hash of the last stable block at the point of consideration of the meta-election.

Every reference to self.meta_votes in Parsec will also have to be replaced with self.meta_votes.get(last_stable_block_hash).


Update 2018-10-02:

To reduce duplication, we decided to replace both consensus_history and meta_votes with a single field:

meta_votes: Vec<MetaElection<S:ublicId>>

where MetaElection is defined as follows:

(so it's essentially the meta-data we were storing before, a map event → peer → meta-votes).

Vec<MetaElection> might be extracted as a separate struct if it makes the code cleaner.

Environment

None

Assignee

Bartlomiej Kaminski

Reporter

Bartlomiej Kaminski

Labels

Start date

2018/09/13

End date

2018/09/14

Task progress

None

Baseline start date

None

Baseline end date

None

Story Points

8

Components

Priority

Minor
Configure