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

statesync/event: emit statesync start/end event #6700

Merged
merged 27 commits into from Jul 22, 2021

Conversation

JayT106
Copy link
Contributor

@JayT106 JayT106 commented Jul 12, 2021

@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #6700 (29bf5a8) into master (478f532) will increase coverage by 0.17%.
The diff coverage is 17.44%.

@@            Coverage Diff             @@
##           master    #6700      +/-   ##
==========================================
+ Coverage   62.31%   62.48%   +0.17%     
==========================================
  Files         297      298       +1     
  Lines       39907    39962      +55     
==========================================
+ Hits        24867    24972     +105     
+ Misses      13280    13223      -57     
- Partials     1760     1767       +7     
Impacted Files Coverage Δ
internal/consensus/reactor.go 71.84% <0.00%> (+2.30%) ⬆️
internal/statesync/mock_sync_reactor.go 0.00% <0.00%> (ø)
internal/statesync/reactor.go 59.23% <0.00%> (-1.05%) ⬇️
node/node.go 52.54% <25.53%> (+0.99%) ⬆️
types/event_bus.go 64.63% <50.00%> (-0.37%) ⬇️
types/events.go 100.00% <100.00%> (ø)
internal/statesync/block_queue.go 93.05% <0.00%> (-2.09%) ⬇️
internal/statesync/dispatcher.go 85.92% <0.00%> (-2.02%) ⬇️
internal/p2p/peer.go 54.18% <0.00%> (-1.68%) ⬇️
internal/p2p/transport_mconn.go 80.88% <0.00%> (-0.74%) ⬇️
... and 18 more

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Left some preliminary comments. Great work @JayT106.

docs/tendermint-core/state-sync.md Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
node/node.go Outdated
if err != nil {
ssR.Logger.Error("state sync failed", "err", err)
ssR.GetLogger().Error("state sync failed", "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

codesmell. Don't log here. The reactor should log on error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but it is a different goroutine, the caller might not be able to receive the return error.

@JayT106
Copy link
Contributor Author

JayT106 commented Jul 13, 2021

@alexanderbez thanks for the feedback, I will change/remove the logs.

internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
@JayT106 JayT106 force-pushed the statesync-event branch 2 times, most recently from 48b78c8 to d3f61ad Compare July 13, 2021 17:55
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Great changes so far @JayT106. Almost there!

docs/tendermint-core/state-sync.md Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/consensus/reactor.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cmwaters cmwaters 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 few syntax changes but otherwise good

docs/tendermint-core/state-sync.md Outdated Show resolved Hide resolved
docs/tendermint-core/state-sync.md Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
internal/statesync/reactor.go Outdated Show resolved Hide resolved
node/node_test.go Outdated Show resolved Hide resolved
node/node_test.go Outdated Show resolved Hide resolved
node/node_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks!

@JayT106 JayT106 force-pushed the statesync-event branch 2 times, most recently from 0655ea0 to 019e081 Compare July 19, 2021 13:57
@cmwaters
Copy link
Contributor

@JayT106 - when you get a moment do you mind resolving the conflicts here. Then we can get this merged

@JayT106 JayT106 force-pushed the statesync-event branch 2 times, most recently from d728550 to 3370cd0 Compare July 20, 2021 18:13
types/event_bus.go Outdated Show resolved Hide resolved
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.

None yet

4 participants