Skip to content

Commit

Permalink
pass simple builder config
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed May 30, 2024
1 parent 3568098 commit 0b6bd2b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ 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),
//????
Duration::from_secs(60),
Arc::new(validated_state),
//????
Duration::from_secs(60),

);

// spawn the builder event loop
Expand Down
10 changes: 5 additions & 5 deletions builder/src/permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ impl<N: network::Type, P: SequencerPersistence, Ver: StaticVersionType + 'static
/// Constructor
#[allow(clippy::too_many_arguments)]
pub async fn init(
hotshot_handle: Consensus<N, P>,
hotshot_handle: Arc<Consensus<N, P>>,
state_signer: StateSigner<Ver>,
node_index: u64,
eth_key_pair: EthKeyPair,
Expand Down Expand Up @@ -457,10 +457,10 @@ impl<N: network::Type, P: SequencerPersistence, Ver: StaticVersionType + 'static
.base_fee
.as_u64()
.context("the base fee exceeds the maximum amount that a builder can pay (defined by u64::MAX)")?,
Arc::new(instance_state),
Arc::new(instance_state), //??
Duration::from_secs(60),
Arc::new(validated_state),
//??
Duration::from_secs(60)

);

let hotshot_handle_clone = Arc::clone(&hotshot_handle);
Expand All @@ -471,7 +471,7 @@ impl<N: network::Type, P: SequencerPersistence, Ver: StaticVersionType + 'static
da_sender,
qc_sender,
decide_sender,
hotshot_handle,
hotshot_handle_clone,
)
.await;
});
Expand Down
2 changes: 1 addition & 1 deletion sequencer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ pub mod test_helpers {
) -> Self {
let mut cfg = TestConfig::default_with_l1(l1);

let (builder_task, builder_url) = run_test_builder().await;
let (builder_task, builder_url) = run_test_builder(None).await;

cfg.set_builder_url(builder_url);

Expand Down
11 changes: 7 additions & 4 deletions sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ pub mod testing {
};
use hotshot::types::{EventType::Decide, Message};
use hotshot_stake_table::vec_based::StakeTable;
use hotshot_testing::block_builder::SimpleBuilderConfig;
use hotshot_testing::block_builder::{
BuilderTask, SimpleBuilderImplementation, TestBuilderImplementation,
};
Expand All @@ -528,10 +529,12 @@ pub mod testing {

const STAKE_TABLE_CAPACITY_FOR_TEST: u64 = 10;

pub async fn run_test_builder() -> (Option<Box<dyn BuilderTask<SeqTypes>>>, Url) {
pub async fn run_test_builder(
_port: Option<u16>,
) -> (Option<Box<dyn BuilderTask<SeqTypes>>>, Url) {
<SimpleBuilderImplementation as TestBuilderImplementation<SeqTypes>>::start(
TestConfig::NUM_NODES,
(),
SimpleBuilderConfig::default(),
)
.await
}
Expand Down Expand Up @@ -806,7 +809,7 @@ mod test {
let url = anvil.url();
let mut config = TestConfig::default_with_l1(url);

let (builder_task, builder_url) = run_test_builder().await;
let (builder_task, builder_url) = run_test_builder(None).await;

config.set_builder_url(builder_url);

Expand Down Expand Up @@ -848,7 +851,7 @@ mod test {
let url = anvil.url();
let mut config = TestConfig::default_with_l1(url);

let (builder_task, builder_url) = run_test_builder().await;
let (builder_task, builder_url) = run_test_builder(None).await;

config.set_builder_url(builder_url);
let handles = config.init_nodes(ver).await;
Expand Down

0 comments on commit 0b6bd2b

Please sign in to comment.