Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into rm/restructure-eve…
Browse files Browse the repository at this point in the history
…nts-vid
  • Loading branch information
rob-maron committed Nov 20, 2023
2 parents bdd33fc + 9c4dc2f commit 405c759
Show file tree
Hide file tree
Showing 26 changed files with 205 additions and 286 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build, Lint, and Test (self-hosted)

on:
push:
branches:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
matrix:
just_variants:
- async_std
#- tokio
runs-on: [self-hosted]
steps:
- uses: dtolnay/rust-toolchain@stable
name: Install Current Rust
with:
components: "clippy, rustfmt"

- uses: actions/checkout@v4
name: Checkout Repository

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
prefix-key: ${{ matrix.just_variants }}

- name: Run linting
run: |
just ${{ matrix.just_variants }} lint
- name: Build all crates in workspace
run: just ${{ matrix.just_variants }} build

- name: Unit and integration tests for all crates in workspace
run: |
just ${{ matrix.just_variants }} test
timeout-minutes: 60
env:
RUST_BACKTRACE: full
56 changes: 51 additions & 5 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @elliedavidson and @bfish713 will be requested for
# review when someone opens a pull request.
* @elliedavidson @bfish713
# Default owners and repository maintainers:
* @elliedavidson @bfish713

# Owner of `constants` crate
/constants/ @shenkeyao

# Owner of `hotshot` crate
/hotshot/ @shenkeyao

# Owner of `hotshot-qc` crate
/hotshot-qc/ @dailinsubjam

# Owner of `hotshot-signature-key` crate
/hotshot-signature-key/ @dailinsubjam

# Owner of `hotshot-stake-table` crate
/hotshot-stake-table/ @dailinsubjam

# Owner of `hotshot-state-prover` crate
/hotshot-state-prover/ @dailinsubjam

# Owner of `libp2p-networking` crate
/libp2p-networking/ @rob-maron @DieracDelta

# Owner of `orchestrator` crate
/orchestrator/ @rob-maron @elliedavidson

# Owner of `task` crate
/task/ @rob-maron @DieracDelta

# Owner of `task-impls` crate
/task-impls/ @elliedavidson @bfish713

# Owner of `testing` crate
/testing/ @DieracDelta @bfish713

# Owner of `types` crate
/types/ @shenkeyao

# Owner of `utils` crate
/utils/ @shenkeyao

# Owner of `web_server` crate
/web_server/ @elliedavidson

