-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add remaining *2 types #3932
Add remaining *2 types #3932
Changes from 15 commits
0eda545
a272da1
273647c
3a5ea43
48a8e00
40fb9e4
585063b
550a155
bfd3198
43e6933
fea0060
944c2f4
dba567e
41e0f30
25e24e9
2fed4ef
3ef6a5b
18a6c10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ use async_trait::async_trait; | |
use hotshot_task::task::TaskState; | ||
use hotshot_types::{ | ||
consensus::{Consensus, OuterConsensus}, | ||
data::{DaProposal, PackedBundle}, | ||
data::{DaProposal2, PackedBundle}, | ||
event::{Event, EventType}, | ||
message::{Proposal, UpgradeLock}, | ||
simple_certificate::DaCertificate, | ||
simple_vote::{DaData, DaVote}, | ||
simple_certificate::DaCertificate2, | ||
simple_vote::{DaData2, DaVote2}, | ||
traits::{ | ||
block_contents::vid_commitment, | ||
election::Membership, | ||
|
@@ -61,7 +61,7 @@ pub struct DaTaskState<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Version | |
pub network: Arc<I::Network>, | ||
|
||
/// A map of `DaVote` collector tasks. | ||
pub vote_collectors: VoteCollectorsMap<TYPES, DaVote<TYPES>, DaCertificate<TYPES>, V>, | ||
pub vote_collectors: VoteCollectorsMap<TYPES, DaVote2<TYPES>, DaCertificate2<TYPES>, V>, | ||
|
||
/// This Nodes public key | ||
pub public_key: TYPES::SignatureKey, | ||
|
@@ -182,15 +182,16 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> DaTaskState<TYP | |
self.storage | ||
.write() | ||
.await | ||
.append_da(proposal, payload_commitment) | ||
.append_da2(proposal, payload_commitment) | ||
.await | ||
.wrap() | ||
.context(error!("Failed to append DA proposal to storage"))?; | ||
let view_number = proposal.data.view_number(); | ||
// Generate and send vote | ||
let vote = DaVote::create_signed_vote( | ||
DaData { | ||
let vote = DaVote2::create_signed_vote( | ||
DaData2 { | ||
payload_commit: payload_commitment, | ||
epoch: self.cur_epoch, | ||
}, | ||
view_number, | ||
&self.public_key, | ||
|
@@ -315,11 +316,12 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> DaTaskState<TYP | |
TYPES::SignatureKey::sign(&self.private_key, &encoded_transactions_hash) | ||
.wrap()?; | ||
|
||
let data: DaProposal<TYPES> = DaProposal { | ||
let data: DaProposal2<TYPES> = DaProposal2 { | ||
encoded_transactions: Arc::clone(encoded_transactions), | ||
metadata: metadata.clone(), | ||
// Upon entering a new view we want to send a DA Proposal for the next view -> Is it always the case that this is cur_view + 1? | ||
view_number, | ||
epoch_number: self.cur_epoch, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine here because we're proposing a new block and we don't know its block number yet. We need to rely on the task keeping track of the current epoch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. your comment led me to look at this again, and I think I fixed it "properly": 3ef6a5b this now takes its epoch number directly from the |
||
}; | ||
|
||
let message = Proposal { | ||
|
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 would be good to use the epoch from the proposal. Something like this
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.
agreed! change: 2fed4ef