Skip to content

Commit 9964a0a

Browse files
apollo_batcher: comment out code that triggers the new comitter
1 parent a0de94e commit 9964a0a

File tree

3 files changed

+36
-23
lines changed

3 files changed

+36
-23
lines changed

crates/apollo_batcher/src/batcher.rs

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ pub struct Batcher {
183183
/// The proposal commitment of the previous height.
184184
/// This is returned by the decision_reached function.
185185
prev_proposal_commitment: Option<(BlockNumber, ProposalCommitment)>,
186-
186+
// TODO(Einat): Remove the allow(dead_code) when the committer should be enabled.
187+
#[allow(dead_code)]
187188
commitment_manager: ApolloCommitmentManager,
188189

189190
// Kept alive to maintain the server running.
@@ -717,6 +718,8 @@ impl Batcher {
717718
StorageCommitmentBlockHash::ParentHash(block_header_without_hash.parent_hash)
718719
};
719720

721+
// TODO(Einat): Remove allow(unused_variables) when the committer should be enabled.
722+
#[allow(unused_variables)]
720723
let optional_state_diff_commitment = match &storage_commitment_block_hash {
721724
StorageCommitmentBlockHash::ParentHash(_) => None,
722725
StorageCommitmentBlockHash::Partial(PartialBlockHashComponents {
@@ -734,13 +737,13 @@ impl Batcher {
734737
storage_commitment_block_hash,
735738
)
736739
.await?;
737-
738-
self.write_commitment_results_and_add_new_task(
739-
height,
740-
state_diff,
741-
optional_state_diff_commitment,
742-
)
743-
.await?;
740+
// TODO(Einat): Uncomment when the committer should be enabled.
741+
// self.write_commitment_results_and_add_new_task(
742+
// height,
743+
// state_diff,
744+
// optional_state_diff_commitment,
745+
// )
746+
// .await?;
744747

745748
LAST_SYNCED_BLOCK_HEIGHT.set_lossy(block_number.0);
746749
SYNCED_TRANSACTIONS.increment(
@@ -781,6 +784,8 @@ impl Batcher {
781784
.expect("Number of reverted transactions should fit in u64");
782785
let partial_block_hash_components =
783786
block_execution_artifacts.partial_block_hash_components();
787+
// TODO(Einat): Remove allow(unused_variables) when the committer should be enabled.
788+
#[allow(unused_variables)]
784789
let state_diff_commitment =
785790
partial_block_hash_components.header_commitments.state_diff_commitment;
786791
let block_header_commitments = partial_block_hash_components.header_commitments.clone();
@@ -795,12 +800,13 @@ impl Batcher {
795800
)
796801
.await?;
797802

798-
self.write_commitment_results_and_add_new_task(
799-
height,
800-
state_diff.clone(), // TODO(Nimrod): Remove the clone here.
801-
Some(state_diff_commitment),
802-
)
803-
.await?;
803+
// TODO(Einat): Uncomment when the committer should be enabled.
804+
// self.write_commitment_results_and_add_new_task(
805+
// height,
806+
// state_diff.clone(), // TODO(Nimrod): Remove the clone here.
807+
// Some(state_diff_commitment),
808+
// )
809+
// .await?;
804810

805811
let execution_infos = block_execution_artifacts
806812
.execution_data
@@ -1275,7 +1281,8 @@ impl Batcher {
12751281
})?;
12761282
Ok(())
12771283
}
1278-
1284+
// TODO(Einat): Remove the allow(dead_code) when the committer should be enabled.
1285+
#[allow(dead_code)]
12791286
async fn write_commitment_results_and_add_new_task(
12801287
&mut self,
12811288
height: BlockNumber,
@@ -1625,14 +1632,15 @@ impl ComponentStarter for Batcher {
16251632

16261633
register_metrics(storage_height, global_root_height);
16271634

1628-
self.commitment_manager
1629-
.add_missing_commitment_tasks(
1630-
storage_height,
1631-
&self.config,
1632-
self.storage_reader.clone(),
1633-
&mut self.storage_writer,
1634-
)
1635-
.await;
1635+
// TODO(Einat): Uncomment when the committer should be enabled.
1636+
// self.commitment_manager
1637+
// .add_missing_commitment_tasks(
1638+
// storage_height,
1639+
// &self.config,
1640+
// self.storage_reader.clone(),
1641+
// &mut self.storage_writer,
1642+
// )
1643+
// .await;
16361644
}
16371645
}
16381646

crates/apollo_batcher/src/commitment_manager/commitment_manager_impl.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ impl<S: StateCommitterTrait> CommitmentManager<S> {
7979
)
8080
}
8181

82+
#[allow(dead_code)]
8283
pub(crate) fn get_commitment_task_offset(&self) -> BlockNumber {
8384
self.commitment_task_offset
8485
}
@@ -354,6 +355,7 @@ impl<S: StateCommitterTrait> CommitmentManager<S> {
354355
self.commitment_task_offset.prev().expect("Can't revert before the genesis block.");
355356
}
356357

358+
#[allow(dead_code)]
357359
async fn read_commitment_input_and_add_task<
358360
R: BatcherStorageReader + ?Sized,
359361
W: BatcherStorageWriter + ?Sized,
@@ -403,6 +405,7 @@ impl<S: StateCommitterTrait> CommitmentManager<S> {
403405
/// Adds missing commitment tasks to the commitment manager. Missing tasks are caused by
404406
/// unfinished commitment tasks / results not written to storage when the sequencer is shut
405407
/// down.
408+
#[allow(dead_code)]
406409
pub(crate) async fn add_missing_commitment_tasks<
407410
R: BatcherStorageReader + ?Sized,
408411
W: BatcherStorageWriter + ?Sized,

crates/apollo_batcher/src/commitment_manager/commitment_manager_test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ async fn test_create_commitment_manager(mut mock_dependencies: MockDependencies)
203203
}
204204

205205
#[rstest]
206+
// TODO(Einat): Remove ignore when the committer should be enabled.
207+
#[ignore]
206208
#[tokio::test]
207209
async fn test_add_missing_commitment_tasks(mut mock_dependencies: MockDependencies) {
208210
let global_root_height = INITIAL_HEIGHT.prev().unwrap();

0 commit comments

Comments
 (0)