# Owner of updating dependencies
# This owner is updated on a monthly basis
*.lock @rob-maron
**/Cargo.toml @rob-maron
Cargo.toml @rob-maron
flake.nix @rob-maron
18 changes: 2 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sha2 = "0.10"
snafu = "0.7.5"
surf-disco = { git = "https://github.com/EspressoSystems/surf-disco.git", tag = "v0.4.3" }
time = "0.3.30"
toml = "0.7.8"
toml = "0.8.8"
tracing = "0.1.40"
typenum = "1.17.0"
libp2p = { package = "libp2p", version = "0.52.4", features = [
Expand Down
3 changes: 1 addition & 2 deletions crates/hotshot/examples/combined/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use hotshot::{
traits::implementations::{CombinedCommChannel, MemoryStorage},
};
use hotshot_types::{
message::{Message, SequencingMessage},
message::Message,
traits::{
election::{CommitteeExchange, QuorumExchange, VIDExchange, ViewSyncExchange},
node_implementation::{ChannelMaps, Exchanges, NodeImplementation, NodeType},
Expand Down Expand Up @@ -34,7 +34,6 @@ impl NodeImplementation<DemoTypes> for NodeImpl {
ViewSyncExchange<DemoTypes, DemoMembership, ViewSyncNetwork, Message<DemoTypes, Self>>,
VIDExchange<DemoTypes, DemoMembership, VIDNetwork, Message<DemoTypes, Self>>,
>;
type ConsensusMessage = SequencingMessage<DemoTypes, Self>;

fn new_channel_maps(
start_view: <DemoTypes as NodeType>::Time,
Expand Down
8 changes: 1 addition & 7 deletions crates/hotshot/examples/infra/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use hotshot_types::{
consensus::ConsensusMetricsValue,
data::{Leaf, TestableLeaf},
event::{Event, EventType},
message::{Message, SequencingMessage},
message::Message,
traits::{
election::{
CommitteeExchange, ConsensusExchange, Membership, QuorumExchange, ViewSyncExchange,
Expand Down Expand Up @@ -156,7 +156,6 @@ pub async fn run_orchestrator<
VIDExchange<TYPES, MEMBERSHIP, VIDCHANNEL, Message<TYPES, NODE>>,
>,
Storage = MemoryStorage<TYPES>,
ConsensusMessage = SequencingMessage<TYPES, NODE>,
>,
>(
OrchestratorArgs {
Expand Down Expand Up @@ -340,7 +339,6 @@ pub trait RunDA<
VIDExchange<TYPES, MEMBERSHIP, VIDCHANNEL, Message<TYPES, NODE>>,
>,
Storage = MemoryStorage<TYPES>,
ConsensusMessage = SequencingMessage<TYPES, NODE>,
>,
> where
<TYPES as NodeType>::StateType: TestableState,
Expand Down Expand Up @@ -585,7 +583,6 @@ impl<
>,
>,
Storage = MemoryStorage<TYPES>,
ConsensusMessage = SequencingMessage<TYPES, NODE>,
>,
>
RunDA<
Expand Down Expand Up @@ -726,7 +723,6 @@ impl<
>,
>,
Storage = MemoryStorage<TYPES>,
ConsensusMessage = SequencingMessage<TYPES, NODE>,
>,
>
RunDA<
Expand Down Expand Up @@ -852,7 +848,6 @@ impl<
>,
>,
Storage = MemoryStorage<TYPES>,
ConsensusMessage = SequencingMessage<TYPES, NODE>,
>,
>
RunDA<
Expand Down Expand Up @@ -981,7 +976,6 @@ pub async fn main_entry_point<
VIDExchange<TYPES, MEMBERSHIP, VIDCHANNEL, Message<TYPES, NODE>>,
>,
Storage = MemoryStorage<TYPES>,
ConsensusMessage = SequencingMessage<TYPES, NODE>,
>,
RUNDA: RunDA<TYPES, MEMBERSHIP, DACHANNEL, QUORUMCHANNEL, VIEWSYNCCHANNEL, VIDCHANNEL, NODE>,
>(
Expand Down
3 changes: 1 addition & 2 deletions crates/hotshot/examples/libp2p/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use hotshot::{
traits::implementations::{Libp2pCommChannel, MemoryStorage},
};
use hotshot_types::{
message::{Message, SequencingMessage},
message::Message,
traits::{
election::{CommitteeExchange, QuorumExchange, VIDExchange, ViewSyncExchange},
node_implementation::{ChannelMaps, Exchanges, NodeImplementation, NodeType},
Expand Down Expand Up @@ -34,7 +34,6 @@ impl NodeImplementation<DemoTypes> for NodeImpl {
ViewSyncExchange<DemoTypes, DemoMembership, ViewSyncNetwork, Message<DemoTypes, Self>>,
VIDExchange<DemoTypes, DemoMembership, VIDNetwork, Message<DemoTypes, Self>>,
>;
type ConsensusMessage = SequencingMessage<DemoTypes, Self>;

fn new_channel_maps(
start_view: <DemoTypes as NodeType>::Time,
Expand Down
3 changes: 1 addition & 2 deletions crates/hotshot/examples/webserver/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use hotshot::{
traits::implementations::{MemoryStorage, WebCommChannel},
};
use hotshot_types::{
message::{Message, SequencingMessage},
message::Message,
traits::{
election::{CommitteeExchange, QuorumExchange, VIDExchange, ViewSyncExchange},
node_implementation::{ChannelMaps, Exchanges, NodeImplementation, NodeType},
Expand Down Expand Up @@ -34,7 +34,6 @@ impl NodeImplementation<DemoTypes> for NodeImpl {
ViewSyncExchange<DemoTypes, DemoMembership, ViewSyncNetwork, Message<DemoTypes, Self>>,
VIDExchange<DemoTypes, DemoMembership, VIDNetwork, Message<DemoTypes, Self>>,
>;
type ConsensusMessage = SequencingMessage<DemoTypes, Self>;

fn new_channel_maps(
start_view: <DemoTypes as NodeType>::Time,
Expand Down
36 changes: 11 additions & 25 deletions crates/hotshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ use hotshot_types::{
data::Leaf,
error::StorageSnafu,
message::{
ConsensusMessageType, DataMessage, InternalTrigger, Message, MessageKind,
ProcessedGeneralConsensusMessage, SequencingMessage,
DataMessage, InternalTrigger, Message, MessageKind, ProcessedGeneralConsensusMessage,
SequencingMessage,
},
traits::{
consensus_api::{ConsensusApi, ConsensusSharedApi},
Expand Down Expand Up @@ -254,28 +254,19 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> SystemContext<TYPES, I> {
pub async fn timeout_view(
&self,
current_view: TYPES::Time,
send_replica: UnboundedSender<
<I::ConsensusMessage as ConsensusMessageType<TYPES, I>>::ProcessedConsensusMessage,
>,
send_next_leader: Option<
UnboundedSender<
<I::ConsensusMessage as ConsensusMessageType<TYPES, I>>::ProcessedConsensusMessage,
>,
>,
) where
<I::ConsensusMessage as ConsensusMessageType<TYPES, I>>::ProcessedConsensusMessage:
From<ProcessedGeneralConsensusMessage<TYPES, I>>,
{
send_replica: UnboundedSender<ProcessedGeneralConsensusMessage<TYPES, I>>,
send_next_leader: Option<UnboundedSender<ProcessedGeneralConsensusMessage<TYPES, I>>>,
) {
let msg = ProcessedGeneralConsensusMessage::<TYPES, I>::InternalTrigger(
InternalTrigger::Timeout(current_view),
);
if let Some(chan) = send_next_leader {
if chan.send(msg.clone().into()).await.is_err() {
if chan.send(msg.clone()).await.is_err() {
debug!("Error timing out next leader task");
}
};
// NOTE this should always exist
if send_replica.send(msg.into()).await.is_err() {
if send_replica.send(msg).await.is_err() {
debug!("Error timing out replica task");
};
}
Expand Down Expand Up @@ -610,11 +601,8 @@ pub trait HotShotType<TYPES: NodeType, I: NodeImplementation<TYPES>> {
}

#[async_trait]
impl<
TYPES: NodeType,
I: NodeImplementation<TYPES, ConsensusMessage = SequencingMessage<TYPES, I>>,
MEMBERSHIP: Membership<TYPES>,
> HotShotType<TYPES, I> for SystemContext<TYPES, I>
impl<TYPES: NodeType, I: NodeImplementation<TYPES>, MEMBERSHIP: Membership<TYPES>>
HotShotType<TYPES, I> for SystemContext<TYPES, I>
where
QuorumEx<TYPES, I>: ConsensusExchange<
TYPES,
Expand Down Expand Up @@ -830,10 +818,8 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> ConsensusSharedApi<TYPES, I>
}

#[async_trait]
impl<
TYPES: NodeType,
I: NodeImplementation<TYPES, ConsensusMessage = SequencingMessage<TYPES, I>>,
> ConsensusApi<TYPES, I> for HotShotConsensusApi<TYPES, I>
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> ConsensusApi<TYPES, I>
for HotShotConsensusApi<TYPES, I>
{
async fn send_direct_message(
&self,
Expand Down
Loading

0 comments on commit 405c759

Please sign in to comment.