-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat(node): migrate vote tally #1139
base: feat/topdown-enchancement
Are you sure you want to change the base?
Conversation
Co-authored-by: cryptoAtwill <[email protected]>
/// A self-certified observation made by a validator. | ||
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] | ||
pub struct CertifiedObservation { | ||
observation: Observation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate more on why both the inner and the envelop signatures are needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required in Observation
because we need it to publish a cert. But for certified_at
field, we also need it to be nonforgeable but no need to be part of the certificate. In the future, there might be more fields to be added to counter different attacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the latter is just part of the messaging protocol for authentication, perhaps it's better to abstract it away from that struct which defines the message content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried something like:
struct RecoverablePayload<T> {
t: T,
sig: RecoverableSig
}
But it becomes more nested than the above. If there is a use case for reuse, I think it's worth changing, but so far I feel not that much though
}, | ||
Ok(vote) = self.handler.gossip_rx.recv() => { | ||
Ok(vote) = self.handler.gossip_rx.recv_vote() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does the Vote::v1_checked
validation is taken place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it's deserialized, it's checked.
Following previous PR, this one migrates the vote tally process over.
In this PR, the following key changes are made:
stm
module, removingchain
field (not relevant to vote tally anymore) and removepause_votes
(not needed). Alsodump_votes
that dump all the votes currently collected is added. This is mainly to aid debugging in case of stuck finality.VoteTallyClient
that utilises tokio channels to communicate with the underlying reactor.VoteStore
trait that stored votes collected. Currently it's in memory store by default. Will merge with Add persistent top-down finality cache #897 when recovery modes are introduced.GossipClient
trait that vote tally uses to communicate with the underlying libp2p gossip channel. Previously it's usingipld-resolver
directly. But that crate is under utilised and quite heavy. Introducing this trait to decouple withipld-resolver
for easier testing as well.RecoverableECDSASignature
to validate signed votes from peers and sign votes for peers.