Skip to content

Commit

Permalink
[WEEKLY RELEASE] HotShot - rc-0.5.68 (#1815)
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
lukaszrzasik authored Aug 5, 2024
2 parents f63d30f + d3233c4 commit 18ecb77
Show file tree
Hide file tree
Showing 8 changed files with 351 additions and 316 deletions.
594 changes: 314 additions & 280 deletions Cargo.lock

Large diffs are not rendered by default.

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

hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.67" }
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }
# Hotshot imports
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.67" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.38" }
marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", rev = "c1e60e76893557f21e8aea7e86994ebe107b4914" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.37" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.67" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.49" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.67" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.68" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.39" }
marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", tag = "0.0.2" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.38" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.50" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.67" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.67" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.67" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }
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 = "0.5.67" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.68" }

# Push CDN imports
cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [
Expand Down
12 changes: 4 additions & 8 deletions builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use hotshot_builder_api::v0_1::builder::{
};
use hotshot_builder_core::{
builder_state::{
BuildBlockInfo, BuilderProgress, BuilderState, BuiltFromProposedBlock, MessageType,
ResponseMessage,
BuildBlockInfo, BuilderState, BuiltFromProposedBlock, MessageType, ResponseMessage,
},
service::{
run_non_permissioned_standalone_builder_service, GlobalState, ProxyGlobalState,
Expand Down Expand Up @@ -234,12 +233,9 @@ mod test {
block_info::{AvailableBlockData, AvailableBlockHeaderInput, AvailableBlockInfo},
builder::BuildError,
};
use hotshot_builder_core::{
builder_state::BuilderProgress,
service::{
run_non_permissioned_standalone_builder_service,
run_permissioned_standalone_builder_service,
},
use hotshot_builder_core::service::{
run_non_permissioned_standalone_builder_service,
run_permissioned_standalone_builder_service,
};
use hotshot_events_service::{
events::{Error as EventStreamApiError, Options as EventStreamingApiOptions},
Expand Down
12 changes: 4 additions & 8 deletions builder/src/permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ use hotshot_builder_api::v0_1::builder::{
};
use hotshot_builder_core::{
builder_state::{
BuildBlockInfo, BuilderProgress, BuilderState, BuiltFromProposedBlock, MessageType,
ResponseMessage,
BuildBlockInfo, BuilderState, BuiltFromProposedBlock, MessageType, ResponseMessage,
},
service::{
run_non_permissioned_standalone_builder_service,
Expand Down Expand Up @@ -559,12 +558,9 @@ mod test {
block_info::{AvailableBlockData, AvailableBlockHeaderInput, AvailableBlockInfo},
builder::BuildError,
};
use hotshot_builder_core::{
builder_state::BuilderProgress,
service::{
run_non_permissioned_standalone_builder_service,
run_permissioned_standalone_builder_service,
},
use hotshot_builder_core::service::{
run_non_permissioned_standalone_builder_service,
run_permissioned_standalone_builder_service,
};
use hotshot_events_service::{
events::{Error as EventStreamApiError, Options as EventStreamingApiOptions},
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<N: ConnectedNetwork<PubKey>, P: SequencerPersistence> NodeImplementation<Se
{
type Network = N;
type Storage = Arc<RwLock<P>>;
type AuctionResultsProvider = TestAuctionResultsProvider;
type AuctionResultsProvider = TestAuctionResultsProvider<SeqTypes>;
}

#[derive(Clone, Debug)]
Expand Down
20 changes: 14 additions & 6 deletions types/src/v0/impls/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use ethers::types::Signature;
use hotshot_types::{
data::ViewNumber,
traits::{
auction_results_provider::{AuctionResultsProvider, HasUrls},
node_implementation::{ConsensusTime, NodeType},
auction_results_provider::AuctionResultsProvider,
node_implementation::{ConsensusTime, HasUrls, NodeType},
signature_key::BuilderSignatureKey,
},
};
Expand Down Expand Up @@ -288,22 +288,30 @@ type SurfClient<Ver> = surf_disco::Client<ServerError, Ver>;

#[async_trait]
impl<TYPES: NodeType> AuctionResultsProvider<TYPES> for SolverAuctionResults {
type AuctionResult = SolverAuctionResults;

/// Fetch the auction results.
async fn fetch_auction_result(
&self,
view_number: TYPES::Time,
) -> anyhow::Result<Self::AuctionResult> {
) -> anyhow::Result<TYPES::AuctionResult> {
let resp = SurfClient::<Ver>::new(Url::from_str(SOLVER_URL).unwrap())
.get::<SolverAuctionResults>(&format!("/v0/api/auction_results/{}", *view_number))
.get::<TYPES::AuctionResult>(&format!("/v0/api/auction_results/{}", *view_number))
.send()
.await
.unwrap();
Ok(resp)
}
}

impl Default for SolverAuctionResults {
fn default() -> Self {
Self {
view_number: ViewNumber::genesis(),
reserve_bids: Vec::default(),
winning_bids: Vec::default(),
}
}
}

mod test {
use super::*;

Expand Down
1 change: 0 additions & 1 deletion types/src/v0/impls/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,6 @@ impl From<anyhow::Error> for InvalidBlockHeader {

impl BlockHeader<SeqTypes> for Header {
type Error = InvalidBlockHeader;
type AuctionResult = SolverAuctionResults;

/// Get the results of the auction for this Header. Only used in post-marketplace versions
fn get_auction_results(&self) -> Option<SolverAuctionResults> {
Expand Down
2 changes: 2 additions & 0 deletions types/src/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ impl NodeType for SeqTypes {
type BuilderSignatureKey = FeeAccount;
type Base = StaticVersion<0, 1>;
type Upgrade = StaticVersion<0, 2>;
type AuctionResult = SolverAuctionResults;
const UPGRADE_HASH: [u8; 32] = [
1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0,
Expand All @@ -152,3 +153,4 @@ pub use crate::v0_1::{
BLOCK_MERKLE_TREE_HEIGHT, FEE_MERKLE_TREE_HEIGHT, NS_ID_BYTE_LEN, NS_OFFSET_BYTE_LEN,
NUM_NSS_BYTE_LEN, NUM_TXS_BYTE_LEN, TX_OFFSET_BYTE_LEN,
};
use crate::v0_3::SolverAuctionResults;

0 comments on commit 18ecb77

Please sign in to comment.