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

[WEEKLY RELEASE] HotShot 0.5.56 - Pre Release #1500

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
461 changes: 214 additions & 247 deletions Cargo.lock

Large diffs are not rendered by default.

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

hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.56-pre-release" }
# Hotshot imports
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.55" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.23" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.23" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.25" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.56-pre-release" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.24-pre-release" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.24-pre-release" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.56-pre-release" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.26-pre-release" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.56-pre-release" }
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.56-pre-release" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.56-pre-release" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.56-pre-release" }

# Push CDN imports
cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [
Expand Down
11 changes: 11 additions & 0 deletions builder/src/bin/permissioned-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ pub struct PermissionedBuilderOptions {
/// Base Fee for a block
#[clap(long, env = "ESPRESSO_BUILDER_BLOCK_BASE_FEE", default_value = "0")]
base_fee: u64,

/// The amount of time a builder can spend garbage collecting transactions.
#[clap(
short,
long,
env = "ESPRESSO_BUILDER_GARBAGE_COLLECT_DURATION",
default_value = "100ms",
value_parser = parse_duration
)]
txn_garbage_collect_duration: Duration,
}

#[derive(Clone, Debug, Snafu)]
Expand Down Expand Up @@ -293,6 +303,7 @@ async fn main() -> anyhow::Result<()> {
txn_timeout_duration,
opt.base_fee,
opt.max_block_size,
opt.txn_garbage_collect_duration,
)
.await?;

Expand Down
14 changes: 14 additions & 0 deletions builder/src/bin/permissionless-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ struct NonPermissionedBuilderOptions {
default_value = "15"
)]
buffer_view_num_count: usize,

/// The amount of time a builder can spend garbage collecting transactions.
#[clap(
short,
long,
env = "ESPRESSO_BUILDER_GARBAGE_COLLECT_DURATION",
default_value = "100ms",
value_parser = parse_duration
)]
txn_garbage_collect_duration: Duration,
}

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

let buffer_view_num_count = opt.buffer_view_num_count;

// How long can the builder spend garbage collecting?
let txn_garbage_collect_duration = opt.txn_garbage_collect_duration;

let _builder_config = BuilderConfig::init(
builder_key_pair,
bootstrapped_view,
Expand All @@ -149,6 +162,7 @@ async fn main() -> anyhow::Result<()> {
api_response_timeout_duration,
buffer_view_num_count,
txn_timeout_duration,
txn_garbage_collect_duration,
)
.await;

Expand Down
1 change: 1 addition & 0 deletions builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ pub mod testing {
Duration::from_millis(2000),
15,
Duration::from_millis(500),
Duration::from_millis(100),
)
.await
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ impl BuilderConfig {
max_api_timeout_duration: Duration,
buffered_view_num_count: usize,
maximize_txns_count_timeout_duration: Duration,
txn_garbage_collect_duration: Duration,
) -> anyhow::Result<Self> {
tracing::info!(
address = %builder_key_pair.fee_account(),
Expand Down Expand Up @@ -159,6 +160,7 @@ impl BuilderConfig {
.as_u64()
.context("the base fee exceeds the maximum amount that a builder can pay (defined by u64::MAX)")?,
Arc::new(instance_state),
txn_garbage_collect_duration,
);

// spawn the builder event loop
Expand Down
6 changes: 5 additions & 1 deletion builder/src/permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ pub async fn init_node<P: SequencerPersistence, Ver: StaticVersionType + 'static
maximize_txns_count_timeout_duration: Duration,
base_fee: u64,
max_block_size: u64,
txn_garbage_collect_duration: Duration,
) -> anyhow::Result<BuilderContext<network::Production, P, Ver>> {
// Orchestrator client
let validator_args = ValidatorArgs {
Expand Down Expand Up @@ -187,7 +188,7 @@ pub async fn init_node<P: SequencerPersistence, Ver: StaticVersionType + 'static
// Initialize the push CDN network (and perform the initial connection)
let cdn_network = PushCdnNetwork::new(
network_params.cdn_endpoint,
vec![Topic::Global, Topic::DA],
vec![Topic::Global, Topic::Da],
KeyPair {
public_key: WrappedSignatureKey(my_config.public_key),
private_key: my_config.private_key.clone(),
Expand Down Expand Up @@ -288,6 +289,7 @@ pub async fn init_node<P: SequencerPersistence, Ver: StaticVersionType + 'static
max_api_timeout_duration,
buffered_view_num_count,
maximize_txns_count_timeout_duration,
txn_garbage_collect_duration,
)
.await?;

Expand Down Expand Up @@ -383,6 +385,7 @@ impl<N: network::Type, P: SequencerPersistence, Ver: StaticVersionType + 'static
max_api_timeout_duration: Duration,
buffered_view_num_count: usize,
maximize_txns_count_timeout_duration: Duration,
txn_garbage_collect_duration: Duration,
) -> anyhow::Result<Self> {
// tx channel
let (tx_sender, tx_receiver) = broadcast::<MessageType<SeqTypes>>(channel_capacity.get());
Expand Down Expand Up @@ -446,6 +449,7 @@ impl<N: network::Type, P: SequencerPersistence, Ver: StaticVersionType + 'static
.as_u64()
.context("the base fee exceeds the maximum amount that a builder can pay (defined by u64::MAX)")?,
Arc::new(instance_state),
txn_garbage_collect_duration,
);

let hotshot_handle_clone = hotshot_handle.clone();
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ pub async fn init_node<P: PersistenceOptions, Ver: StaticVersionType + 'static>(
let topics = {
let mut topics = vec![Topic::Global];
if is_da {
topics.push(Topic::DA);
topics.push(Topic::Da);
}
topics
};
Expand Down
6 changes: 3 additions & 3 deletions sequencer/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use sequencer_utils::impl_to_fixed_bytes;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use std::time::Duration;
use std::{collections::HashSet, ops::Add, str::FromStr};
use std::{collections::BTreeSet, ops::Add, str::FromStr};
use vbs::version::Version;

const BLOCK_MERKLE_TREE_HEIGHT: usize = 32;
Expand All @@ -60,9 +60,9 @@ pub struct ValidatedState {
pub fee_merkle_tree: FeeMerkleTree,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq, Hash)]
pub struct Delta {
pub fees_delta: HashSet<FeeAccount>,
pub fees_delta: BTreeSet<FeeAccount>,
}

impl StateDelta for Delta {}
Expand Down
Loading