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

refactor(starknet_batcher): delete the proposal manager #2618

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dafnamatsry
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 24 lines in your changes missing coverage. Please review.

Project coverage is 6.31%. Comparing base (b3026d5) to head (cdaa5ee).

Files with missing lines Patch % Lines
crates/starknet_batcher/src/batcher.rs 68.42% 19 Missing and 5 partials ⚠️
Additional details and impacted files
@@                                                    Coverage Diff                                                     @@
##           12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file   #2618      +/-   ##
==========================================================================================================================
- Coverage                                                                                     6.45%   6.31%   -0.14%     
==========================================================================================================================
  Files                                                                                          146     145       -1     
  Lines                                                                                        17386   17335      -51     
  Branches                                                                                     17386   17335      -51     
==========================================================================================================================
- Hits                                                                                          1122    1095      -27     
+ Misses                                                                                       16188   16166      -22     
+ Partials                                                                                        76      74       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch 2 times, most recently from c0673ad to 1b75381 Compare December 10, 2024 10:44
@dafnamatsry dafnamatsry changed the base branch from 12-04-refactor_starknet_batcher_validate_flow_refactor to 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file December 10, 2024 10:44
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 1b75381 to 65f45b2 Compare December 10, 2024 11:40
@dafnamatsry dafnamatsry marked this pull request as ready for review December 10, 2024 11:41
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 65f45b2 to cfc0dcc Compare December 10, 2024 11:44
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch from 3bc9a7f to 09f7de9 Compare December 12, 2024 09:16
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from cfc0dcc to 8b33c06 Compare December 12, 2024 09:17
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch from 09f7de9 to 08ae4fc Compare December 12, 2024 10:20
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch 2 times, most recently from 9aaf571 to 1582e58 Compare December 12, 2024 10:29
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch from 08ae4fc to 8a1dcfd Compare December 12, 2024 10:49
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 1582e58 to b315f6c Compare December 12, 2024 10:49
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch from 8a1dcfd to b3026d5 Compare December 15, 2024 07:23
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from b315f6c to cdaa5ee Compare December 15, 2024 07:23
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch 2 times, most recently from 9e4709d to dfa16fa Compare December 15, 2024 12:12
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch 2 times, most recently from 89fb62f to 7b9ca0b Compare December 15, 2024 12:21
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch from dfa16fa to 5fda731 Compare December 16, 2024 07:17
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 7b9ca0b to 35adc06 Compare December 16, 2024 07:17
@dafnamatsry dafnamatsry force-pushed the 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file branch from 5fda731 to cbee779 Compare December 16, 2024 09:03
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 35adc06 to 8c61b02 Compare December 16, 2024 09:03
@dafnamatsry dafnamatsry changed the base branch from 12-10-refactor_starknet_batcher_move_around_some_types_and_utils_to_a_common_utils_file to graphite-base/2618 December 16, 2024 10:55
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 8c61b02 to 72ce408 Compare December 16, 2024 10:56
@dafnamatsry dafnamatsry changed the base branch from graphite-base/2618 to main December 16, 2024 10:56
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 72ce408 to e1fdcc8 Compare December 16, 2024 10:56
Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r2, 1 of 3 files at r3, 4 of 4 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @dafnamatsry and @Yael-Starkware)


crates/starknet_batcher/src/proposal_manager.rs line 0 at r4 (raw file):
Delete files.


crates/starknet_batcher/src/batcher.rs line 289 at r4 (raw file):

            // TODO(dafna): at this point the proposal result must be an error, since it finsisehd
            // earlier than expected. Consider panicking instead of returning an error.
            Ok(_) => Err(BatcherError::ProposalAlreadyFinished { proposal_id }),

Okay, let's panic.

Code quote:

            // TODO(dafna): at this point the proposal result must be an error, since it finsisehd
            // earlier than expected. Consider panicking instead of returning an error.
            Ok(_) => Err(BatcherError::ProposalAlreadyFinished { proposal_id }),

crates/starknet_batcher/src/batcher.rs line 300 at r4 (raw file):

        debug!("Send proposal content done for {}", proposal_id);

        self.validate_tx_streams.remove(&proposal_id);

expect.

Code quote:

self.validate_tx_streams.remove(&proposal_id);

crates/starknet_batcher/src/batcher.rs line 304 at r4 (raw file):

            if let Some(proposal_task) = self.active_proposal_task.take() {
                proposal_task.join_handle.await.ok();
            }

Use await_active_proposal().

Code quote:

            if let Some(proposal_task) = self.active_proposal_task.take() {
                proposal_task.join_handle.await.ok();
            }

crates/starknet_batcher/src/batcher.rs line 422 at r4 (raw file):

        let mut active_proposal = self.active_proposal.lock().await;
        if let Some(active_proposal_id) = *active_proposal {
            return Err(BatcherError::ServerBusy {

This error name isn't very informative, should we change it? (In a different PR)

Code quote:

ServerBusy

@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from e1fdcc8 to 73d8a51 Compare December 16, 2024 13:01
Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @dafnamatsry and @Yael-Starkware)

@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from 73d8a51 to f8ffd4c Compare December 17, 2024 07:30
Copy link
Collaborator Author

@dafnamatsry dafnamatsry left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 6 files reviewed, 5 unresolved discussions (waiting on @alonh5 and @Yael-Starkware)


crates/starknet_batcher/src/batcher.rs line 289 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Okay, let's panic.

Done.
Note that I deleted a test that simulated this scenario (something that cannot happen for real).


crates/starknet_batcher/src/batcher.rs line 300 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

expect.

Done.


crates/starknet_batcher/src/batcher.rs line 304 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Use await_active_proposal().

Done.


crates/starknet_batcher/src/batcher.rs line 422 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

This error name isn't very informative, should we change it? (In a different PR)

Yes, something like ProposalInProgress would be better. WDYT?


crates/starknet_batcher/src/proposal_manager.rs line at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Delete files.

Done.

Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dafnamatsry and @Yael-Starkware)


crates/starknet_batcher/src/batcher.rs line 289 at r4 (raw file):

Previously, dafnamatsry wrote…

Done.
Note that I deleted a test that simulated this scenario (something that cannot happen for real).

I'm confused, how could it be simulated if it cannot happen?


crates/starknet_batcher/src/batcher.rs line 422 at r4 (raw file):

Previously, dafnamatsry wrote…

Yes, something like ProposalInProgress would be better. WDYT?

Sounds good. New PR?

Copy link
Collaborator Author

@dafnamatsry dafnamatsry left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @Yael-Starkware)


crates/starknet_batcher/src/batcher.rs line 289 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

I'm confused, how could it be simulated if it cannot happen?

With a mock block builder. The test mocks a block builder that finish successfully. I the validate flow it can't finish successfully unless we get an explicit Finish request from the consensus.


crates/starknet_batcher/src/batcher.rs line 422 at r4 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Sounds good. New PR?

Yap, I'll open one.

Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)

@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_delete_the_proposal_manager branch from f8ffd4c to acc4aba Compare December 18, 2024 08:15
Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants