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): rename GetProposalResultError and remove the ProposalNotFound variant #2483

Conversation

dafnamatsry
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 10 lines in your changes missing coverage. Please review.

Project coverage is 57.15%. Comparing base (e3165c4) to head (372a1c5).
Report is 759 commits behind head on main.

Files with missing lines Patch % Lines
crates/starknet_batcher/src/proposal_manager.rs 33.33% 5 Missing and 1 partial ⚠️
crates/starknet_batcher/src/batcher.rs 33.33% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2483       +/-   ##
===========================================
+ Coverage   40.10%   57.15%   +17.05%     
===========================================
  Files          26      156      +130     
  Lines        1895    18309    +16414     
  Branches     1895    18309    +16414     
===========================================
+ Hits          760    10465     +9705     
- Misses       1100     7378     +6278     
- Partials       35      466      +431     

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

Copy link
Contributor

@Yael-Starkware Yael-Starkware 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 r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5 and @dafnamatsry)


crates/starknet_batcher/src/batcher.rs line 288 at r1 (raw file):

                _ => return Err(BatcherError::InternalError),
            },
            Some(Err(ProposalError::Aborted)) => return Err(BatcherError::ProposalAborted),

I think that if the proposal was aborted, the function close_input_transaction_stream would return an error.
so this match arm would never be reached.

Code quote:

Some(Err(ProposalError::Aborted)) => return Err(BatcherError::ProposalAborted),

crates/starknet_batcher/src/batcher_test.rs line 560 at r1 (raw file):

        .times(1)
        .with(eq(PROPOSAL_ID))
        .return_once(|_| async move { None }.boxed());

I think that move is not required here,
probably in other places too.
non blocking for this PR, but we should fix separately.

Code quote:

move

@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_add_getters_to_the_proposal_manger branch from f37c942 to b241765 Compare December 8, 2024 09:17
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, 2 unresolved discussions (waiting on @alonh5 and @Yael-Starkware)


crates/starknet_batcher/src/batcher.rs line 288 at r1 (raw file):

Previously, Yael-Starkware (YaelD) wrote…

I think that if the proposal was aborted, the function close_input_transaction_stream would return an error.
so this match arm would never be reached.

We still need to cover it, and I think returning an error is better than panic in this case.
Also, in the following PR, I added a check at the beginning of send_proposal_content, so if the proposal does not exist/aborted/etc. it wouldn't reach this function at all.


crates/starknet_batcher/src/batcher_test.rs line 560 at r1 (raw file):

Previously, Yael-Starkware (YaelD) wrote…

I think that move is not required here,
probably in other places too.
non blocking for this PR, but we should fix separately.

Right.
The tests are going to be changed a lot when the mock proposal manager will be deleted (and specifically this and almost all other expectations will be removed) . I'll keep this in mind.

Copy link
Contributor

@Yael-Starkware Yael-Starkware 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)

@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_rename_getproposalresulterror_and_remove_the_proposalnotfound_variant branch from a4283c3 to 8b611aa Compare December 8, 2024 10:05
Copy link
Contributor

@Yael-Starkware Yael-Starkware 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 r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)

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:

Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)

Copy link
Collaborator Author

dafnamatsry commented Dec 9, 2024

Merge activity

  • Dec 9, 6:47 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 9, 6:49 AM EST: Graphite rebased this pull request as part of a merge.
  • Dec 9, 7:01 AM EST: A user merged this pull request with Graphite.

@dafnamatsry dafnamatsry changed the base branch from 12-05-refactor_starknet_batcher_add_getters_to_the_proposal_manger to graphite-base/2483 December 9, 2024 11:47
@dafnamatsry dafnamatsry changed the base branch from graphite-base/2483 to main December 9, 2024 11:47
@dafnamatsry dafnamatsry force-pushed the 12-05-refactor_starknet_batcher_rename_getproposalresulterror_and_remove_the_proposalnotfound_variant branch from 8b611aa to 372a1c5 Compare December 9, 2024 11:48
@dafnamatsry dafnamatsry merged commit f783ac5 into main Dec 9, 2024
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
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.

4 participants