-
Notifications
You must be signed in to change notification settings - Fork 676
Validate sizes and types #9546
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
Merged
Merged
Validate sizes and types #9546
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
36a0f7e
PoC of delayed sending if requested
flcl42 d8294a2
Add retry cache
flcl42 bcc06a3
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 1d29ad5
Fix logs and multiple requests expiration
flcl42 2adbcbe
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 fb8e9e3
Add tests
flcl42 a474531
Rename
flcl42 b831531
Add more tests
flcl42 5cfaf85
Improve
flcl42 0825d2d
Simplify dependencies
flcl42 9414c22
Improve
flcl42 62b1ca8
Rename
flcl42 a49c3b7
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 d883a0a
no requestoor draft
flcl42 d5e60b2
Use messages
flcl42 34ec276
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 aab4e49
Remove the requestoor
flcl42 805f8df
Fix tests
flcl42 f2db9a6
Fix tests
flcl42 f615bd5
More fixes
flcl42 ca79d70
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 78e4de6
Substitute
flcl42 d41d386
Disconnect peers with invalid txs
flcl42 a197f6c
Update src/Nethermind/Nethermind.Network.Contract/Messages/IResourceR…
flcl42 1c8f173
Merge branch 'dont-cache-requested-txhashes' of github.com:Nethermind…
flcl42 eb2213e
Merge remote-tracking branch 'origin/master' into dont-cache-requeste…
flcl42 dc8f823
Compress code
flcl42 3605567
Try pooled set
flcl42 f06ff7d
Handle as eth66
flcl42 0d8fdd3
Fix review
flcl42 83eee29
Fix tests
flcl42 ff5da9a
No need in syncing handling
flcl42 152a0a4
Validate sizes and types
flcl42 53d16f0
Add a test
flcl42 f0011fa
Merge remote-tracking branch 'origin/master' into validate-sizes-and-…
flcl42 8242e69
Fix test
flcl42 011af56
Add tests
flcl42 4698baf
Merge branch 'master' into validate-sizes-and-types
flcl42 35b1382
Fix test
flcl42 f70d145
Code style
flcl42 7e4535b
Rollback
flcl42 45349cf
Fix tests
flcl42 44ef48b
Move to proper class
flcl42 7910ec6
Rollback that rollback
flcl42 b582c66
Merge branch 'master' into validate-sizes-and-types
flcl42 73ef0c9
Merge branch 'validate-sizes-and-types' of github.com:NethermindEth/n…
flcl42 3ffb44c
Mark not invalid txs as received
flcl42 b8c9b52
Move
flcl42 f6b8876
Fix dispose
flcl42 9229a78
Fix
flcl42 e34e86f
Moar
flcl42 bd5b964
Clean up cache
flcl42 2a6af80
Using
flcl42 6fb8387
Merge branch 'master' into validate-sizes-and-types
flcl42 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
| using Nethermind.Serialization.Rlp; | ||
| using Nethermind.Stats; | ||
| using Nethermind.Stats.Model; | ||
| using Nethermind.Synchronization; | ||
|
|
||
| namespace Nethermind.Network.P2P.ProtocolHandlers | ||
| { | ||
|
|
@@ -90,6 +89,8 @@ protected T Deserialize<T>(IByteBuffer data) where T : P2PMessage | |
| int originalReaderIndex = data.ReaderIndex; | ||
| T result = _serializer.Deserialize<T>(data); | ||
| if (data.IsReadable()) ThrowIncompleteDeserializationException(data, originalReaderIndex); | ||
| Logger.Warn($"{Counter} Got {typeof(T).Name}"); | ||
|
|
||
| return result; | ||
| } | ||
| catch (RlpLimitException e) | ||
|
|
@@ -113,7 +114,7 @@ private static void ThrowIncompleteDeserializationException(IByteBuffer data, in | |
| protected internal void Send<T>(T message) where T : P2PMessage | ||
| { | ||
| Interlocked.Increment(ref Counter); | ||
| if (Logger.IsTrace) Logger.Trace($"{Counter} Sending {typeof(T).Name}"); | ||
| Logger.Warn($"{Counter} Sending {typeof(T).Name}"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warn? Seems like overlooked revert |
||
| if (NetworkDiagTracer.IsEnabled) | ||
| { | ||
| string messageString = message.ToString(); | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
And here the same