-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(dot/peerset): remove race conditions from peerset
package
#2267
Merged
Merged
Changes from 40 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
6a7d933
chore: adding read/write mutexes to peerstate
EclesioMeloJunior b0eb77f
chore: remove channels and use the executor as parameter
EclesioMeloJunior 98cb4bc
chore: remove unneeded stop and ctx
EclesioMeloJunior a6e97fd
chore: remove unused cancel ctx
EclesioMeloJunior d8f6700
chore: keep the same log informations
EclesioMeloJunior a93fafe
chore: resolve lint
EclesioMeloJunior 858a72b
Merge branch 'development' into eclesio/refactor-peerstate
EclesioMeloJunior 55dca9c
chore: define struct inside function
EclesioMeloJunior f0c0e10
chore: use sync.Mutex composition
EclesioMeloJunior 1f39a56
chore: adding license
EclesioMeloJunior 5366804
chore: keep `Reputation` at `peerset`
EclesioMeloJunior 3695853
chore: replace fun signature to interface implementation
EclesioMeloJunior 36ab22e
chore: move comment
EclesioMeloJunior fc0cf71
chore: improve test description
EclesioMeloJunior 147575c
chore: improve test exepect function calls
EclesioMeloJunior 8e693b5
chore: add comment to network.Process exported function
EclesioMeloJunior a340adc
chore: fix TestPeerSetDiscovered unit test
EclesioMeloJunior a1d5391
Merge branch 'development' into eclesio/refactor-peerstate
EclesioMeloJunior 39e1974
chore: fix typo at comment
EclesioMeloJunior 3773559
chore: wrap errors and add String to ReputationChange
EclesioMeloJunior 71c5ea4
Merge branch 'eclesio/refactor-peerstate' of github.com:ChainSafe/gos…
EclesioMeloJunior 78a5468
chore: remove unneeded comment
EclesioMeloJunior 50ef6cb
chore: implement MessageProcessor interface at network/host
EclesioMeloJunior 4f285ee
chore: rename `doWork` to `periodicallyAllocateSlots`
EclesioMeloJunior 237cfe9
chore: set processor at testing
EclesioMeloJunior d02fafc
chore: address comments
EclesioMeloJunior a4adf71
chore: address comments
EclesioMeloJunior 1b49a64
chore: wrap `ErrPeerDoesNotExist`
EclesioMeloJunior 9d4c81a
chore: addressing comments
EclesioMeloJunior af4380e
chore: fix PeerStateHandler interface
EclesioMeloJunior c184ccf
chore: improve `Test_Ban_Reject_Accept_Peer` assertions
EclesioMeloJunior 5fe401c
chore: improve the peerset test assertions
EclesioMeloJunior ca7f676
Update dot/network/state.go
EclesioMeloJunior 60791f1
chore: fix lll lint issue
EclesioMeloJunior 4856eb2
Update dot/peerset/handler.go
EclesioMeloJunior ad060fe
chore: implementing the reject case in the incoming peer connections
EclesioMeloJunior 2c870d2
chore: fix race conditions in test assertion
EclesioMeloJunior 249eecf
Merge branch 'eclesio/refactor-peerstate' of github.com:ChainSafe/gos…
EclesioMeloJunior 9dcb348
chore: exec `go fmt ./...`
EclesioMeloJunior c726949
chore: add `//nolint:unparam`
EclesioMeloJunior 9946ead
Merge branch 'development' into eclesio/refactor-peerstate
EclesioMeloJunior aab7e3a
Merge branch 'development' into eclesio/refactor-peerstate
EclesioMeloJunior 7d2f7c7
chore: use channels with protected maps
EclesioMeloJunior 266d7a2
chore: remove nolintlint warns
EclesioMeloJunior 8a52a8a
Merge branch 'development' into eclesio/refactor-peerstate
EclesioMeloJunior 0dbad30
chore: fixing the newtork service Stop method
EclesioMeloJunior 2207aad
chore: reintroduce the `msgChanSize` comment
EclesioMeloJunior 04221fa
chore: close the `resultMsgCh` once ctx ends
EclesioMeloJunior 0dffe8a
chore: use variables on eclesio/refactor-peerstate
EclesioMeloJunior 77784e2
chore: adding comments
EclesioMeloJunior d563386
chore: logging ctx error as debug
EclesioMeloJunior df15a5d
chore: fixing the tests helpers
EclesioMeloJunior a3b6ea8
Merge branch 'development' into eclesio/refactor-peerstate
EclesioMeloJunior 3480177
chore: address comment, asserting log format types
EclesioMeloJunior 233d2eb
chore: removing diffs
EclesioMeloJunior 9315906
chore: removing diffs, fix logger format
EclesioMeloJunior cb763ab
chore: remove unneeded time.Sleep
EclesioMeloJunior 53987c1
chore: address error wraping
EclesioMeloJunior File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does closePeer () handle the case where a peer isn't connected (imagining thats the Reject case)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now Reject case is processed but not the right way I think. The
network.handleConn(conn libp2pnetwork.Conn)
which started the incoming calls thepeersetHandler.Incoming
method which should check if the peer should be accepted or rejected but this answer is sent to the processor instead of returned to thenetwork.handleConn
to stop the handshake with the peer.I think we should change the following method:
to
@noot, @timwu20 what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EclesioMeloJunior that makes sense, also in the Reject case you would need to call
conn.Close()
to close the connection with the peer