Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builder changes/update hotshot #1369

Merged
merged 10 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 24 additions & 95 deletions Cargo.lock

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

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

# Hotshot imports
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.40" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.7" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.9" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.41" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.9" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.10" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot-web-server = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.40" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.9" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-web-server = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.41" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.10" }

# Push CDN imports
cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [
Expand Down
35 changes: 30 additions & 5 deletions builder/src/bin/permissioned-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,43 @@ pub struct PermissionedBuilderOptions {
pub state_peers: Vec<Url>,

/// Port to run the builder server on.
#[clap(short, long, env = "BUILDER_SERVER_PORT")]
#[clap(short, long, env = "ESPRESSO_BUILDER_SERVER_PORT")]
pub port: u16,

/// Port to run the builder server on.
#[clap(short, long, env = "BUILDER_ADDRESS")]
#[clap(short, long, env = "ESPRESSO_BUILDER_ADDRESS")]
sveitser marked this conversation as resolved.
Show resolved Hide resolved
pub address: Address,

/// Bootstrapping View number
#[clap(short, long, env = "BUILDER_BOOTSTRAPPED_VIEW")]
#[clap(short, long, env = "ESPRESSO_BUILDER_BOOTSTRAPPED_VIEW")]
pub view_number: u64,

/// BUILDER CHANNEL CAPACITY
#[clap(long, env = "BUILDER_CHANNEL_CAPACITY")]
#[clap(long, env = "ESPRESSO_BUILDER_CHANNEL_CAPACITY")]
pub channel_capacity: NonZeroUsize,

/// Url a builder can use to stream hotshot events
/// Url a sequencer can use to stream hotshot events
#[clap(long, env = "ESPRESSO_SEQUENCER_HOTSHOT_EVENTS_PROVIDER")]
pub hotshot_events_streaming_server_url: Url,

/// The amount of time a builder can wait before timing out a request to the API.
#[clap(
short,
long,
env = "ESPRESSO_BUILDER_WEBSERVER_RESPONSE_TIMEOUT_DURATION",
default_value = "1s",
value_parser = parse_duration
)]
pub max_api_timeout_duration: Duration,

/// The number of views to buffer before a builder garbage collects its state
#[clap(
short,
long,
env = "ESPRESSO_BUILDER_BUFFER_VIEW_NUM_COUNT",
default_value = "15"
)]
pub buffer_view_num_count: usize,
}

#[derive(Clone, Debug, Snafu)]
Expand Down Expand Up @@ -242,6 +261,10 @@ async fn main() -> anyhow::Result<()> {

let bootstrapped_view = ViewNumber::new(opt.view_number);

let max_response_timeout = opt.max_api_timeout_duration;

let buffer_view_num_count = opt.buffer_view_num_count;

// it will internally spawn the builder web server
let ctx = init_node(
network_params,
Expand All @@ -254,6 +277,8 @@ async fn main() -> anyhow::Result<()> {
opt.channel_capacity,
sequencer_version,
NoStorage,
max_response_timeout,
buffer_view_num_count,
)
.await?;

Expand Down
Loading
Loading