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

[ETCM-739] Refactor BlockFetcher #976

Merged
merged 1 commit into from
May 10, 2021
Merged

Conversation

AnastasiiaL
Copy link
Contributor

Change BlockFetcher to typed actor

Split fetcher message handling among child actors

Abstract the fetch trait

Scalafmt

Refactor blockFetcherState

@AnastasiiaL AnastasiiaL force-pushed the refactor-fetcher-step-by-step branch from 9876ed2 to 70a77ee Compare April 29, 2021 22:26
@leo-bogastry
Copy link
Contributor

What about tests for the new added classes?

@AnastasiiaL
Copy link
Contributor Author

What about tests for the new added classes?

there is no new functionality added, it was just split for readability. Existing BlockFetcher tests still cover those

@AnastasiiaL AnastasiiaL force-pushed the refactor-fetcher-step-by-step branch from 70a77ee to 791117e Compare May 3, 2021 09:25
@leo-bogastry
Copy link
Contributor

What about tests for the new added classes?

there is no new functionality added, it was just split for readability. Existing BlockFetcher tests still cover those

I think my issue is that when I see a class being split I also expect tests to be split. The BlockFetcherSpec has only 7 scenarios, involving fetching all headers, bodies and state.
I think individual tests (and more refined tests) on each of these (headers, bodies and states) are a good idea

@AnastasiiaL
Copy link
Contributor Author

What about tests for the new added classes?

there is no new functionality added, it was just split for readability. Existing BlockFetcher tests still cover those

I think my issue is that when I see a class being split I also expect tests to be split. The BlockFetcherSpec has only 7 scenarios, involving fetching all headers, bodies and state.
I think individual tests (and more refined tests) on each of these (headers, bodies and states) are a good idea

let's ask @dzajkowski if we want to invest more time in this. AFAIK that wasn't our intention

@AnastasiiaL AnastasiiaL force-pushed the refactor-fetcher-step-by-step branch from 791117e to 0db4b72 Compare May 7, 2021 10:25
@dzajkowski
Copy link
Contributor

What about tests for the new added classes?

there is no new functionality added, it was just split for readability. Existing BlockFetcher tests still cover those

I think my issue is that when I see a class being split I also expect tests to be split. The BlockFetcherSpec has only 7 scenarios, involving fetching all headers, bodies and state.
I think individual tests (and more refined tests) on each of these (headers, bodies and states) are a good idea

let's ask @dzajkowski if we want to invest more time in this. AFAIK that wasn't our intention

summoning circle failed, please try again in 12hrs

summoning circle succeeded

I agree with @LeonorLunatech that tidying up the tests and having a more focused set of specs makes sense but I also am aware that this refactor did not bring new functionalities to the table - so we would be making sure that akka typed works better. I'm fine with having such an improvement as a follow up ticket. please put it in 'tech debt' and mark as 'good first issue', @AnastasiiaL.

@LeonorLunatech is that an acceptable compromise?

@AnastasiiaL
Copy link
Contributor Author

follow-up on improving the tests https://jira.iohk.io/browse/ETCM-830

@AnastasiiaL AnastasiiaL force-pushed the refactor-fetcher-step-by-step branch from 0db4b72 to 5cba7bf Compare May 7, 2021 14:14
Change BlockFetcher to typed actor

Split fetcher message handling among child actors

Abstract the fetch trait

Scalafmt

Refactor blockFetcherState

Fix it tests

Fix scalastyle, comments

Fix comments

Add logging
@AnastasiiaL AnastasiiaL force-pushed the refactor-fetcher-step-by-step branch from 5cba7bf to 61503fa Compare May 10, 2021 12:21
"block-fetcher"
)

context.watch(fetcher)
Copy link
Contributor

Choose a reason for hiding this comment

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

quite o few watch statements

maybe it would make sense to add:

      .receiveSignal {
        case (context, Terminated(ref)) =>

@AnastasiiaL AnastasiiaL merged commit 51536c4 into develop May 10, 2021
@AnastasiiaL AnastasiiaL deleted the refactor-fetcher-step-by-step branch May 10, 2021 13:18
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