From 34216bce323479b950030af90c6886dc7ea17c67 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 21 Sep 2023 17:31:09 -0700 Subject: [PATCH 01/14] Save before sync with main --- Cargo.lock | 2 +- crates/hotshot/Cargo.toml | 1 - crates/hotshot/examples/infra/modDA.rs | 9 +-- crates/hotshot/src/demo.rs | 10 +-- crates/hotshot/src/lib.rs | 4 +- crates/hotshot/src/tasks/mod.rs | 6 +- crates/task-impls/src/consensus.rs | 17 +++-- crates/task-impls/src/da.rs | 35 +--------- crates/task-impls/src/transactions.rs | 76 ++++++++++++++++++--- crates/testing/src/node_types.rs | 6 +- crates/testing/src/task_helpers.rs | 12 ++-- crates/testing/tests/atomic_storage.rs | 70 ------------------- crates/testing/tests/da_task.rs | 28 ++++---- crates/testing/tests/network_task.rs | 22 +++--- crates/types/Cargo.toml | 1 + crates/{hotshot => types}/src/block_impl.rs | 73 +++++++++++++------- crates/types/src/data.rs | 2 - crates/types/src/lib.rs | 1 + crates/types/src/traits/block_contents.rs | 35 ++-------- crates/types/src/traits/state.rs | 12 ---- 20 files changed, 185 insertions(+), 237 deletions(-) rename crates/{hotshot => types}/src/block_impl.rs (57%) diff --git a/Cargo.lock b/Cargo.lock index 30f9f438b1..1f0a2bb9f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2609,7 +2609,6 @@ dependencies = [ "rand_chacha 0.3.1", "serde", "serde_json", - "sha3", "snafu", "surf-disco", "time 0.3.28", @@ -2833,6 +2832,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.7", + "sha3", "snafu", "tagged-base64 0.2.4", "time 0.3.28", diff --git a/crates/hotshot/Cargo.toml b/crates/hotshot/Cargo.toml index 671519ec84..d7816208f1 100644 --- a/crates/hotshot/Cargo.toml +++ b/crates/hotshot/Cargo.toml @@ -108,7 +108,6 @@ libp2p-networking = { workspace = true } rand = { workspace = true } rand_chacha = { workspace = true } serde = { workspace = true, features = ["rc"] } -sha3 = "^0.10" snafu = { workspace = true } surf-disco = { workspace = true } time = { workspace = true } diff --git a/crates/hotshot/examples/infra/modDA.rs b/crates/hotshot/examples/infra/modDA.rs index ae0f0e40f5..82cc12bf68 100644 --- a/crates/hotshot/examples/infra/modDA.rs +++ b/crates/hotshot/examples/infra/modDA.rs @@ -20,8 +20,8 @@ use hotshot_orchestrator::{ config::{NetworkConfig, WebServerConfig}, }; use hotshot_task::task::FilterEvent; -use hotshot_types::HotShotConfig; use hotshot_types::{ + block_impl::{VIDBlockPayload, VIDTransaction}, certificate::ViewSyncCertificate, data::{QuorumProposal, SequencingLeaf, TestableLeaf}, event::{Event, EventType}, @@ -37,6 +37,7 @@ use hotshot_types::{ }, state::{ConsensusTime, TestableBlock, TestableState}, }, + HotShotConfig, }; use libp2p_identity::{ ed25519::{self, SecretKey}, @@ -407,7 +408,7 @@ pub struct WebServerDARun< #[async_trait] impl< - TYPES: NodeType, + TYPES: NodeType, MEMBERSHIP: Membership + Debug, NODE: NodeImplementation< TYPES, @@ -551,7 +552,7 @@ pub struct Libp2pDARun, MEMBERSHIP #[async_trait] impl< - TYPES: NodeType, + TYPES: NodeType, MEMBERSHIP: Membership + Debug, NODE: NodeImplementation< TYPES, @@ -765,7 +766,7 @@ where /// Main entry point for validators pub async fn main_entry_point< - TYPES: NodeType, + TYPES: NodeType, MEMBERSHIP: Membership + Debug, DANETWORK: CommunicationChannel, MEMBERSHIP> + Debug, QUORUMNETWORK: CommunicationChannel, MEMBERSHIP> + Debug, diff --git a/crates/hotshot/src/demo.rs b/crates/hotshot/src/demo.rs index feaed2fe6b..976cea433d 100644 --- a/crates/hotshot/src/demo.rs +++ b/crates/hotshot/src/demo.rs @@ -5,15 +5,13 @@ //! //! These implementations are useful in examples and integration testing, but are not suitable for //! production use. -use crate::{ - block_impl::{BlockPayloadError, VIDBlockPayload, VIDTransaction}, - traits::election::static_committee::{StaticElectionConfig, StaticVoteToken}, -}; +use crate::traits::election::static_committee::{StaticElectionConfig, StaticVoteToken}; use commit::{Commitment, Committable}; use derivative::Derivative; use either::Either; use hotshot_signature_key::bn254::BLSPubKey; use hotshot_types::{ + block_impl::{BlockPayloadError, VIDBlockPayload, VIDTransaction}, certificate::{AssembledSignature, QuorumCertificate}, data::{ fake_commitment, genesis_proposer_id, random_commitment, LeafType, SequencingLeaf, @@ -72,10 +70,6 @@ impl State for SDemoState { type Time = ViewNumber; - fn next_block(_state: Option) -> Self::BlockType { - VIDBlockPayload(Vec::new()) - } - fn validate_block(&self, _block: &Self::BlockType, view_number: &Self::Time) -> bool { if view_number == &ViewNumber::genesis() { &self.view_number == view_number diff --git a/crates/hotshot/src/lib.rs b/crates/hotshot/src/lib.rs index 117153967e..fe50fac759 100644 --- a/crates/hotshot/src/lib.rs +++ b/crates/hotshot/src/lib.rs @@ -19,7 +19,6 @@ #[cfg(feature = "docs")] pub mod documentation; -pub mod block_impl; /// Contains structures and functions for committee election pub mod certificate; #[cfg(feature = "demo")] @@ -56,6 +55,7 @@ use hotshot_task::{ use hotshot_task_impls::{events::SequencingHotShotEvent, network::NetworkTaskKind}; use hotshot_types::{ + block_impl::{VIDBlockPayload, VIDTransaction}, certificate::{DACertificate, ViewSyncCertificate}, consensus::{BlockStore, Consensus, ConsensusMetrics, View, ViewInner, ViewQueue}, data::{DAProposal, DeltasType, LeafType, QuorumProposal, SequencingLeaf}, @@ -649,7 +649,7 @@ pub trait HotShotType> { #[async_trait] impl< - TYPES: NodeType, + TYPES: NodeType, I: NodeImplementation< TYPES, Leaf = SequencingLeaf, diff --git a/crates/hotshot/src/tasks/mod.rs b/crates/hotshot/src/tasks/mod.rs index 619fdb6d59..02aed896af 100644 --- a/crates/hotshot/src/tasks/mod.rs +++ b/crates/hotshot/src/tasks/mod.rs @@ -27,6 +27,7 @@ use hotshot_task_impls::{ view_sync::{ViewSyncTaskState, ViewSyncTaskStateTypes}, }; use hotshot_types::{ + block_impl::{VIDBlockPayload, VIDTransaction}, certificate::ViewSyncCertificate, data::{ProposalType, QuorumProposal, SequencingLeaf}, event::Event, @@ -38,7 +39,6 @@ use hotshot_types::{ CommitteeEx, ExchangesType, NodeImplementation, NodeType, ViewSyncEx, }, state::ConsensusTime, - BlockPayload, }, vote::{ViewSyncData, VoteType}, }; @@ -284,7 +284,7 @@ where consensus, timeout: handle.hotshot.inner.config.next_view_timeout, cur_view: TYPES::Time::new(0), - block: TYPES::BlockType::new(), + block: None, quorum_exchange: c_api.inner.exchanges.quorum_exchange().clone().into(), api: c_api.clone(), committee_exchange: c_api.inner.exchanges.committee_exchange().clone().into(), @@ -412,7 +412,7 @@ where /// # Panics /// Is unable to panic. This section here is just to satisfy clippy pub async fn add_transaction_task< - TYPES: NodeType, + TYPES: NodeType, I: NodeImplementation< TYPES, Leaf = SequencingLeaf, diff --git a/crates/task-impls/src/consensus.rs b/crates/task-impls/src/consensus.rs index dccf7919c3..7aa93de10e 100644 --- a/crates/task-impls/src/consensus.rs +++ b/crates/task-impls/src/consensus.rs @@ -83,8 +83,8 @@ pub struct SequencingConsensusTaskState< /// View number this view is executing in. pub cur_view: TYPES::Time, - /// Current block submitted to DA - pub block: TYPES::BlockType, + /// Current block submitted to DA, if any. + pub block: Option, /// the quorum exchange pub quorum_exchange: Arc>, @@ -1078,7 +1078,7 @@ where } SequencingHotShotEvent::SendDABlockData(block) => { // ED TODO Should make sure this is actually the most recent block - self.block = block; + self.block = Some(block); } _ => {} } @@ -1150,10 +1150,13 @@ where // TODO do some sort of sanity check on the view number that it matches decided } - let block_commitment = self.block.commit(); - if block_commitment == TYPES::BlockType::new().commit() { - debug!("BlockPayload is generic block! {:?}", self.cur_view); - } + let block_commitment = match &self.block { + Some(block) => block.commit(), + None => { + debug!("No block yet."); + return false; + } + }; let leaf = SequencingLeaf { view_number: view, diff --git a/crates/task-impls/src/da.rs b/crates/task-impls/src/da.rs index ff048ef469..61b95267a7 100644 --- a/crates/task-impls/src/da.rs +++ b/crates/task-impls/src/da.rs @@ -18,7 +18,7 @@ use hotshot_types::vote::VoteType; use hotshot_types::{ certificate::DACertificate, consensus::{Consensus, View}, - data::{DAProposal, ProposalType, SequencingLeaf, VidDisperse, VidScheme, VidSchemeTrait}, + data::{DAProposal, ProposalType, SequencingLeaf}, message::{Message, Proposal, SequencingMessage}, traits::{ consensus_api::SequencingConsensusApi, @@ -658,39 +658,6 @@ where self.committee_exchange.public_key().clone(), )) .await; - - debug!("Prepare VID shares"); - { - /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 - const NUM_STORAGE_NODES: usize = 10; - /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 - const NUM_CHUNKS: usize = 5; - - // TODO https://github.com/EspressoSystems/HotShot/issues/1686 - let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); - - let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); - let message_bytes = bincode::serialize(&message).unwrap(); - let vid_disperse = vid.disperse(&message_bytes).unwrap(); - // TODO for now reuse the same block commitment and signature as DA committee - // https://github.com/EspressoSystems/jellyfish/issues/369 - - self.event_stream - .publish(SequencingHotShotEvent::VidDisperseSend( - Proposal { - data: VidDisperse { - view_number: view, - commitment: block.commit(), // TODO GG should be vid_disperse.commit but that's a big change - shares: vid_disperse.shares, - common: vid_disperse.common, - }, - signature: message.signature, - }, - // TODO don't send to committee, send to quorum (consensus.rs) https://github.com/EspressoSystems/HotShot/issues/1696 - self.committee_exchange.public_key().clone(), - )) - .await; - } } SequencingHotShotEvent::Timeout(view) => { diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 8609708653..ff832a272c 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -13,15 +13,17 @@ use hotshot_task::{ task_impls::HSTWithEvent, }; use hotshot_types::{ + block_impl::{VIDBlockPayload, VIDTransaction}, certificate::DACertificate, consensus::Consensus, - data::SequencingLeaf, + data::{SequencingLeaf, VidScheme, VidSchemeTrait}, message::{Message, SequencingMessage}, traits::{ + block_contents::Transaction, consensus_api::SequencingConsensusApi, election::ConsensusExchange, node_implementation::{CommitteeEx, NodeImplementation, NodeType}, - BlockPayload, State, + BlockPayload, }, }; use hotshot_utils::bincode::bincode_opts; @@ -72,7 +74,7 @@ pub struct TransactionTaskState< } impl< - TYPES: NodeType, + TYPES: NodeType, I: NodeImplementation< TYPES, Leaf = SequencingLeaf, @@ -220,18 +222,52 @@ where drop(consensus); - let mut block = ::StateType::next_block(None); + let block; let txns = self.wait_for_transactions(parent_leaf).await?; - for txn in txns { - if let Ok(new_block) = block.add_transaction_raw(&txn) { - block = new_block; - continue; + debug!("Prepare VID shares"); + if txns.len() > 0 { + /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 + const NUM_STORAGE_NODES: usize = 10; + /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 + const NUM_CHUNKS: usize = 5; + + // TODO https://github.com/EspressoSystems/HotShot/issues/1686 + let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); + + let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); + // TODO https://github.com/EspressoSystems/jellyfish/issues/375 + let mut txns_flatten = Vec::new(); + for txn in &txns { + txns_flatten.extend(txn.bytes()); } + tracing::error!("here txn task {:?}", txns); + let vid_disperse = vid.disperse(&txns_flatten).unwrap(); + block = VIDBlockPayload::new(txns, vid_disperse.commit); + + // TODO Commenting out the following code since we need to update the proposal, + // signature, and exchange for VID dispersal. They were copy-pasted from DA + // code. + // self.event_stream + // .publish(SequencingHotShotEvent::VidDisperseSend( + // Proposal { + // data: VidDisperse { + // view_number: view + 1, + // commitment: block.commit(), + // shares: vid_disperse.shares, + // common: vid_disperse.common, + // }, + // signature: message.signature, + // }, + // // TODO don't send to committee, send to quorum (consensus.rs) https://github.com/EspressoSystems/HotShot/issues/1696 + // self.committee_exchange.public_key().clone(), + // )) + // .await; + + self.event_stream + .publish(SequencingHotShotEvent::BlockReady(block, view + 1)) + .await; } - self.event_stream - .publish(SequencingHotShotEvent::BlockReady(block, view + 1)) - .await; return None; } SequencingHotShotEvent::Shutdown => { @@ -241,7 +277,25 @@ where } None } +} +impl< + TYPES: NodeType, + I: NodeImplementation< + TYPES, + Leaf = SequencingLeaf, + ConsensusMessage = SequencingMessage, + >, + A: SequencingConsensusApi, I> + 'static, + > TransactionTaskState +where + CommitteeEx: ConsensusExchange< + TYPES, + Message, + Certificate = DACertificate, + Commitment = TYPES::BlockType, + >, +{ #[instrument(skip_all, fields(id = self.id, view = *self.cur_view), name = "Transaction Handling Task", level = "error")] async fn wait_for_transactions( &self, diff --git a/crates/testing/src/node_types.rs b/crates/testing/src/node_types.rs index f4b2f9db1a..4ffd74e2bf 100644 --- a/crates/testing/src/node_types.rs +++ b/crates/testing/src/node_types.rs @@ -1,7 +1,4 @@ -use hotshot::{ - block_impl::{VIDBlockPayload, VIDTransaction}, - traits::implementations::CombinedNetworks, -}; +use hotshot::traits::implementations::CombinedNetworks; use std::{marker::PhantomData, sync::Arc}; use hotshot::{ @@ -17,6 +14,7 @@ use hotshot::{ types::bn254::BLSPubKey, }; use hotshot_types::{ + block_impl::{VIDBlockPayload, VIDTransaction}, certificate::ViewSyncCertificate, data::{QuorumProposal, SequencingLeaf, ViewNumber}, message::{Message, SequencingMessage}, diff --git a/crates/testing/src/task_helpers.rs b/crates/testing/src/task_helpers.rs index 8e0f85a95c..1a8123a35b 100644 --- a/crates/testing/src/task_helpers.rs +++ b/crates/testing/src/task_helpers.rs @@ -6,13 +6,14 @@ use commit::Committable; use either::Right; use hotshot::{ certificate::QuorumCertificate, - traits::{BlockPayload, NodeImplementation, TestableNodeImplementation}, + traits::{NodeImplementation, TestableNodeImplementation}, types::{bn254::BLSPubKey, SignatureKey, SystemContextHandle}, HotShotInitializer, HotShotSequencingConsensusApi, SystemContext, }; use hotshot_task::event_stream::ChannelStream; use hotshot_task_impls::events::SequencingHotShotEvent; use hotshot_types::{ + block_impl::VIDBlockPayload, data::{QuorumProposal, SequencingLeaf, VidScheme, ViewNumber}, message::{Message, Proposal}, traits::{ @@ -21,7 +22,7 @@ use hotshot_types::{ metrics::NoMetrics, node_implementation::{CommitteeEx, ExchangesType, NodeType, QuorumEx}, signature_key::EncodedSignature, - state::ConsensusTime, + state::{ConsensusTime, TestableBlock}, }, }; @@ -116,8 +117,7 @@ async fn build_quorum_proposal_and_signature( let parent_leaf = leaf.clone(); // every event input is seen on the event stream in the output. - - let block_commitment = ::BlockType::new().commit(); + let block = ::genesis(); let leaf = SequencingLeaf { view_number: ViewNumber::new(view), height: parent_leaf.height + 1, @@ -125,14 +125,14 @@ async fn build_quorum_proposal_and_signature( parent_commitment: parent_leaf.commit(), // Use the block commitment rather than the block, so that the replica can construct // the same leaf with the commitment. - deltas: Right(block_commitment), + deltas: Right(block.commit()), rejected: vec![], timestamp: 0, proposer_id: api.public_key().to_bytes(), }; let signature = ::sign(private_key, leaf.commit().as_ref()); let proposal = QuorumProposal::> { - block_commitment, + block_commitment: block.commit(), view_number: ViewNumber::new(view), height: 1, justify_qc: QuorumCertificate::genesis(), diff --git a/crates/testing/tests/atomic_storage.rs b/crates/testing/tests/atomic_storage.rs index c8183af164..381db09d87 100644 --- a/crates/testing/tests/atomic_storage.rs +++ b/crates/testing/tests/atomic_storage.rs @@ -13,76 +13,6 @@ use rand::thread_rng; type AtomicStorage = hotshot::traits::implementations::AtomicStorage; -#[cfg_attr( - async_executor_impl = "tokio", - tokio::test(flavor = "multi_thread", worker_threads = 2) -)] -#[cfg_attr(async_executor_impl = "async-std", async_std::test)] -async fn test_happy_path_blocks() { - // This folder will be destroyed when the last handle to it closes - let file = tempfile::tempdir().expect("Could not create temp dir"); - let path = file.path(); - println!("Using store in {:?}", path); - let mut store = AtomicStorage::open(path).expect("Could not open atomic store"); - - let block = VDEntryBlock::default(); - let hash = block.hash(); - store - .update(|mut m| { - let block = block.clone(); - async move { m.insert_block(hash, block).await } - }) - .await - .unwrap(); - - // Make sure the data is still there after re-opening - drop(store); - store = AtomicStorage::open(path).expect("Could not open atomic store"); - assert_eq!( - store.get_block(&hash).await.unwrap(), - Some(DEntryBlock::default()) - ); - - // Add some transactions - let mut rng = thread_rng(); - let state = >::get_starting_state(); - let mut hashes = Vec::new(); - let mut block = block; - for _ in 0..10 { - let new = block - .add_transaction_raw(&random_transaction(&state, &mut rng)) - .expect("Could not add transaction"); - println!("Inserting {:?}: {:?}", new.hash(), new); - store - .update(|mut m| { - let new = new.clone(); - async move { m.insert_block(new.hash(), new.clone()).await } - }) - .await - .unwrap(); - hashes.push(new.hash()); - block = new; - } - - // read them all back 3 times - // 1st time: normal readback - // 2nd: after dropping and re-opening the store - for i in 0..3 { - if i == 1 { - drop(store); - store = AtomicStorage::open(path).expect("Could not open atomic store"); - } - - // read them all back - for (idx, hash) in hashes.iter().enumerate() { - match store.get_block(hash).await.expect("Could not read hash") { - Some(block) => println!("read {:?}", block), - None => panic!("Could not read hash {} {:?}", idx, hash), - } - } - } -} - #[cfg_attr( async_executor_impl = "tokio", tokio::test(flavor = "multi_thread", worker_threads = 2) diff --git a/crates/testing/tests/da_task.rs b/crates/testing/tests/da_task.rs index 204038885c..ba042b35ee 100644 --- a/crates/testing/tests/da_task.rs +++ b/crates/testing/tests/da_task.rs @@ -6,6 +6,7 @@ use hotshot_testing::{ task_helpers::vid_init, }; use hotshot_types::{ + block_impl::VIDTransaction, data::{DAProposal, VidDisperse, VidSchemeTrait, ViewNumber}, traits::{ consensus_api::ConsensusSharedApi, election::ConsensusExchange, @@ -20,10 +21,12 @@ use std::collections::HashMap; )] #[cfg_attr(async_executor_impl = "async-std", async_std::test)] async fn test_da_task() { - use hotshot::{block_impl::VIDBlockPayload, tasks::add_da_task}; + use hotshot::tasks::add_da_task; use hotshot_task_impls::harness::run_harness; use hotshot_testing::task_helpers::build_system_handle; - use hotshot_types::{message::Proposal, traits::election::CommitteeExchangeType}; + use hotshot_types::{ + block_impl::VIDBlockPayload, message::Proposal, traits::election::CommitteeExchangeType, + }; async_compatibility_layer::logging::setup_logging(); async_compatibility_layer::logging::setup_backtrace(); @@ -36,9 +39,13 @@ async fn test_da_task() { }; let committee_exchange = api.inner.exchanges.committee_exchange().clone(); let pub_key = *api.public_key(); - let block = VIDBlockPayload(Vec::new()); - let block_commitment = block.commit(); - let signature = committee_exchange.sign_da_proposal(&block_commitment); + let vid = vid_init(); + let txn = vec![0u8]; + tracing::error!("here da task"); + let vid_disperse = vid.disperse(&txn).unwrap(); + let block_commitment = vid_disperse.commit; + let block = VIDBlockPayload::new(vec![VIDTransaction(txn)], block_commitment); + let signature = committee_exchange.sign_da_proposal(&block.commit()); let proposal = DAProposal { deltas: block.clone(), view_number: ViewNumber::new(2), @@ -47,13 +54,10 @@ async fn test_da_task() { data: proposal, signature, }; - let vid = vid_init(); - let message_bytes = bincode::serialize(&message).unwrap(); - let vid_disperse = vid.disperse(&message_bytes).unwrap(); let vid_proposal = Proposal { data: VidDisperse { view_number: message.data.view_number, - commitment: block_commitment, + commitment: block.commit(), shares: vid_disperse.shares, common: vid_disperse.common, }, @@ -88,7 +92,7 @@ async fn test_da_task() { SequencingHotShotEvent::BlockReady(block.clone(), ViewNumber::new(2)), 1, ); - output.insert(SequencingHotShotEvent::SendDABlockData(block), 1); + output.insert(SequencingHotShotEvent::SendDABlockData(block.clone()), 1); output.insert( SequencingHotShotEvent::DAProposalSend(message.clone(), pub_key), 1, @@ -98,7 +102,7 @@ async fn test_da_task() { .unwrap() .unwrap(); let da_vote = - committee_exchange.create_da_message(block_commitment, ViewNumber::new(2), vote_token); + committee_exchange.create_da_message(block.commit(), ViewNumber::new(2), vote_token); output.insert(SequencingHotShotEvent::DAVoteSend(da_vote), 1); output.insert( SequencingHotShotEvent::VidDisperseSend(vid_proposal.clone(), pub_key), @@ -110,7 +114,7 @@ async fn test_da_task() { .unwrap() .unwrap(); let vid_vote = - committee_exchange.create_vid_message(block_commitment, ViewNumber::new(2), vote_token); + committee_exchange.create_vid_message(block.commit(), ViewNumber::new(2), vote_token); output.insert(SequencingHotShotEvent::VidVoteSend(vid_vote), 1); output.insert(SequencingHotShotEvent::DAProposalRecv(message, pub_key), 1); diff --git a/crates/testing/tests/network_task.rs b/crates/testing/tests/network_task.rs index 7ad17e2008..f11508e8f6 100644 --- a/crates/testing/tests/network_task.rs +++ b/crates/testing/tests/network_task.rs @@ -21,11 +21,13 @@ use std::collections::HashMap; #[cfg_attr(async_executor_impl = "async-std", async_std::test)] #[ignore] async fn test_network_task() { - use hotshot::block_impl::VIDBlockPayload; use hotshot_task_impls::harness::run_harness; use hotshot_testing::task_helpers::build_system_handle; use hotshot_types::{ - data::VidDisperse, message::Proposal, traits::election::CommitteeExchangeType, + block_impl::{VIDBlockPayload, VIDTransaction}, + data::VidDisperse, + message::Proposal, + traits::election::CommitteeExchangeType, }; async_compatibility_layer::logging::setup_logging(); @@ -40,9 +42,13 @@ async fn test_network_task() { let committee_exchange = api.inner.exchanges.committee_exchange().clone(); let pub_key = *api.public_key(); let priv_key = api.private_key(); - let block = VIDBlockPayload(Vec::new()); - let block_commitment = block.commit(); - let signature = committee_exchange.sign_da_proposal(&block_commitment); + let vid = vid_init(); + let txn = vec![0u8]; + tracing::error!("here network task1"); + let vid_disperse = vid.disperse(&txn).unwrap(); + let block_commitment = vid_disperse.commit; + let block = VIDBlockPayload::new(vec![VIDTransaction(txn)], block_commitment); + let signature = committee_exchange.sign_da_proposal(&block.commit()); let da_proposal = Proposal { data: DAProposal { deltas: block.clone(), @@ -51,15 +57,13 @@ async fn test_network_task() { signature, }; let quorum_proposal = build_quorum_proposal(&handle, priv_key, 2).await; - let vid = vid_init(); - let da_proposal_bytes = bincode::serialize(&da_proposal).unwrap(); - let vid_disperse = vid.disperse(&da_proposal_bytes).unwrap(); // TODO for now reuse the same block commitment and signature as DA committee // https://github.com/EspressoSystems/jellyfish/issues/369 + tracing::error!("here network task2"); let da_vid_disperse = Proposal { data: VidDisperse { view_number: da_proposal.data.view_number, - commitment: block_commitment, + commitment: block.commit(), shares: vid_disperse.shares, common: vid_disperse.common, }, diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 742882cce2..dbc1b7b009 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -43,6 +43,7 @@ rand = { workspace = true } rand_chacha = { workspace = true } serde = { workspace = true } sha2 = { workspace = true } +sha3 = "^0.10" snafu = { workspace = true } tagged-base64 = { git = "https://github.com/EspressoSystems/tagged-base64", tag = "0.2.4" } time = { workspace = true } diff --git a/crates/hotshot/src/block_impl.rs b/crates/types/src/block_impl.rs similarity index 57% rename from crates/hotshot/src/block_impl.rs rename to crates/types/src/block_impl.rs index 8960d79158..79b0ce234b 100644 --- a/crates/hotshot/src/block_impl.rs +++ b/crates/types/src/block_impl.rs @@ -4,8 +4,11 @@ use std::{ fmt::{Debug, Display}, }; +use crate::{ + data::{test_srs, VidScheme, VidSchemeTrait}, + traits::{block_contents::Transaction, state::TestableBlock, BlockPayload}, +}; use commit::{Commitment, Committable}; -use hotshot_types::traits::{block_contents::Transaction, state::TestableBlock, BlockPayload}; use serde::{Deserialize, Serialize}; use sha3::{Digest, Keccak256}; use snafu::Snafu; @@ -28,7 +31,11 @@ impl Committable for VIDTransaction { } } -impl Transaction for VIDTransaction {} +impl Transaction for VIDTransaction { + fn bytes(&self) -> Vec { + self.0.clone() + } +} impl VIDTransaction { /// create a new transaction @@ -55,14 +62,31 @@ pub enum BlockPayloadError { /// A [`BlockPayload`] that contains a list of `VIDTransaction`. #[derive(PartialEq, Eq, Hash, Serialize, Deserialize, Clone, Debug)] -pub struct VIDBlockPayload(pub Vec); +pub struct VIDBlockPayload { + /// List of transactions. + pub transactions: Vec, + /// VID commitment. + pub commitment: ::Commit, +} + +impl VIDBlockPayload { + /// Constructor. + #[must_use] + pub fn new( + transactions: Vec, + commitment: ::Commit, + ) -> Self { + Self { + transactions, + commitment, + } + } +} impl Committable for VIDBlockPayload { fn commit(&self) -> Commitment { - // TODO: Use use VID block commitment. - // let builder = commit::RawCommitmentBuilder::new("BlockPayload Comm"); - builder.finalize() + builder.generic_byte_array(&self.commitment).finalize() } fn tag() -> String { @@ -72,17 +96,30 @@ impl Committable for VIDBlockPayload { impl Display for VIDBlockPayload { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "BlockPayload #txns={}", self.0.len()) + write!(f, "BlockPayload #txns={}", self.transactions.len()) } } impl TestableBlock for VIDBlockPayload { fn genesis() -> Self { - VIDBlockPayload(Vec::new()) + /// TODO + const NUM_STORAGE_NODES: usize = 10; + /// TODO + const NUM_CHUNKS: usize = 5; + + // TODO + let srs = test_srs(NUM_STORAGE_NODES); + + let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); + + let txn = vec![0u8]; + tracing::error!("here genesis"); + let vid_disperse = vid.disperse(&txn).unwrap(); + VIDBlockPayload::new(vec![VIDTransaction(txn)], vid_disperse.commit) } fn txn_count(&self) -> u64 { - self.0.len() as u64 + self.transactions.len() as u64 } } @@ -91,20 +128,10 @@ impl BlockPayload for VIDBlockPayload { type Transaction = VIDTransaction; - fn new() -> Self { - ::genesis() - } - - fn add_transaction_raw( - &self, - tx: &Self::Transaction, - ) -> std::result::Result { - let mut new = self.0.clone(); - new.push(tx.clone()); - Ok(VIDBlockPayload(new)) - } - fn contained_transactions(&self) -> HashSet> { - self.0.iter().map(commit::Committable::commit).collect() + self.transactions + .iter() + .map(commit::Committable::commit) + .collect() } } diff --git a/crates/types/src/data.rs b/crates/types/src/data.rs index 080355a195..ff63321431 100644 --- a/crates/types/src/data.rs +++ b/crates/types/src/data.rs @@ -173,8 +173,6 @@ pub struct VidDisperse { /// The view number for which this VID data is intended pub view_number: TYPES::Time, /// Block commitment - /// - /// TODO GG type should be `::Common` but that's a big change. pub commitment: Commitment, /// VID shares dispersed among storage nodes pub shares: Vec<::Share>, diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 6152689acf..54739106c3 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -11,6 +11,7 @@ use std::{num::NonZeroUsize, time::Duration}; +pub mod block_impl; pub mod certificate; pub mod consensus; pub mod data; diff --git a/crates/types/src/traits/block_contents.rs b/crates/types/src/traits/block_contents.rs index a365dd7144..4ba10f601c 100644 --- a/crates/types/src/traits/block_contents.rs +++ b/crates/types/src/traits/block_contents.rs @@ -20,8 +20,6 @@ use std::{ /// * Must have a predefined error type ([`BlockPayload::Error`]) /// * Must have a transaction type that can be compared for equality, serialized and serialized, /// sent between threads, and can have a hash produced of it -/// * Must be able to be produced incrementally by appending transactions -/// ([`add_transaction_raw`](BlockPayload::add_transaction_raw)) /// * Must be hashable pub trait BlockPayload: Serialize @@ -42,18 +40,6 @@ pub trait BlockPayload: /// The type of the transitions we are applying type Transaction: Transaction; - /// Construct an empty or genesis block. - fn new() -> Self; - - /// Attempts to add a transaction, returning an Error if it would result in a structurally - /// invalid block - /// - /// # Errors - /// - /// Should return an error if this transaction leads to an invalid block - fn add_transaction_raw(&self, tx: &Self::Transaction) - -> std::result::Result; - /// returns hashes of all the transactions in this block /// TODO make this ordered with a vec fn contained_transactions(&self) -> HashSet>; @@ -63,6 +49,8 @@ pub trait BlockPayload: pub trait Transaction: Clone + Serialize + DeserializeOwned + Debug + PartialEq + Eq + Sync + Send + Committable + Hash { + /// Get the transaction bytes. + fn bytes(&self) -> Vec; } /// Dummy implementation of `BlockPayload` for unit tests @@ -112,7 +100,11 @@ pub mod dummy { "DUMMY_TXN".to_string() } } - impl super::Transaction for DummyTransaction {} + impl super::Transaction for DummyTransaction { + fn bytes(&self) -> Vec { + Vec::new() + } + } impl std::error::Error for DummyError {} @@ -133,19 +125,6 @@ pub mod dummy { type Transaction = DummyTransaction; - fn new() -> Self { - Self { nonce: 0 } - } - - fn add_transaction_raw( - &self, - _tx: &Self::Transaction, - ) -> std::result::Result { - Ok(Self { - nonce: self.nonce + 1, - }) - } - fn contained_transactions(&self) -> HashSet> { HashSet::new() } diff --git a/crates/types/src/traits/state.rs b/crates/types/src/traits/state.rs index 93ff3e6603..bd8fe7d2ed 100644 --- a/crates/types/src/traits/state.rs +++ b/crates/types/src/traits/state.rs @@ -20,8 +20,6 @@ use std::{ /// This trait represents the behaviors that the 'global' ledger state must have: /// * A defined error type ([`Error`](State::Error)) /// * The type of block that modifies this type of state ([`BlockPayload`](State::BlockType)) -/// * A method to get a template (empty) next block from the current state -/// ([`next_block`](State::next_block)) /// * The ability to validate that a block is actually a valid extension of this state /// ([`validate_block`](State::validate_block)) /// * The ability to produce a new state, with the modifications from the block applied @@ -46,9 +44,6 @@ pub trait State: /// Time compatibility needed for reward collection type Time: ConsensusTime; - /// Returns an empty, template next block given this current state - fn next_block(prev_commitment: Option) -> Self::BlockType; - /// Returns true if and only if the provided block is valid and can extend this state fn validate_block(&self, block: &Self::BlockType, view_number: &Self::Time) -> bool; @@ -165,13 +160,6 @@ pub mod dummy { type BlockType = DummyBlock; type Time = ViewNumber; - fn next_block(state: Option) -> Self::BlockType { - match state { - Some(state) => DummyBlock { nonce: state.nonce }, - None => unimplemented!(), - } - } - fn validate_block(&self, _block: &Self::BlockType, _view_number: &Self::Time) -> bool { false } From 36bdd80c596d37eb82c033d63a7d37b2a4700afd Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 21 Sep 2023 18:23:37 -0700 Subject: [PATCH 02/14] Fix empty block and txn --- crates/hotshot/src/demo.rs | 4 +-- crates/hotshot/src/tasks/mod.rs | 7 ++-- crates/task-impls/src/consensus.rs | 16 +++------ crates/task-impls/src/transactions.rs | 47 +++++++++++++-------------- crates/testing/tests/da_task.rs | 1 - crates/testing/tests/network_task.rs | 2 -- crates/types/src/block_impl.rs | 1 - 7 files changed, 34 insertions(+), 44 deletions(-) diff --git a/crates/hotshot/src/demo.rs b/crates/hotshot/src/demo.rs index 976cea433d..468ff5e420 100644 --- a/crates/hotshot/src/demo.rs +++ b/crates/hotshot/src/demo.rs @@ -101,9 +101,9 @@ impl TestableState for SDemoState { fn create_random_transaction( _state: Option<&Self>, _rng: &mut dyn rand::RngCore, - padding: u64, + _padding: u64, ) -> ::Transaction { - VIDTransaction(vec![0; padding as usize]) + VIDTransaction(vec![0]) } } /// Implementation of [`NodeType`] for [`VDemoNode`] diff --git a/crates/hotshot/src/tasks/mod.rs b/crates/hotshot/src/tasks/mod.rs index 868768c3dc..bed3b3b344 100644 --- a/crates/hotshot/src/tasks/mod.rs +++ b/crates/hotshot/src/tasks/mod.rs @@ -38,7 +38,7 @@ use hotshot_types::{ node_implementation::{ CommitteeEx, ExchangesType, NodeImplementation, NodeType, ViewSyncEx, }, - state::ConsensusTime, + state::{ConsensusTime, TestableBlock}, }, vote::{ViewSyncData, VoteType}, }; @@ -251,7 +251,7 @@ where /// # Panics /// Is unable to panic. This section here is just to satisfy clippy pub async fn add_consensus_task< - TYPES: NodeType, + TYPES: NodeType, I: NodeImplementation< TYPES, Leaf = SequencingLeaf, @@ -289,7 +289,8 @@ where consensus, timeout: handle.hotshot.inner.config.next_view_timeout, cur_view: TYPES::Time::new(0), - block: None, + // TODO (Keyao) Shouldn't use test function. + block: ::genesis(), quorum_exchange: c_api.inner.exchanges.quorum_exchange().clone().into(), api: c_api.clone(), committee_exchange: c_api.inner.exchanges.committee_exchange().clone().into(), diff --git a/crates/task-impls/src/consensus.rs b/crates/task-impls/src/consensus.rs index ba5d288a23..b9a10e3d6e 100644 --- a/crates/task-impls/src/consensus.rs +++ b/crates/task-impls/src/consensus.rs @@ -80,11 +80,11 @@ pub struct SequencingConsensusTaskState< pub consensus: Arc>>>, /// View timeout from config. pub timeout: u64, - /// View number this view is executing in. + /// View number this view is executing in pub cur_view: TYPES::Time, - /// Current block submitted to DA, if any. - pub block: Option, + /// Current block submitted to DA + pub block: TYPES::BlockType, /// the quorum exchange pub quorum_exchange: Arc>, @@ -1078,7 +1078,7 @@ where } SequencingHotShotEvent::SendDABlockData(block) => { // ED TODO Should make sure this is actually the most recent block - self.block = Some(block); + self.block = block; } _ => {} } @@ -1150,13 +1150,7 @@ where // TODO do some sort of sanity check on the view number that it matches decided } - let block_commitment = match &self.block { - Some(block) => block.commit(), - None => { - debug!("No block yet."); - return false; - } - }; + let block_commitment = self.block.commit(); let leaf = SequencingLeaf { view_number: view, diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 2dce3684ba..c01cf1ca2b 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -18,12 +18,12 @@ use hotshot_types::{ block_impl::{VIDBlockPayload, VIDTransaction}, certificate::DACertificate, consensus::Consensus, - data::{SequencingLeaf, VidScheme, VidSchemeTrait}, - message::{Message, SequencingMessage}, + data::{SequencingLeaf, VidDisperse, VidScheme, VidSchemeTrait}, + message::{Message, Proposal, SequencingMessage}, traits::{ block_contents::Transaction, consensus_api::SequencingConsensusApi, - election::ConsensusExchange, + election::{CommitteeExchangeType, ConsensusExchange}, node_implementation::{CommitteeEx, NodeImplementation, NodeType}, BlockPayload, }, @@ -239,7 +239,7 @@ where let txns = self.wait_for_transactions(parent_leaf).await?; debug!("Prepare VID shares"); - if txns.len() > 0 { + if !txns.is_empty() { /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 const NUM_STORAGE_NODES: usize = 10; /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 @@ -254,31 +254,30 @@ where for txn in &txns { txns_flatten.extend(txn.bytes()); } - tracing::error!("here txn task {:?}", txns); let vid_disperse = vid.disperse(&txns_flatten).unwrap(); block = VIDBlockPayload::new(txns, vid_disperse.commit); - // TODO Commenting out the following code since we need to update the proposal, - // signature, and exchange for VID dispersal. They were copy-pasted from DA - // code. - // self.event_stream - // .publish(SequencingHotShotEvent::VidDisperseSend( - // Proposal { - // data: VidDisperse { - // view_number: view + 1, - // commitment: block.commit(), - // shares: vid_disperse.shares, - // common: vid_disperse.common, - // }, - // signature: message.signature, - // }, - // // TODO don't send to committee, send to quorum (consensus.rs) https://github.com/EspressoSystems/HotShot/issues/1696 - // self.committee_exchange.public_key().clone(), - // )) - // .await; + self.event_stream + .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) + .await; self.event_stream - .publish(SequencingHotShotEvent::BlockReady(block, view + 1)) + .publish(SequencingHotShotEvent::VidDisperseSend( + Proposal { + data: VidDisperse { + view_number: view + 1, + commitment: block.commit(), + shares: vid_disperse.shares, + common: vid_disperse.common, + }, + // TODO (Keyao) This is also signed in DA task. + signature: self + .committee_exchange + .sign_da_proposal(&block.commit()), + }, + // TODO don't send to committee, send to quorum (consensus.rs) https://github.com/EspressoSystems/HotShot/issues/1696 + self.committee_exchange.public_key().clone(), + )) .await; } return None; diff --git a/crates/testing/tests/da_task.rs b/crates/testing/tests/da_task.rs index ba042b35ee..7c8b389d95 100644 --- a/crates/testing/tests/da_task.rs +++ b/crates/testing/tests/da_task.rs @@ -41,7 +41,6 @@ async fn test_da_task() { let pub_key = *api.public_key(); let vid = vid_init(); let txn = vec![0u8]; - tracing::error!("here da task"); let vid_disperse = vid.disperse(&txn).unwrap(); let block_commitment = vid_disperse.commit; let block = VIDBlockPayload::new(vec![VIDTransaction(txn)], block_commitment); diff --git a/crates/testing/tests/network_task.rs b/crates/testing/tests/network_task.rs index f11508e8f6..3413bc4898 100644 --- a/crates/testing/tests/network_task.rs +++ b/crates/testing/tests/network_task.rs @@ -44,7 +44,6 @@ async fn test_network_task() { let priv_key = api.private_key(); let vid = vid_init(); let txn = vec![0u8]; - tracing::error!("here network task1"); let vid_disperse = vid.disperse(&txn).unwrap(); let block_commitment = vid_disperse.commit; let block = VIDBlockPayload::new(vec![VIDTransaction(txn)], block_commitment); @@ -59,7 +58,6 @@ async fn test_network_task() { let quorum_proposal = build_quorum_proposal(&handle, priv_key, 2).await; // TODO for now reuse the same block commitment and signature as DA committee // https://github.com/EspressoSystems/jellyfish/issues/369 - tracing::error!("here network task2"); let da_vid_disperse = Proposal { data: VidDisperse { view_number: da_proposal.data.view_number, diff --git a/crates/types/src/block_impl.rs b/crates/types/src/block_impl.rs index 79b0ce234b..bfe4ba6e59 100644 --- a/crates/types/src/block_impl.rs +++ b/crates/types/src/block_impl.rs @@ -113,7 +113,6 @@ impl TestableBlock for VIDBlockPayload { let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); let txn = vec![0u8]; - tracing::error!("here genesis"); let vid_disperse = vid.disperse(&txn).unwrap(); VIDBlockPayload::new(vec![VIDTransaction(txn)], vid_disperse.commit) } From a2759e258b3d368b76c855df7136e9ad7ddb622a Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 21 Sep 2023 18:44:58 -0700 Subject: [PATCH 03/14] Reorder events --- crates/task-impls/src/consensus.rs | 2 +- crates/task-impls/src/da.rs | 3 --- crates/task-impls/src/transactions.rs | 9 +++++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/task-impls/src/consensus.rs b/crates/task-impls/src/consensus.rs index b9a10e3d6e..4436e80de2 100644 --- a/crates/task-impls/src/consensus.rs +++ b/crates/task-impls/src/consensus.rs @@ -80,7 +80,7 @@ pub struct SequencingConsensusTaskState< pub consensus: Arc>>>, /// View timeout from config. pub timeout: u64, - /// View number this view is executing in + /// View number this view is executing in. pub cur_view: TYPES::Time, /// Current block submitted to DA diff --git a/crates/task-impls/src/da.rs b/crates/task-impls/src/da.rs index fe0a6ed311..5c4fb0fea3 100644 --- a/crates/task-impls/src/da.rs +++ b/crates/task-impls/src/da.rs @@ -643,9 +643,6 @@ where // Brodcast DA proposal // TODO ED We should send an event to do this, but just getting it to work for now - self.event_stream - .publish(SequencingHotShotEvent::SendDABlockData(block.clone())) - .await; // if let Err(e) = self.api.send_da_broadcast(message.clone()).await { // consensus.metrics.failed_to_send_messages.add(1); // warn!(?message, ?e, "Could not broadcast leader proposal"); diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index c01cf1ca2b..4aca5299f5 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -235,7 +235,6 @@ where drop(consensus); - let block; let txns = self.wait_for_transactions(parent_leaf).await?; debug!("Prepare VID shares"); @@ -255,12 +254,18 @@ where txns_flatten.extend(txn.bytes()); } let vid_disperse = vid.disperse(&txns_flatten).unwrap(); - block = VIDBlockPayload::new(txns, vid_disperse.commit); + let block = VIDBlockPayload::new(txns, vid_disperse.commit); + // TODO (Keyao) Is the order of the following events and events in the original + // DA task correct? self.event_stream .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) .await; + self.event_stream + .publish(SequencingHotShotEvent::SendDABlockData(block.clone())) + .await; + self.event_stream .publish(SequencingHotShotEvent::VidDisperseSend( Proposal { From 9fbdc95547865fb9ad73a5f569be8d233be57de6 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 21 Sep 2023 21:44:24 -0700 Subject: [PATCH 04/14] Add a logging to make test_success pass --- crates/task-impls/src/transactions.rs | 20 ++++++++++++-------- crates/types/src/block_impl.rs | 8 -------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 4aca5299f5..2e46ee8869 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -330,11 +330,14 @@ where loop { let all_txns = self.transactions.cloned().await; + tracing::error!("All txns {:?}", all_txns); debug!("Size of transactions: {}", all_txns.len()); - let unclaimed_txns: Vec<_> = all_txns - .iter() - .filter(|(txn_hash, _txn)| !previous_used_txns.contains(txn_hash)) - .collect(); + // TODO (Keyao) How to prevent duplicate txn now that we've removed the ID? + // let unclaimed_txns: Vec<_> = all_txns + // .iter() + // .filter(|(txn_hash, _txn)| !previous_used_txns.contains(txn_hash)) + // .collect(); + let unclaimed_txns = all_txns; let time_past = task_start_time.elapsed(); if unclaimed_txns.len() < self.api.min_transactions() @@ -363,11 +366,12 @@ where let txns: Vec = all_txns .iter() .filter_map(|(txn_hash, txn)| { - if previous_used_txns.contains(txn_hash) { - None - } else { + // TODO (Keyao) How to prevent duplicate txn now that we've removed the ID? + // if previous_used_txns.contains(txn_hash) { + // None + // } else { Some(txn.clone()) - } + // } }) .collect(); Some(txns) diff --git a/crates/types/src/block_impl.rs b/crates/types/src/block_impl.rs index bfe4ba6e59..4677cd5ab6 100644 --- a/crates/types/src/block_impl.rs +++ b/crates/types/src/block_impl.rs @@ -37,14 +37,6 @@ impl Transaction for VIDTransaction { } } -impl VIDTransaction { - /// create a new transaction - #[must_use] - pub fn new() -> Self { - Self(Vec::new()) - } -} - /// The error type for block payload. #[derive(Snafu, Debug)] pub enum BlockPayloadError { From 0c32b953475ae706d4377dd6f13a4a3f8bebcc31 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Fri, 22 Sep 2023 16:14:15 -0700 Subject: [PATCH 05/14] Make tests pass --- crates/orchestrator/default-libp2p-run-config.toml | 2 +- crates/orchestrator/default-run-config.toml | 2 +- crates/orchestrator/default-web-server-run-config.toml | 2 +- crates/task-impls/src/da.rs | 10 ++++------ crates/task-impls/src/transactions.rs | 7 +------ crates/testing/src/test_builder.rs | 6 +++--- crates/testing/tests/da_task.rs | 4 ---- 7 files changed, 11 insertions(+), 22 deletions(-) diff --git a/crates/orchestrator/default-libp2p-run-config.toml b/crates/orchestrator/default-libp2p-run-config.toml index 5757f4d9f9..220935614e 100644 --- a/crates/orchestrator/default-libp2p-run-config.toml +++ b/crates/orchestrator/default-libp2p-run-config.toml @@ -75,5 +75,5 @@ secs = 0 nanos = 0 [config.propose_max_round_time] -secs = 1 +secs = 2 nanos = 0 diff --git a/crates/orchestrator/default-run-config.toml b/crates/orchestrator/default-run-config.toml index fe34d75811..b8a4b19478 100644 --- a/crates/orchestrator/default-run-config.toml +++ b/crates/orchestrator/default-run-config.toml @@ -56,7 +56,7 @@ secs = 0 nanos = 0 [config.propose_max_round_time] -secs = 1 +secs = 2 nanos = 0 [web_server_config] diff --git a/crates/orchestrator/default-web-server-run-config.toml b/crates/orchestrator/default-web-server-run-config.toml index 0ea0f86ccf..28229f4d76 100644 --- a/crates/orchestrator/default-web-server-run-config.toml +++ b/crates/orchestrator/default-web-server-run-config.toml @@ -57,7 +57,7 @@ secs = 0 nanos = 0 [config.propose_max_round_time] -secs = 1 +secs = 2 nanos = 0 [web_server_config] diff --git a/crates/task-impls/src/da.rs b/crates/task-impls/src/da.rs index 5c4fb0fea3..6b3ba021a5 100644 --- a/crates/task-impls/src/da.rs +++ b/crates/task-impls/src/da.rs @@ -643,12 +643,10 @@ where // Brodcast DA proposal // TODO ED We should send an event to do this, but just getting it to work for now - // if let Err(e) = self.api.send_da_broadcast(message.clone()).await { - // consensus.metrics.failed_to_send_messages.add(1); - // warn!(?message, ?e, "Could not broadcast leader proposal"); - // } else { - // consensus.metrics.outgoing_broadcast_messages.add(1); - // } + self.event_stream + .publish(SequencingHotShotEvent::SendDABlockData(block.clone())) + .await; + self.event_stream .publish(SequencingHotShotEvent::DAProposalSend( message.clone(), diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 2e46ee8869..08854a98bb 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -262,10 +262,6 @@ where .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) .await; - self.event_stream - .publish(SequencingHotShotEvent::SendDABlockData(block.clone())) - .await; - self.event_stream .publish(SequencingHotShotEvent::VidDisperseSend( Proposal { @@ -330,7 +326,6 @@ where loop { let all_txns = self.transactions.cloned().await; - tracing::error!("All txns {:?}", all_txns); debug!("Size of transactions: {}", all_txns.len()); // TODO (Keyao) How to prevent duplicate txn now that we've removed the ID? // let unclaimed_txns: Vec<_> = all_txns @@ -370,7 +365,7 @@ where // if previous_used_txns.contains(txn_hash) { // None // } else { - Some(txn.clone()) + Some(txn.clone()) // } }) .collect(); diff --git a/crates/testing/src/test_builder.rs b/crates/testing/src/test_builder.rs index 326debb69b..3515f04368 100644 --- a/crates/testing/src/test_builder.rs +++ b/crates/testing/src/test_builder.rs @@ -124,7 +124,7 @@ impl TestMetadata { } } - /// Default setting with 20 nodes and 10 views of successful views. + /// Default setting with 20 nodes and 8 views of successful views. pub fn default_more_nodes_less_success() -> TestMetadata { TestMetadata { total_nodes: 20, @@ -139,11 +139,11 @@ impl TestMetadata { completion_task_description: CompletionTaskDescription::TimeBasedCompletionTaskBuilder( TimeBasedCompletionTaskDescription { // Increase the duration to get the expected number of successful views. - duration: Duration::new(40, 0), + duration: Duration::new(200, 0), }, ), overall_safety_properties: OverallSafetyPropertiesDescription { - num_successful_views: 10, + num_successful_views: 8, ..Default::default() }, ..TestMetadata::default() diff --git a/crates/testing/tests/da_task.rs b/crates/testing/tests/da_task.rs index 7c8b389d95..f1b1744884 100644 --- a/crates/testing/tests/da_task.rs +++ b/crates/testing/tests/da_task.rs @@ -103,10 +103,6 @@ async fn test_da_task() { let da_vote = committee_exchange.create_da_message(block.commit(), ViewNumber::new(2), vote_token); output.insert(SequencingHotShotEvent::DAVoteSend(da_vote), 1); - output.insert( - SequencingHotShotEvent::VidDisperseSend(vid_proposal.clone(), pub_key), - 1, - ); let vote_token = committee_exchange .make_vote_token(ViewNumber::new(2)) From 27a55cee08b4185257f5e86501d4d3738fcaa5a6 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Mon, 25 Sep 2023 12:44:16 -0700 Subject: [PATCH 06/14] Add gh issue and cleanup --- crates/hotshot/src/tasks/mod.rs | 5 ++- crates/task-impls/src/transactions.rs | 49 ++++++++++++++------------- crates/types/src/block_impl.rs | 31 ++++++++++------- 3 files changed, 45 insertions(+), 40 deletions(-) diff --git a/crates/hotshot/src/tasks/mod.rs b/crates/hotshot/src/tasks/mod.rs index bed3b3b344..fafc703075 100644 --- a/crates/hotshot/src/tasks/mod.rs +++ b/crates/hotshot/src/tasks/mod.rs @@ -38,7 +38,7 @@ use hotshot_types::{ node_implementation::{ CommitteeEx, ExchangesType, NodeImplementation, NodeType, ViewSyncEx, }, - state::{ConsensusTime, TestableBlock}, + state::ConsensusTime, }, vote::{ViewSyncData, VoteType}, }; @@ -289,8 +289,7 @@ where consensus, timeout: handle.hotshot.inner.config.next_view_timeout, cur_view: TYPES::Time::new(0), - // TODO (Keyao) Shouldn't use test function. - block: ::genesis(), + block: VIDBlockPayload::genesis(), quorum_exchange: c_api.inner.exchanges.quorum_exchange().clone().into(), api: c_api.clone(), committee_exchange: c_api.inner.exchanges.committee_exchange().clone().into(), diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 08854a98bb..b986cc931f 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -7,7 +7,7 @@ use async_lock::RwLock; use bincode::config::Options; use commit::Commitment; use commit::Committable; -use either::{Either, Left, Right}; +use either::{Left, Right}; use hotshot_task::{ event_stream::{ChannelStream, EventStream}, global_registry::GlobalRegistry, @@ -239,14 +239,12 @@ where debug!("Prepare VID shares"); if !txns.is_empty() { - /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 + // TODO https://github.com/EspressoSystems/HotShot/issues/1693 const NUM_STORAGE_NODES: usize = 10; - /// TODO https://github.com/EspressoSystems/HotShot/issues/1693 + // TODO https://github.com/EspressoSystems/HotShot/issues/1693 const NUM_CHUNKS: usize = 5; - // TODO https://github.com/EspressoSystems/HotShot/issues/1686 let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); - let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); // TODO https://github.com/EspressoSystems/jellyfish/issues/375 let mut txns_flatten = Vec::new(); @@ -256,8 +254,6 @@ where let vid_disperse = vid.disperse(&txns_flatten).unwrap(); let block = VIDBlockPayload::new(txns, vid_disperse.commit); - // TODO (Keyao) Is the order of the following events and events in the original - // DA task correct? self.event_stream .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) .await; @@ -312,22 +308,25 @@ where #[instrument(skip_all, fields(id = self.id, view = *self.cur_view), name = "Transaction Handling Task", level = "error")] async fn wait_for_transactions( &self, - parent_leaf: SequencingLeaf, + _parent_leaf: SequencingLeaf, ) -> Option> { let task_start_time = Instant::now(); + // TODO (Keyao) Investigate the use of transaction hash + // // let parent_leaf = self.parent_leaf().await?; - let previous_used_txns = match parent_leaf.deltas { - Either::Left(block) => block.contained_transactions(), - Either::Right(_commitment) => HashSet::new(), - }; + // let previous_used_txns = match parent_leaf.deltas { + // Either::Left(block) => block.contained_transactions(), + // Either::Right(_commitment) => HashSet::new(), + // }; let receiver = self.transactions.subscribe().await; loop { let all_txns = self.transactions.cloned().await; debug!("Size of transactions: {}", all_txns.len()); - // TODO (Keyao) How to prevent duplicate txn now that we've removed the ID? + // TODO (Keyao) Investigate the use of transaction hash + // // let unclaimed_txns: Vec<_> = all_txns // .iter() // .filter(|(txn_hash, _txn)| !previous_used_txns.contains(txn_hash)) @@ -358,17 +357,19 @@ where break; } let all_txns = self.transactions.cloned().await; - let txns: Vec = all_txns - .iter() - .filter_map(|(txn_hash, txn)| { - // TODO (Keyao) How to prevent duplicate txn now that we've removed the ID? - // if previous_used_txns.contains(txn_hash) { - // None - // } else { - Some(txn.clone()) - // } - }) - .collect(); + // TODO (Keyao) Investigate the use of transaction hash + // + let txns: Vec = all_txns.values().cloned().collect(); + // let txns: Vec = all_txns + // .iter() + // .filter_map(|(txn_hash, txn)| { + // if previous_used_txns.contains(txn_hash) { + // None + // } else { + // Some(txn.clone()) + // } + // }) + // .collect(); Some(txns) } diff --git a/crates/types/src/block_impl.rs b/crates/types/src/block_impl.rs index 4677cd5ab6..634adc2d4c 100644 --- a/crates/types/src/block_impl.rs +++ b/crates/types/src/block_impl.rs @@ -73,6 +73,23 @@ impl VIDBlockPayload { commitment, } } + + /// Create a genesis block payload with transaction bytes `vec![0]`. + /// # Panics + /// If the `VidScheme` construction fails. + #[must_use] + pub fn genesis() -> Self { + // TODO + const NUM_STORAGE_NODES: usize = 10; + // TODO + const NUM_CHUNKS: usize = 5; + // TODO + let srs = test_srs(NUM_STORAGE_NODES); + let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); + let txn = vec![0]; + let vid_disperse = vid.disperse(&txn).unwrap(); + VIDBlockPayload::new(vec![VIDTransaction(txn)], vid_disperse.commit) + } } impl Committable for VIDBlockPayload { @@ -94,19 +111,7 @@ impl Display for VIDBlockPayload { impl TestableBlock for VIDBlockPayload { fn genesis() -> Self { - /// TODO - const NUM_STORAGE_NODES: usize = 10; - /// TODO - const NUM_CHUNKS: usize = 5; - - // TODO - let srs = test_srs(NUM_STORAGE_NODES); - - let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); - - let txn = vec![0u8]; - let vid_disperse = vid.disperse(&txn).unwrap(); - VIDBlockPayload::new(vec![VIDTransaction(txn)], vid_disperse.commit) + Self::genesis() } fn txn_count(&self) -> u64 { From 5e6f0e0ddaae934fd54f29bbcaf40097374d3772 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Mon, 25 Sep 2023 13:21:20 -0700 Subject: [PATCH 07/14] Add another issue and fix lint --- crates/orchestrator/default-libp2p-run-config.toml | 4 ++++ crates/task-impls/src/transactions.rs | 6 +----- crates/testing/src/task_helpers.rs | 4 +--- crates/types/src/block_impl.rs | 11 +++++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/crates/orchestrator/default-libp2p-run-config.toml b/crates/orchestrator/default-libp2p-run-config.toml index 220935614e..9fb6cb6a17 100644 --- a/crates/orchestrator/default-libp2p-run-config.toml +++ b/crates/orchestrator/default-libp2p-run-config.toml @@ -51,6 +51,8 @@ mesh_outbound_min = 2 mesh_n = 4 next_view_timeout = 10 propose_min_round_time = 0 +# TODO Update libp2p config to use consistent propose_max_round_time. +# propose_max_round_time = 10 online_time = 10 num_txn_per_round = 10 @@ -75,5 +77,7 @@ secs = 0 nanos = 0 [config.propose_max_round_time] +# TODO Update libp2p config to use consistent propose_max_round_time. +# secs = 2 nanos = 0 diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index b986cc931f..11475fdbcf 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -15,7 +15,7 @@ use hotshot_task::{ task_impls::HSTWithEvent, }; use hotshot_types::{ - block_impl::{VIDBlockPayload, VIDTransaction}, + block_impl::{VIDBlockPayload, VIDTransaction, NUM_CHUNKS, NUM_STORAGE_NODES}, certificate::DACertificate, consensus::Consensus, data::{SequencingLeaf, VidDisperse, VidScheme, VidSchemeTrait}, @@ -239,10 +239,6 @@ where debug!("Prepare VID shares"); if !txns.is_empty() { - // TODO https://github.com/EspressoSystems/HotShot/issues/1693 - const NUM_STORAGE_NODES: usize = 10; - // TODO https://github.com/EspressoSystems/HotShot/issues/1693 - const NUM_CHUNKS: usize = 5; // TODO https://github.com/EspressoSystems/HotShot/issues/1686 let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); diff --git a/crates/testing/src/task_helpers.rs b/crates/testing/src/task_helpers.rs index 1a8123a35b..f4e7fe49a8 100644 --- a/crates/testing/src/task_helpers.rs +++ b/crates/testing/src/task_helpers.rs @@ -13,7 +13,7 @@ use hotshot::{ use hotshot_task::event_stream::ChannelStream; use hotshot_task_impls::events::SequencingHotShotEvent; use hotshot_types::{ - block_impl::VIDBlockPayload, + block_impl::{VIDBlockPayload, NUM_CHUNKS, NUM_STORAGE_NODES}, data::{QuorumProposal, SequencingLeaf, VidScheme, ViewNumber}, message::{Message, Proposal}, traits::{ @@ -165,8 +165,6 @@ pub fn key_pair_for_id(node_id: u64) -> (::PrivateKey } pub fn vid_init() -> VidScheme { - const NUM_STORAGE_NODES: usize = 10; - const NUM_CHUNKS: usize = 5; let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap() } diff --git a/crates/types/src/block_impl.rs b/crates/types/src/block_impl.rs index 634adc2d4c..03a9ca3737 100644 --- a/crates/types/src/block_impl.rs +++ b/crates/types/src/block_impl.rs @@ -13,6 +13,13 @@ use serde::{Deserialize, Serialize}; use sha3::{Digest, Keccak256}; use snafu::Snafu; +// TODO +/// Number of storage nodes for VID initiation. +pub const NUM_STORAGE_NODES: usize = 10; +// TODO +/// Number of chunks for VID initiation. +pub const NUM_CHUNKS: usize = 5; + /// The transaction in a [`VIDBlockPayload`]. #[derive(Default, PartialEq, Eq, Hash, Serialize, Deserialize, Clone, Debug)] pub struct VIDTransaction(pub Vec); @@ -79,10 +86,6 @@ impl VIDBlockPayload { /// If the `VidScheme` construction fails. #[must_use] pub fn genesis() -> Self { - // TODO - const NUM_STORAGE_NODES: usize = 10; - // TODO - const NUM_CHUNKS: usize = 5; // TODO let srs = test_srs(NUM_STORAGE_NODES); let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); From 2d51285e4f05033f0e156823310d8dba95622a26 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Mon, 25 Sep 2023 18:05:32 -0700 Subject: [PATCH 08/14] Address PR comments --- crates/hotshot/src/demo.rs | 7 ++++-- crates/task-impls/src/transactions.rs | 16 ++++++++++--- crates/testing/tests/da_task.rs | 6 ++++- crates/testing/tests/network_task.rs | 5 +++- crates/types/src/block_impl.rs | 29 ++++++++--------------- crates/types/src/traits/block_contents.rs | 14 +++++------ 6 files changed, 44 insertions(+), 33 deletions(-) diff --git a/crates/hotshot/src/demo.rs b/crates/hotshot/src/demo.rs index 468ff5e420..cec7120acd 100644 --- a/crates/hotshot/src/demo.rs +++ b/crates/hotshot/src/demo.rs @@ -101,9 +101,12 @@ impl TestableState for SDemoState { fn create_random_transaction( _state: Option<&Self>, _rng: &mut dyn rand::RngCore, - _padding: u64, + padding: u64, ) -> ::Transaction { - VIDTransaction(vec![0]) + if padding == 0 { + panic!("Padding should be nonzero for VID computation to work."); + } + VIDTransaction(vec![0; padding as usize]) } } /// Implementation of [`NodeType`] for [`VDemoNode`] diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 11475fdbcf..a9c8f9ad52 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -21,7 +21,6 @@ use hotshot_types::{ data::{SequencingLeaf, VidDisperse, VidScheme, VidSchemeTrait}, message::{Message, Proposal, SequencingMessage}, traits::{ - block_contents::Transaction, consensus_api::SequencingConsensusApi, election::{CommitteeExchangeType, ConsensusExchange}, node_implementation::{CommitteeEx, NodeImplementation, NodeType}, @@ -88,6 +87,9 @@ pub struct TransactionTaskState< pub id: u64, } +// We have two `TransactionTaskState` implementations with different bounds. The implementation +// here requires `TYPES: NodeType`, +// whereas it's just `TYPES: NodeType` in the second implementation. impl< TYPES: NodeType, I: NodeImplementation< @@ -245,15 +247,20 @@ where // TODO https://github.com/EspressoSystems/jellyfish/issues/375 let mut txns_flatten = Vec::new(); for txn in &txns { - txns_flatten.extend(txn.bytes()); + txns_flatten.extend(txn.0.clone()); } let vid_disperse = vid.disperse(&txns_flatten).unwrap(); - let block = VIDBlockPayload::new(txns, vid_disperse.commit); + let block = VIDBlockPayload { + transactions: txns, + commitment: vid_disperse.commit, + }; self.event_stream .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) .await; + // TODO (Keyao) Determine and update where to publish VidDisperseSend. + // self.event_stream .publish(SequencingHotShotEvent::VidDisperseSend( Proposal { @@ -284,6 +291,9 @@ where } } +// We have two `TransactionTaskState` implementations with different bounds. The implementation +// above requires `TYPES: NodeType`, +// whereas here it's just `TYPES: NodeType`. impl< TYPES: NodeType, I: NodeImplementation< diff --git a/crates/testing/tests/da_task.rs b/crates/testing/tests/da_task.rs index f1b1744884..e31c34e6aa 100644 --- a/crates/testing/tests/da_task.rs +++ b/crates/testing/tests/da_task.rs @@ -43,7 +43,11 @@ async fn test_da_task() { let txn = vec![0u8]; let vid_disperse = vid.disperse(&txn).unwrap(); let block_commitment = vid_disperse.commit; - let block = VIDBlockPayload::new(vec![VIDTransaction(txn)], block_commitment); + let block = VIDBlockPayload { + transactions: vec![VIDTransaction(txn)], + commitment: block_commitment, + }; + let signature = committee_exchange.sign_da_proposal(&block.commit()); let proposal = DAProposal { deltas: block.clone(), diff --git a/crates/testing/tests/network_task.rs b/crates/testing/tests/network_task.rs index 3413bc4898..c4165a8c31 100644 --- a/crates/testing/tests/network_task.rs +++ b/crates/testing/tests/network_task.rs @@ -46,7 +46,10 @@ async fn test_network_task() { let txn = vec![0u8]; let vid_disperse = vid.disperse(&txn).unwrap(); let block_commitment = vid_disperse.commit; - let block = VIDBlockPayload::new(vec![VIDTransaction(txn)], block_commitment); + let block = VIDBlockPayload { + transactions: vec![VIDTransaction(txn)], + commitment: block_commitment, + }; let signature = committee_exchange.sign_da_proposal(&block.commit()); let da_proposal = Proposal { data: DAProposal { diff --git a/crates/types/src/block_impl.rs b/crates/types/src/block_impl.rs index 03a9ca3737..2360cb3a24 100644 --- a/crates/types/src/block_impl.rs +++ b/crates/types/src/block_impl.rs @@ -38,11 +38,7 @@ impl Committable for VIDTransaction { } } -impl Transaction for VIDTransaction { - fn bytes(&self) -> Vec { - self.0.clone() - } -} +impl Transaction for VIDTransaction {} /// The error type for block payload. #[derive(Snafu, Debug)] @@ -69,29 +65,24 @@ pub struct VIDBlockPayload { } impl VIDBlockPayload { - /// Constructor. - #[must_use] - pub fn new( - transactions: Vec, - commitment: ::Commit, - ) -> Self { - Self { - transactions, - commitment, - } - } - - /// Create a genesis block payload with transaction bytes `vec![0]`. + /// Create a genesis block payload with transaction bytes `vec![0]`, to be used for + /// consensus task initiation. /// # Panics /// If the `VidScheme` construction fails. #[must_use] pub fn genesis() -> Self { // TODO let srs = test_srs(NUM_STORAGE_NODES); + // TODO We are using constant numbers for now, but they will change as the quorum size + // changes. + // TODO let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); let txn = vec![0]; let vid_disperse = vid.disperse(&txn).unwrap(); - VIDBlockPayload::new(vec![VIDTransaction(txn)], vid_disperse.commit) + VIDBlockPayload { + transactions: vec![VIDTransaction(txn)], + commitment: vid_disperse.commit, + } } } diff --git a/crates/types/src/traits/block_contents.rs b/crates/types/src/traits/block_contents.rs index 4ba10f601c..2fc3383a14 100644 --- a/crates/types/src/traits/block_contents.rs +++ b/crates/types/src/traits/block_contents.rs @@ -13,6 +13,8 @@ use std::{ hash::Hash, }; +// TODO (Keyao) Determine whether we can refactor BlockPayload and Transaction from traits to structs. +// /// Abstraction over the full contents of a block /// /// This trait encapsulates the behaviors that the transactions of a block must have in order to be @@ -45,12 +47,12 @@ pub trait BlockPayload: fn contained_transactions(&self) -> HashSet>; } +// TODO (Keyao) Determine whether we can refactor BlockPayload and Transaction from traits to structs. +// /// Abstraction over any type of transaction. Used by [`BlockPayload`]. pub trait Transaction: Clone + Serialize + DeserializeOwned + Debug + PartialEq + Eq + Sync + Send + Committable + Hash { - /// Get the transaction bytes. - fn bytes(&self) -> Vec; } /// Dummy implementation of `BlockPayload` for unit tests @@ -64,6 +66,8 @@ pub mod dummy { pub use crate::traits::state::dummy::DummyState; use crate::traits::state::TestableBlock; + // TODO (Keyao) Investigate the use of DummyBlock. + // /// The dummy block #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] pub struct DummyBlock { @@ -100,11 +104,7 @@ pub mod dummy { "DUMMY_TXN".to_string() } } - impl super::Transaction for DummyTransaction { - fn bytes(&self) -> Vec { - Vec::new() - } - } + impl super::Transaction for DummyTransaction {} impl std::error::Error for DummyError {} From bed3851497e5c3476ebf207665e64c0a0fa87e41 Mon Sep 17 00:00:00 2001 From: Gus Gutoski Date: Tue, 26 Sep 2023 10:41:47 -0400 Subject: [PATCH 09/14] nonzero base size for create_random_transaction --- crates/hotshot/src/demo.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/hotshot/src/demo.rs b/crates/hotshot/src/demo.rs index cec7120acd..ca00c535f3 100644 --- a/crates/hotshot/src/demo.rs +++ b/crates/hotshot/src/demo.rs @@ -103,10 +103,8 @@ impl TestableState for SDemoState { _rng: &mut dyn rand::RngCore, padding: u64, ) -> ::Transaction { - if padding == 0 { - panic!("Padding should be nonzero for VID computation to work."); - } - VIDTransaction(vec![0; padding as usize]) + const RANDOM_TX_BASE_SIZE: usize = 8; + VIDTransaction(vec![0; RANDOM_TX_BASE_SIZE + (padding as usize)]) } } /// Implementation of [`NodeType`] for [`VDemoNode`] From 8539bb2f842299b566c6a3bec52e8f6601bed135 Mon Sep 17 00:00:00 2001 From: Gus Gutoski Date: Tue, 26 Sep 2023 11:27:49 -0400 Subject: [PATCH 10/14] fix build break after merge main --- crates/task-impls/src/transactions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index e419115d90..4b0b46cfcf 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -307,7 +307,7 @@ where TYPES, Message, Certificate = DACertificate, - Commitment = TYPES::BlockType, + Commitment = Commitment, >, { #[instrument(skip_all, fields(id = self.id, view = *self.cur_view), name = "Transaction Handling Task", level = "error")] From 913f5aae22d2d50f54455228b7841aee7b3cca66 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Tue, 26 Sep 2023 16:28:34 -0700 Subject: [PATCH 11/14] Integrate with jellyfish update, update parameters and add issues --- Cargo.lock | 6 +- Cargo.toml | 6 +- .../default-libp2p-run-config.toml | 4 +- crates/orchestrator/default-run-config.toml | 2 + .../default-web-server-run-config.toml | 2 + crates/orchestrator/src/config.rs | 2 +- crates/task-impls/src/transactions.rs | 76 +++++++++---------- 7 files changed, 50 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a747048d8..1ba4c92226 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3270,7 +3270,7 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jf-primitives" version = "0.4.0-pre.0" -source = "git+https://github.com/EspressoSystems/jellyfish#f6866c5395405f807e62516b5d56d9dc390aeb61" +source = "git+https://github.com/EspressoSystems/jellyfish?branch=gg/376#798700771a90c16ee327404dda5bb742d6566d21" dependencies = [ "anyhow", "ark-bls12-377", @@ -3315,7 +3315,7 @@ dependencies = [ [[package]] name = "jf-relation" version = "0.4.0-pre.0" -source = "git+https://github.com/EspressoSystems/jellyfish#f6866c5395405f807e62516b5d56d9dc390aeb61" +source = "git+https://github.com/EspressoSystems/jellyfish?branch=gg/376#798700771a90c16ee327404dda5bb742d6566d21" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -3341,7 +3341,7 @@ dependencies = [ [[package]] name = "jf-utils" version = "0.4.0-pre.0" -source = "git+https://github.com/EspressoSystems/jellyfish#f6866c5395405f807e62516b5d56d9dc390aeb61" +source = "git+https://github.com/EspressoSystems/jellyfish?branch=gg/376#798700771a90c16ee327404dda5bb742d6566d21" dependencies = [ "ark-ec", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index 10990e7437..ba55fcf028 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,9 +52,9 @@ either = { version = "1.8" } espresso-systems-common = { git = "https://github.com/espressosystems/espresso-systems-common", tag = "0.4.1" } ethereum-types = { version = "0.14.1", features = ["impl-serde"] } futures = "0.3.28" -jf-primitives = { git = "https://github.com/EspressoSystems/jellyfish" } -jf-relation = { git = "https://github.com/EspressoSystems/jellyfish" } -jf-utils = { git = "https://github.com/espressosystems/jellyfish" } +jf-primitives = { git = "https://github.com/EspressoSystems/jellyfish", branch = "gg/376" } +jf-relation = { git = "https://github.com/EspressoSystems/jellyfish", branch = "gg/376" } +jf-utils = { git = "https://github.com/espressosystems/jellyfish", branch = "gg/376" } libp2p-identity = "0.2" libp2p-networking = { path = "./crates/libp2p-networking", version = "0.1.0", default-features = false } libp2p-swarm-derive = { version = "=0.33.0" } diff --git a/crates/orchestrator/default-libp2p-run-config.toml b/crates/orchestrator/default-libp2p-run-config.toml index 5892d3d95e..c217d24d1c 100644 --- a/crates/orchestrator/default-libp2p-run-config.toml +++ b/crates/orchestrator/default-libp2p-run-config.toml @@ -69,8 +69,8 @@ num_bootstrap = 5 secs = 0 nanos = 0 +# TODO (Keyao) Clean up configuration parameters. +# [config.propose_max_round_time] -# TODO Update libp2p config to use consistent propose_max_round_time. -# secs = 2 nanos = 0 diff --git a/crates/orchestrator/default-run-config.toml b/crates/orchestrator/default-run-config.toml index b8a4b19478..ee8333f80a 100644 --- a/crates/orchestrator/default-run-config.toml +++ b/crates/orchestrator/default-run-config.toml @@ -55,6 +55,8 @@ num_bootstrap = 4 secs = 0 nanos = 0 +# TODO (Keyao) Clean up configuration parameters. +# [config.propose_max_round_time] secs = 2 nanos = 0 diff --git a/crates/orchestrator/default-web-server-run-config.toml b/crates/orchestrator/default-web-server-run-config.toml index 28229f4d76..c5d0bd0253 100644 --- a/crates/orchestrator/default-web-server-run-config.toml +++ b/crates/orchestrator/default-web-server-run-config.toml @@ -56,6 +56,8 @@ num_bootstrap = 4 secs = 0 nanos = 0 +# TODO (Keyao) Clean up configuration parameters. +# [config.propose_max_round_time] secs = 2 nanos = 0 diff --git a/crates/orchestrator/src/config.rs b/crates/orchestrator/src/config.rs index 86dc6c5ae2..f61911d944 100644 --- a/crates/orchestrator/src/config.rs +++ b/crates/orchestrator/src/config.rs @@ -230,7 +230,7 @@ fn default_config() -> HotShotConfigFile { total_nodes: NonZeroUsize::new(10).unwrap(), committee_nodes: 5, max_transactions: NonZeroUsize::new(100).unwrap(), - min_transactions: 0, + min_transactions: 1, next_view_timeout: 10000, timeout_ratio: (11, 10), round_start_delay: 1, diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 4b0b46cfcf..c682f5f38d 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -237,48 +237,46 @@ where drop(consensus); let txns = self.wait_for_transactions(parent_leaf).await?; + // TODO (Keyao) Determine whether to allow empty transaction when proposing a block. + // debug!("Prepare VID shares"); - if !txns.is_empty() { - // TODO https://github.com/EspressoSystems/HotShot/issues/1686 - let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); - let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); - // TODO https://github.com/EspressoSystems/jellyfish/issues/375 - let mut txns_flatten = Vec::new(); - for txn in &txns { - txns_flatten.extend(txn.0.clone()); - } - let vid_disperse = vid.disperse(&txns_flatten).unwrap(); - let block = VIDBlockPayload { - transactions: txns, - commitment: vid_disperse.commit, - }; - - self.event_stream - .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) - .await; - - // TODO (Keyao) Determine and update where to publish VidDisperseSend. - // - self.event_stream - .publish(SequencingHotShotEvent::VidDisperseSend( - Proposal { - data: VidDisperse { - view_number: view + 1, - commitment: block.commit(), - shares: vid_disperse.shares, - common: vid_disperse.common, - }, - // TODO (Keyao) This is also signed in DA task. - signature: self - .committee_exchange - .sign_da_proposal(&block.commit()), - }, - // TODO don't send to committee, send to quorum (consensus.rs) https://github.com/EspressoSystems/HotShot/issues/1696 - self.committee_exchange.public_key().clone(), - )) - .await; + // TODO https://github.com/EspressoSystems/HotShot/issues/1686 + let srs = hotshot_types::data::test_srs(NUM_STORAGE_NODES); + let vid = VidScheme::new(NUM_CHUNKS, NUM_STORAGE_NODES, &srs).unwrap(); + // TODO https://github.com/EspressoSystems/jellyfish/issues/375 + let mut txns_flatten = Vec::new(); + for txn in &txns { + txns_flatten.extend(txn.0.clone()); } + let vid_disperse = vid.disperse(&txns_flatten).unwrap(); + let block = VIDBlockPayload { + transactions: txns, + commitment: vid_disperse.commit, + }; + + self.event_stream + .publish(SequencingHotShotEvent::BlockReady(block.clone(), view + 1)) + .await; + + // TODO (Keyao) Determine and update where to publish VidDisperseSend. + // + self.event_stream + .publish(SequencingHotShotEvent::VidDisperseSend( + Proposal { + data: VidDisperse { + view_number: view + 1, + commitment: block.commit(), + shares: vid_disperse.shares, + common: vid_disperse.common, + }, + // TODO (Keyao) This is also signed in DA task. + signature: self.committee_exchange.sign_da_proposal(&block.commit()), + }, + // TODO don't send to committee, send to quorum (consensus.rs) https://github.com/EspressoSystems/HotShot/issues/1696 + self.committee_exchange.public_key().clone(), + )) + .await; return None; } SequencingHotShotEvent::Shutdown => { From dfca82ef5ff353247a06fa01448954cfa0924651 Mon Sep 17 00:00:00 2001 From: Gus Gutoski Date: Wed, 27 Sep 2023 10:10:47 -0400 Subject: [PATCH 12/14] clippy appeasement --- crates/hotshot/src/demo.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/hotshot/src/demo.rs b/crates/hotshot/src/demo.rs index cac2dcfc75..81cac76f4b 100644 --- a/crates/hotshot/src/demo.rs +++ b/crates/hotshot/src/demo.rs @@ -103,6 +103,7 @@ impl TestableState for SDemoState { _rng: &mut dyn rand::RngCore, padding: u64, ) -> ::Transaction { + /// clippy appeasement for `RANDOM_TX_BASE_SIZE` const RANDOM_TX_BASE_SIZE: usize = 8; VIDTransaction(vec![0; RANDOM_TX_BASE_SIZE + (padding as usize)]) } From 0bb432e82404c6bcc8c105ce3bf57c6ba96a7238 Mon Sep 17 00:00:00 2001 From: Gus Gutoski Date: Wed, 27 Sep 2023 10:20:22 -0400 Subject: [PATCH 13/14] jellyfish dep use main branch --- Cargo.lock | 6 +++--- Cargo.toml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ba4c92226..23c5d0ff25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3270,7 +3270,7 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jf-primitives" version = "0.4.0-pre.0" -source = "git+https://github.com/EspressoSystems/jellyfish?branch=gg/376#798700771a90c16ee327404dda5bb742d6566d21" +source = "git+https://github.com/EspressoSystems/jellyfish#30752c6c1af7b933e2536d7aeb991a40af4b806a" dependencies = [ "anyhow", "ark-bls12-377", @@ -3315,7 +3315,7 @@ dependencies = [ [[package]] name = "jf-relation" version = "0.4.0-pre.0" -source = "git+https://github.com/EspressoSystems/jellyfish?branch=gg/376#798700771a90c16ee327404dda5bb742d6566d21" +source = "git+https://github.com/EspressoSystems/jellyfish#30752c6c1af7b933e2536d7aeb991a40af4b806a" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -3341,7 +3341,7 @@ dependencies = [ [[package]] name = "jf-utils" version = "0.4.0-pre.0" -source = "git+https://github.com/EspressoSystems/jellyfish?branch=gg/376#798700771a90c16ee327404dda5bb742d6566d21" +source = "git+https://github.com/EspressoSystems/jellyfish#30752c6c1af7b933e2536d7aeb991a40af4b806a" dependencies = [ "ark-ec", "ark-ff", diff --git a/Cargo.toml b/Cargo.toml index ba55fcf028..10990e7437 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,9 +52,9 @@ either = { version = "1.8" } espresso-systems-common = { git = "https://github.com/espressosystems/espresso-systems-common", tag = "0.4.1" } ethereum-types = { version = "0.14.1", features = ["impl-serde"] } futures = "0.3.28" -jf-primitives = { git = "https://github.com/EspressoSystems/jellyfish", branch = "gg/376" } -jf-relation = { git = "https://github.com/EspressoSystems/jellyfish", branch = "gg/376" } -jf-utils = { git = "https://github.com/espressosystems/jellyfish", branch = "gg/376" } +jf-primitives = { git = "https://github.com/EspressoSystems/jellyfish" } +jf-relation = { git = "https://github.com/EspressoSystems/jellyfish" } +jf-utils = { git = "https://github.com/espressosystems/jellyfish" } libp2p-identity = "0.2" libp2p-networking = { path = "./crates/libp2p-networking", version = "0.1.0", default-features = false } libp2p-swarm-derive = { version = "=0.33.0" } From 996400ef9ef1e3c93cced32da60e303164d588a4 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Wed, 27 Sep 2023 10:21:44 -0700 Subject: [PATCH 14/14] Revert cargo.lock change --- Cargo.lock | 464 +++++++++++++++++++++++------------------------------ 1 file changed, 205 insertions(+), 259 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0dd26a59ba..3c1554b852 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,9 +140,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" dependencies = [ "memchr", ] @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" @@ -575,7 +575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener", "futures-core", ] @@ -601,23 +601,24 @@ dependencies = [ [[package]] name = "async-dup" -version = "1.2.3" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865d94538a2d4f7197f9e08daf94203c06be78fe87a9d293ba4dd718028c5783" +checksum = "7427a12b8dc09291528cfb1da2447059adb4a257388c2acd6497a79d55cf6f7c" dependencies = [ "futures-io", + "simple-mutex", ] [[package]] name = "async-executor" -version = "1.5.3" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f2db9467baa66a700abce2a18c5ad793f6f83310aca1284796fc3921d113fd" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand 2.0.1", + "fastrand", "futures-lite", "slab", ] @@ -679,7 +680,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.23", + "rustix", "slab", "socket2 0.4.9", "waker-fn", @@ -691,53 +692,36 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener 2.5.3", + "event-listener", ] [[package]] name = "async-net" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +checksum = "4051e67316bc7eff608fe723df5d32ed639946adcd69e07df41fd42a7b411f1f" dependencies = [ "async-io", + "autocfg", "blocking", "futures-lite", ] [[package]] name = "async-process" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf012553ce51eb7aa6dc2143804cc8252bd1cb681a1c5cb7fa94ca88682dee1d" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" dependencies = [ "async-io", "async-lock", - "async-signal", + "autocfg", "blocking", "cfg-if", - "event-listener 3.0.0", + "event-listener", "futures-lite", - "rustix 0.38.14", - "windows-sys", -] - -[[package]] -name = "async-signal" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4af361a844928cb7d36590d406709473a1b574f443094422ef166daa3b493208" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "concurrent-queue", - "futures-core", - "futures-io", - "libc", - "signal-hook-registry", - "slab", + "rustix", + "signal-hook", "windows-sys", ] @@ -800,9 +784,9 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" @@ -812,7 +796,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -848,7 +832,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-sink", "futures-util", "memchr", @@ -857,9 +841,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "atomic_enum" @@ -887,7 +871,7 @@ dependencies = [ "async-trait", "axum-core", "bitflags 1.3.2", - "bytes 1.5.0", + "bytes 1.4.0", "futures-util", "http", "http-body", @@ -913,7 +897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", - "bytes 1.5.0", + "bytes 1.4.0", "futures-util", "http", "http-body", @@ -958,9 +942,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" [[package]] name = "base64ct" @@ -1051,18 +1035,17 @@ dependencies = [ [[package]] name = "blocking" -version = "1.4.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c4ef1f913d78636d78d538eec1f18de81e481f44b1be0a81060090530846e1" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ "async-channel", "async-lock", "async-task", - "fastrand 2.0.1", - "futures-io", + "atomic-waker", + "fastrand", "futures-lite", - "piper", - "tracing", + "log", ] [[package]] @@ -1086,9 +1069,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -1110,9 +1093,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" dependencies = [ "serde", ] @@ -1183,9 +1166,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "95ed24df0632f708f5f6d8082675bef2596f7084dee3dd55f632290bf35bfe0f" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1254,7 +1237,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -1316,9 +1299,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ "crossbeam-utils", ] @@ -1561,7 +1544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "704722d1d929489c8528bb1882805700f1ba20f54325704973e786352320b1ed" dependencies = [ "blake2", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "serdect", ] @@ -1612,9 +1595,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.66+curl-8.3.0" +version = "0.4.65+curl-8.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70c44a72e830f0e40ad90dda8a6ab6ed6314d39776599a58a2e5e37fbc6db5b9" +checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" dependencies = [ "cc", "libc", @@ -1623,7 +1606,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "windows-sys", + "winapi", ] [[package]] @@ -1641,9 +1624,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ "cfg-if", "cpufeatures", @@ -1664,7 +1647,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -1732,7 +1715,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -1754,7 +1737,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -1848,7 +1831,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -1970,7 +1953,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -1999,9 +1982,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dyn-clone" -version = "1.0.14" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "ed25519" @@ -2019,7 +2002,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.0.0", "ed25519", "rand_core 0.6.4", "serde", @@ -2154,17 +2137,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e56284f00d94c1bc7fd3c77027b4623c88c1f53d8d2394c6199f2921dea325" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.13", -] - [[package]] name = "eyre" version = "0.6.8" @@ -2184,17 +2156,11 @@ dependencies = [ "instant", ] -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" [[package]] name = "fixed-hash" @@ -2317,7 +2283,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand 1.9.0", + "fastrand", "futures-core", "futures-io", "memchr", @@ -2334,7 +2300,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -2479,7 +2445,7 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "futures-core", "futures-sink", @@ -2537,9 +2503,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -2915,7 +2881,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "itoa 1.0.9", ] @@ -2926,7 +2892,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "http", "pin-project-lite 0.2.13", ] @@ -2991,7 +2957,7 @@ version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-channel", "futures-core", "futures-util", @@ -3207,7 +3173,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", ] [[package]] @@ -3236,7 +3202,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.4", + "socket2 0.5.3", "widestring", "windows-sys", "winreg", @@ -3434,9 +3400,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libnghttp2-sys" @@ -3454,7 +3420,7 @@ version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32d07d1502a027366d55afe187621c2d7895dc111a3df13b35fed698049681d7" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "getrandom 0.2.10", @@ -3535,9 +3501,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.40.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" +checksum = "ef7dd7b09e71aac9271c60031d0e558966cdb3253ba0308ab369bb2de80630d0" dependencies = [ "either", "fnv", @@ -3617,9 +3583,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d157562dba6017193e5285acf6b1054759e83540bfd79f75b69d6ce774c88da" dependencies = [ "asynchronous-codec", - "base64 0.21.4", + "base64 0.21.3", "byteorder", - "bytes 1.5.0", + "bytes 1.4.0", "either", "fnv", "futures", @@ -3688,13 +3654,13 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.44.5" +version = "0.44.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c5c483b1e90e79409711f515c5bea5de9c4d772a245b1ac01a2233fbcb67fe" +checksum = "fc125f83d8f75322c79e4ade74677d299b34aa5c9d9b5251c03ec28c683cb765" dependencies = [ "arrayvec", "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "either", "fnv", "futures", @@ -3705,7 +3671,6 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "quick-protobuf-codec", "rand 0.8.5", "serde", "sha2 0.10.8", @@ -3732,7 +3697,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.5.4", + "socket2 0.5.3", "tokio", "trust-dns-proto", "void", @@ -3805,8 +3770,8 @@ version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce70757f2c0d82e9a3ef738fb10ea0723d16cec37f078f719e2c247704c1bb" dependencies = [ - "bytes 1.5.0", - "curve25519-dalek 4.1.1", + "bytes 1.4.0", + "curve25519-dalek 4.0.0", "futures", "libp2p-core", "libp2p-identity", @@ -3826,9 +3791,9 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.43.1" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" +checksum = "3cd5ee3270229443a2b34b27ed0cb7470ef6b4a6e45e54e89a8771fa683bab48" dependencies = [ "either", "futures", @@ -3849,7 +3814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37266c683a757df713f7dcda0cdcb5ad4681355ffa1b37b77c113c176a531195" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "libp2p-core", "libp2p-identity", @@ -3879,7 +3844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cb763e88f9a043546bfebd3575f340e7dd3d6c1b2cf2629600ec8965360c63a" dependencies = [ "async-std", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "if-watch", @@ -3891,7 +3856,7 @@ dependencies = [ "quinn", "rand 0.8.5", "rustls", - "socket2 0.5.4", + "socket2 0.5.3", "thiserror", "tokio", ] @@ -3903,7 +3868,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb07202cdf103486709fda5d9d10a0297a8ba01c212b1e19b7943c45c1bd7d6" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "either", "futures", "futures-timer", @@ -3964,9 +3929,9 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.43.5" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab94183f8fc2325817835b57946deb44340c99362cd4606c0a5717299b2ba369" +checksum = "28016944851bd73526d3c146aabf0fa9bbe27c558f080f9e5447da3a1772c01a" dependencies = [ "async-std", "either", @@ -3996,7 +3961,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -4013,7 +3978,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "socket2 0.5.4", + "socket2 0.5.3", "tokio", ] @@ -4166,12 +4131,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" -[[package]] -name = "linux-raw-sys" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" - [[package]] name = "lock_api" version = "0.4.10" @@ -4243,9 +4202,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matchit" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" [[package]] name = "maud" @@ -4403,9 +4362,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "2fd59dcc2bbe70baabeac52cd22ae52c55eefe6c38ff11a9439f16a350a939f2" dependencies = [ "core2", "serde", @@ -4418,7 +4377,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "pin-project", @@ -4527,7 +4486,7 @@ name = "netlink-proto" version = "0.9.2" source = "git+https://github.com/espressosystems/netlink.git#1347bed011eeae7ece9851773906c4a3c80a5d77" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "netlink-packet-core 0.4.2 (git+https://github.com/espressosystems/netlink.git)", @@ -4541,7 +4500,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "netlink-packet-core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4556,7 +4515,7 @@ version = "0.8.2" source = "git+https://github.com/espressosystems/netlink.git#1347bed011eeae7ece9851773906c4a3c80a5d77" dependencies = [ "async-io", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "libc", "log", @@ -4569,7 +4528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ "async-io", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "libc", "log", @@ -4715,9 +4674,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" dependencies = [ "cc", "libc", @@ -4781,9 +4740,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -4837,9 +4796,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.4" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" dependencies = [ "memchr", "thiserror", @@ -4848,9 +4807,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.4" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" dependencies = [ "pest", "pest_generator", @@ -4858,22 +4817,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.4" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] name = "pest_meta" -version = "2.7.4" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" dependencies = [ "once_cell", "pest", @@ -4897,7 +4856,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -4924,17 +4883,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15b6607fa632996eb8a17c9041cb6071cb75ac057abd45dece578723ea8c7c0" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.1", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.10.2" @@ -5085,14 +5033,14 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -5117,7 +5065,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -5126,7 +5074,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "prost-derive", ] @@ -5174,7 +5122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "quick-protobuf", "thiserror", "unsigned-varint", @@ -5199,7 +5147,7 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "async-io", "async-std", - "bytes 1.5.0", + "bytes 1.4.0", "futures-io", "pin-project-lite 0.2.13", "quinn-proto", @@ -5217,7 +5165,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "rand 0.8.5", "ring", "rustc-hash", @@ -5234,9 +5182,9 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "libc", - "socket2 0.5.4", + "socket2 0.5.3", "tracing", "windows-sys", ] @@ -5329,9 +5277,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -5339,12 +5287,14 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ + "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", + "num_cpus", ] [[package]] @@ -5463,7 +5413,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "rustc-hex", ] @@ -5571,7 +5521,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.19", + "semver 1.0.18", ] [[package]] @@ -5593,20 +5543,7 @@ dependencies = [ "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.8", - "windows-sys", -] - -[[package]] -name = "rustix" -version = "0.38.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys", "windows-sys", ] @@ -5624,9 +5561,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ "ring", "untrusted", @@ -5700,9 +5637,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "semver-parser" @@ -5733,7 +5670,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -5810,7 +5747,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" dependencies = [ - "base64 0.21.4", + "base64 0.21.3", "chrono", "hex", "indexmap 1.9.3", @@ -5830,7 +5767,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -5842,7 +5779,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -5981,6 +5918,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +[[package]] +name = "simple-mutex" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38aabbeafa6f6dead8cebf246fe9fae1f9215c8d29b3a69f93bd62a9e4a3dcd6" +dependencies = [ + "event-listener", +] + [[package]] name = "slab" version = "0.4.9" @@ -6003,9 +5949,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smartcow" @@ -6076,7 +6022,7 @@ dependencies = [ "aes-gcm 0.9.2", "blake2", "chacha20poly1305 0.9.1", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "ring", "rustc_version 0.4.0", @@ -6096,9 +6042,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", "windows-sys", @@ -6111,7 +6057,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "httparse", "log", @@ -6258,7 +6204,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -6309,15 +6255,15 @@ dependencies = [ [[package]] name = "sval" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d11eec9fbe2bc8bc71e7349f0e7534db9a96d961fb9f302574275b7880ad06" +checksum = "8b031320a434d3e9477ccf9b5756d57d4272937b8d22cb88af80b7633a1b78b1" [[package]] name = "sval_buffer" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7451f69a93c5baf2653d5aa8bb4178934337f16c22830a50b06b386f72d761" +checksum = "6bf7e9412af26b342f3f2cc5cc4122b0105e9d16eb76046cd14ed10106cf6028" dependencies = [ "sval", "sval_ref", @@ -6325,18 +6271,18 @@ dependencies = [ [[package]] name = "sval_dynamic" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f5a2cc12b4da2adfb59d5eedfd9b174a23cc3fae84cec71dcbcd9302068f5" +checksum = "a0ef628e8a77a46ed3338db8d1b08af77495123cc229453084e47cd716d403cf" dependencies = [ "sval", ] [[package]] name = "sval_fmt" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f578b2301341e246d00b35957f2952c4ec554ad9c7cfaee10bc86bc92896578" +checksum = "7dc09e9364c2045ab5fa38f7b04d077b3359d30c4c2b3ec4bae67a358bd64326" dependencies = [ "itoa 1.0.9", "ryu", @@ -6345,9 +6291,9 @@ dependencies = [ [[package]] name = "sval_json" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8346c00f5dc6efe18bea8d13c1f7ca4f112b20803434bf3657ac17c0f74cbc4b" +checksum = "ada6f627e38cbb8860283649509d87bc4a5771141daa41c78fd31f2b9485888d" dependencies = [ "itoa 1.0.9", "ryu", @@ -6356,18 +6302,18 @@ dependencies = [ [[package]] name = "sval_ref" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6617cc89952f792aebc0f4a1a76bc51e80c70b18c491bd52215c7989c4c3dd06" +checksum = "703ca1942a984bd0d9b5a4c0a65ab8b4b794038d080af4eb303c71bc6bf22d7c" dependencies = [ "sval", ] [[package]] name = "sval_serde" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe3d1e59f023341d9af75d86f3bc148a6704f3f831eef0dd90bbe9cb445fa024" +checksum = "830926cd0581f7c3e5d51efae4d35c6b6fc4db583842652891ba2f1bed8db046" dependencies = [ "serde", "sval", @@ -6388,9 +6334,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" dependencies = [ "proc-macro2", "quote", @@ -6540,22 +6486,22 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -6612,7 +6558,7 @@ dependencies = [ "maud 0.24.0", "parking_lot", "routefinder", - "semver 1.0.19", + "semver 1.0.18", "serde", "serde_json", "serde_with 2.3.3", @@ -6658,7 +6604,7 @@ dependencies = [ "maud 0.25.0", "parking_lot", "routefinder", - "semver 1.0.19", + "semver 1.0.18", "serde", "serde_json", "serde_with 3.3.0", @@ -6796,14 +6742,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", - "bytes 1.5.0", + "bytes 1.4.0", "libc", "mio", "num_cpus", "parking_lot", "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.3", "tokio-macros", "tracing", "windows-sys", @@ -6827,7 +6773,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -6843,11 +6789,11 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-core", "futures-sink", "pin-project-lite 0.2.13", @@ -6906,8 +6852,8 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.4", - "bytes 1.5.0", + "base64 0.21.3", + "bytes 1.4.0", "futures-core", "futures-util", "h2", @@ -6979,7 +6925,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ] [[package]] @@ -7126,7 +7072,7 @@ checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" dependencies = [ "base64 0.13.1", "byteorder", - "bytes 1.5.0", + "bytes 1.4.0", "http", "httparse", "input_buffer", @@ -7146,7 +7092,7 @@ checksum = "983d40747bce878d2fb67d910dcb8bd3eca2b2358540c3cc1b98c027407a3ae3" dependencies = [ "base64 0.13.1", "byteorder", - "bytes 1.5.0", + "bytes 1.4.0", "http", "httparse", "log", @@ -7198,9 +7144,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -7239,12 +7185,12 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", ] [[package]] @@ -7339,9 +7285,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "want" @@ -7387,7 +7333,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", "wasm-bindgen-shared", ] @@ -7421,7 +7367,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7700,5 +7646,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.31", ]