Skip to content

Commit

Permalink
[WEEKLY RELEASE] Hotshot 0.5.63 (#1759)
Browse files Browse the repository at this point in the history
Closes #<ISSUE_NUMBER>
<!-- These comments should help create a useful PR message, please
delete any remaining comments before opening the PR. -->
<!-- If there is no issue number make sure to describe clearly *why*
this PR is necessary. -->
<!-- Mention open questions, remaining TODOs, if any -->

### This PR:
<!-- Describe what this PR adds to this repo and why -->
<!-- E.g. -->
<!-- * Implements feature 1 -->
<!-- * Fixes bug 3 -->

### This PR does not:
<!-- Describe what is out of scope for this PR, if applicable. Leave
this section blank if it's not applicable -->
<!-- This section helps avoid the reviewer having to needlessly point
out missing parts -->
<!-- * Implement feature 3 because that feature is blocked by Issue 4
-->
<!-- * Implement xyz because that is tracked in issue #123. -->
<!-- * Address xzy for which I opened issue #456 -->

### Key places to review:
<!-- Describe key places for reviewers to pay close attention to -->
<!-- * file.rs, `add_integers` function -->
<!-- Or directly comment on those files/lines to make it easier for the
reviewers -->

<!-- ### How to test this PR:  -->
<!-- Optional, uncomment the above line if this is relevant to your PR
-->
<!-- If your PR is fully tested through CI there is no need to add this
section -->
<!-- * E.g. `just test` -->

<!-- ### Things tested -->
<!-- Anything that was manually tested (that is not tested in CI). -->
<!-- E.g. building/running of docker containers. Changes to docker demo,
... -->
<!-- Especially mention anything untested, with reasoning and link an
issue to resolve this. -->

<!-- Complete the following items before creating this PR -->
<!-- [ ] Issue linked or PR description mentions why this change is
necessary. -->
<!-- [ ] PR description is clear enough for reviewers. -->
<!-- [ ] Documentation for changes (additions) has been updated (added).
-->
<!-- [ ] If this is a draft it is marked as "draft".  -->

<!-- To make changes to this template edit
https://github.com/EspressoSystems/.github/blob/main/PULL_REQUEST_TEMPLATE.md
-->
  • Loading branch information
bfish713 authored Jul 23, 2024
2 parents 1d6f7d3 + 1cec17c commit a9db44e
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 115 deletions.
144 changes: 73 additions & 71 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ dotenvy = "0.15"
ethers = { version = "2.0", features = ["solc"] }
futures = "0.3"

hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }
# Hotshot imports
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.61" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "rc-0.1.33" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "rc-0.1.32" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "rc-0.1.44" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.63" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "rc-0.1.34" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "rc-0.1.33" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "rc-0.1.45" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }
hotshot-contract-adapter = { version = "0.1.0", path = "contracts/rust/adapter" }
# Temporary, used to pull in the mock auction results provider
hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.61" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.63" }

