Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Add Unit Tests to process_da_proposal() #129

Merged
merged 22 commits into from
Sep 19, 2024
Merged

Add Unit Tests to process_da_proposal() #129

merged 22 commits into from
Sep 19, 2024

Conversation

dailinsubjam
Copy link
Contributor

@dailinsubjam dailinsubjam commented Sep 13, 2024

Closes #134 and part of #133

This PR:

  • Added a unit test and some documentation for process_da_proposal().

This PR does not:

  • Add other tests in builder_state.rs yet.

Key places to review:

  • mod test in builder_state.rs.

How to test this PR:

RUSTFLAGS="--cfg async_executor_impl=\"tokio\"" RUST_LOG=debug cargo test test_process_da_proposal

@dailinsubjam dailinsubjam marked this pull request as draft September 13, 2024 09:34
@dailinsubjam dailinsubjam changed the title Add Unit Tests to builder_state.rs Add Unit Tests to process_da_proposal() Sep 13, 2024
// check the presence of quorum_proposal.data.view_number-1 in the spawned_builder_states list
if qc_msg.proposal.data.justify_qc.view_number != self.built_from_proposed_block.view_number
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... You added this back in? I had removed this primarily due to handling similar logic with the am_i_the_best_builder_state_to_extend logic, and to make the process_quorum_proposal and process_da_proposal have similar logic paths.

I think with this present, some of the order tests don't pass.

Copy link
Contributor Author

@dailinsubjam dailinsubjam Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ayiga oops sorry I think this is because I didn't look carefully when doing conflict resolving, I shouldn't be changing anything in process_quorum_proposal(), let me recheck all these.

@dailinsubjam dailinsubjam marked this pull request as ready for review September 16, 2024 22:27
@dailinsubjam dailinsubjam requested a review from Ayiga September 16, 2024 22:30
.process_da_proposal(practice_da_msg_2.clone())
.await;
} else {
tracing::error!("Not a da_proposal_message in correct format");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think it's better to panic directly in tests to make it explicit that we hit something unexpected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

Copy link
Member

@shenkeyao shenkeyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are several tracing left in this file that could be replaced by panic.

Copy link
Contributor Author

@dailinsubjam dailinsubjam Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more tracing updated, for other tracing they're in the implementation code rather than the test code so I just left them there.

@dailinsubjam dailinsubjam merged commit 4ca68e4 into main Sep 19, 2024
5 checks passed
@dailinsubjam dailinsubjam deleted the sishan/unit_test branch September 19, 2024 00:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test Improvement] - Add unit test for process_da_proposal
3 participants