# Push CDN imports
cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [
Expand Down
11 changes: 5 additions & 6 deletions builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use hotshot::{
types::{SignatureKey, SystemContextHandle},
HotShotInitializer, Memberships, SystemContext,
};
use hotshot_builder_api::builder::{
use hotshot_builder_api::v0_1::builder::{
BuildError, Error as BuilderApiError, Options as HotshotBuilderApiOptions,
};
use hotshot_builder_core::service::{GlobalState, ProxyGlobalState};
Expand Down Expand Up @@ -76,15 +76,14 @@ pub mod permissioned;
// It runs the api service for the builder
pub fn run_builder_api_service(url: Url, source: ProxyGlobalState<SeqTypes>) {
// it is to serve hotshot
let builder_api = hotshot_builder_api::builder::define_api::<
let builder_api = hotshot_builder_api::v0_1::builder::define_api::<
ProxyGlobalState<SeqTypes>,
SeqTypes,
<SeqTypes as NodeType>::Base,
>(&HotshotBuilderApiOptions::default())
.expect("Failed to construct the builder APIs");

// it enables external clients to submit txn to the builder's private mempool
let private_mempool_api = hotshot_builder_api::builder::submit_api::<
let private_mempool_api = hotshot_builder_api::v0_1::builder::submit_api::<
ProxyGlobalState<SeqTypes>,
SeqTypes,
<SeqTypes as NodeType>::Base,
Expand Down Expand Up @@ -138,7 +137,7 @@ pub mod testing {
},
types::{EventType::Decide, Message},
};
use hotshot_builder_api::builder::{
use hotshot_builder_api::v0_1::builder::{
BuildError, Error as BuilderApiError, Options as HotshotBuilderApiOptions,
};
use hotshot_builder_core::{
Expand Down Expand Up @@ -678,7 +677,7 @@ mod test {
use ethers::providers::Quorum;
use futures::StreamExt;
use hotshot::types::EventType::Decide;
use hotshot_builder_api::block_info::AvailableBlockData;
use hotshot_builder_api::v0_1::block_info::AvailableBlockData;
use hotshot_builder_core::service::GlobalState;
use sequencer::{
empty_builder_commitment,
Expand Down
10 changes: 5 additions & 5 deletions builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use ethers::{
types::{Address, U256},
};
use hotshot::traits::BlockPayload;
use hotshot_builder_api::builder::{
use hotshot_builder_api::v0_1::builder::{
BuildError, Error as BuilderApiError, Options as HotshotBuilderApiOptions,
};
use hotshot_builder_core::{
Expand All @@ -34,7 +34,7 @@ use hotshot_builder_core::{
};
use hotshot_events_service::{
events::{Error as EventStreamApiError, Options as EventStreamingApiOptions},
events_source::{BuilderEvent, EventConsumer, EventsStreamer},
events_source::{EventConsumer, EventsStreamer},
};
use hotshot_types::{
data::{fake_commitment, Leaf, ViewNumber},
Expand Down Expand Up @@ -231,7 +231,7 @@ mod test {
use async_std::task;
use es_version::SequencerVersion;
use espresso_types::{FeeAccount, NamespaceId, Transaction};
use hotshot_builder_api::{
use hotshot_builder_api::v0_1::{
block_info::{AvailableBlockData, AvailableBlockHeaderInput, AvailableBlockInfo},
builder::BuildError,
};
Expand All @@ -244,7 +244,7 @@ mod test {
};
use hotshot_events_service::{
events::{Error as EventStreamApiError, Options as EventStreamingApiOptions},
events_source::{BuilderEvent, EventConsumer, EventsStreamer},
events_source::{EventConsumer, EventsStreamer},
};
use hotshot_types::{
signature_key::BLSPubKey,
Expand Down Expand Up @@ -317,7 +317,7 @@ mod test {

// Start a builder api client
let builder_client = Client::<
hotshot_builder_api::builder::Error,
hotshot_builder_api::v0_1::builder::Error,
<SeqTypes as NodeType>::Base,
>::new(hotshot_builder_api_url.clone());
assert!(builder_client.connect(Some(Duration::from_secs(60))).await);
Expand Down
12 changes: 6 additions & 6 deletions builder/src/permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use hotshot::{
types::{SignatureKey, SystemContextHandle},
HotShotInitializer, Memberships, SystemContext,
};
use hotshot_builder_api::builder::{
use hotshot_builder_api::v0_1::builder::{
BuildError, Error as BuilderApiError, Options as HotshotBuilderApiOptions,
};
use hotshot_builder_core::{
Expand All @@ -64,7 +64,7 @@ use hotshot_builder_core::{
};
use hotshot_events_service::{
events::{Error as EventStreamApiError, Options as EventStreamingApiOptions},
events_source::{BuilderEvent, EventConsumer, EventsStreamer},
events_source::{EventConsumer, EventsStreamer},
};
use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider;
use hotshot_orchestrator::{
Expand Down Expand Up @@ -241,7 +241,7 @@ pub async fn init_node<P: SequencerPersistence, Ver: StaticVersionType + 'static
let network = Arc::new(CombinedNetworks::new(
cdn_network,
p2p_network,
Duration::from_secs(1),
Some(Duration::from_secs(1)),
));

#[cfg(not(feature = "libp2p"))]
Expand Down Expand Up @@ -551,7 +551,7 @@ mod test {
use async_std::task;
use es_version::SequencerVersion;
use espresso_types::{FeeAccount, NamespaceId, Transaction};
use hotshot_builder_api::{
use hotshot_builder_api::v0_1::{
block_info::{AvailableBlockData, AvailableBlockHeaderInput, AvailableBlockInfo},
builder::BuildError,
};
Expand All @@ -564,7 +564,7 @@ mod test {
};
use hotshot_events_service::{
events::{Error as EventStreamApiError, Options as EventStreamingApiOptions},
events_source::{BuilderEvent, EventConsumer, EventsStreamer},
events_source::{EventConsumer, EventsStreamer},
};
use hotshot_types::{
signature_key::BLSPubKey,
Expand Down Expand Up @@ -626,7 +626,7 @@ mod test {

// Start a builder api client
let builder_client = Client::<
hotshot_builder_api::builder::Error,
hotshot_builder_api::v0_1::builder::Error,
<SeqTypes as NodeType>::Base,
>::new(hotshot_builder_api_url.clone());
assert!(builder_client.connect(Some(Duration::from_secs(60))).await);
Expand Down
25 changes: 18 additions & 7 deletions sequencer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ use futures::{
stream::{BoxStream, Stream},
};
use hotshot::types::{Event, SystemContextHandle};
use hotshot_events_service::events_source::{BuilderEvent, EventsSource, EventsStreamer};
use hotshot_events_service::events_source::{
EventFilterSet, EventsSource, EventsStreamer, StartupInfo,
};
use hotshot_orchestrator::config::NetworkConfig;
use hotshot_query_service::data_source::ExtensibleDataSource;
use hotshot_state_prover::service::light_client_genesis_from_stake_table;
Expand Down Expand Up @@ -127,14 +129,25 @@ type StorageState<N, P, D, Ver> = ExtensibleDataSource<D, ApiState<N, P, Ver>>;
impl<N: ConnectedNetwork<PubKey>, Ver: StaticVersionType + 'static, P: SequencerPersistence>
EventsSource<SeqTypes> for ApiState<N, P, Ver>
{
type EventStream = BoxStream<'static, Arc<BuilderEvent<SeqTypes>>>;
type EventStream = BoxStream<'static, Arc<Event<SeqTypes>>>;

async fn get_event_stream(&self) -> Self::EventStream {
async fn get_event_stream(
&self,
_filter: Option<EventFilterSet<SeqTypes>>,
) -> Self::EventStream {
self.event_streamer()
.await
.read()
.await
.get_event_stream(None)
.await
}
async fn get_startup_info(&self) -> StartupInfo<SeqTypes> {
self.event_streamer()
.await
.read()
.await
.get_event_stream()
.get_startup_info()
.await
}
}
Expand Down Expand Up @@ -964,7 +977,6 @@ mod api_tests {

#[async_std::test]
pub(crate) async fn test_hotshot_event_streaming<D: TestableSequencerDataSource>() {
use hotshot_events_service::events_source::BuilderEvent;
use HotshotEvents;

setup_logging();
Expand Down Expand Up @@ -998,7 +1010,7 @@ mod api_tests {

let mut subscribed_events = client
.socket("hotshot-events/events")
.subscribe::<BuilderEvent<SeqTypes>>()
.subscribe::<Event<SeqTypes>>()
.await
.unwrap();

Expand All @@ -1017,7 +1029,6 @@ mod api_tests {
break;
}
}
// Offset 1 is due to the startup event info
assert_eq!(receive_count, total_count + 1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ pub async fn init_node<P: PersistenceOptions, Ver: StaticVersionType + 'static>(
Arc::from(CombinedNetworks::new(
cdn_network,
p2p_network,
Duration::from_secs(1),
Some(Duration::from_secs(1)),
))
};

Expand Down
14 changes: 7 additions & 7 deletions types/src/v0/impls/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use ethers::types::Signature;
use hotshot_types::{
data::ViewNumber,
traits::{
auction_results_provider::HasUrl, node_implementation::ConsensusTime,
auction_results_provider::HasUrls, node_implementation::ConsensusTime,
signature_key::BuilderSignatureKey,
},
};
Expand Down Expand Up @@ -215,17 +215,17 @@ impl BidTx {
}
}

impl HasUrl for BidTx {
impl HasUrls for BidTx {
/// Get the `url` field from the body.
fn url(&self) -> Url {
self.body.url()
fn urls(&self) -> Vec<Url> {
self.body.urls()
}
}

impl HasUrl for BidTxBody {
impl HasUrls for BidTxBody {
/// Get the cloned `url` field.
fn url(&self) -> Url {
self.url.clone()
fn urls(&self) -> Vec<Url> {
vec![self.url.clone()]
}
}

Expand Down
3 changes: 2 additions & 1 deletion types/src/v0/impls/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ impl Header {
&ns_table,
&payload_commitment,
),
"invalid builder signature"
"invalid builder signature, account: {}, fee: {builder_fee:?}, ns_table: {ns_table:?}, payload_commitment: {payload_commitment}",
builder_fee.fee_account,
);
let builder_signature = Some(builder_fee.fee_signature);
let fee_info = builder_fee.into();
Expand Down

0 comments on commit a9db44e

Please sign in to comment.