Addrdb code deduplication + Native support for FLATDATA + Add file syncing logging and error handling#2304
Merged
random-zebra merged 7 commits intoPIVX-Project:masterfrom Apr 20, 2021
Conversation
Support is added to serialize arrays of type char or unsigned char directly, without any wrappers. All invocations of the FLATDATA wrappers that are obsoleted by this are removed. This includes a patch by Russell Yanofsky to make char casting type safe. The serialization of CSubNet is changed to serialize a bool directly rather than though FLATDATA. This makes the serialization independent of the size of the bool type (and will use 1 byte everywhere).
Add logging and error handling inside, and outside of FileCommit. Functions such as fsync, fdatasync will return error in case of hardware I/O errors, and ignoring this means it can silently continue through data corruption. (c.f. https://lwn.net/SubscriberLink/752063/12b232ab5039efbe/)
…determinism in unit tests.
random-zebra
left a comment
There was a problem hiding this comment.
Looking good. Just a compatibility concern with the last commit.
86a1517 to
d593e7e
Compare
Author
|
Updated per feedback |
Fuzzbawls
approved these changes
Apr 20, 2021
| READWRITE(FLATDATA(portN)); | ||
| if (ser_action.ForRead()) | ||
| port = ntohs(portN); | ||
| } |
Collaborator
There was a problem hiding this comment.
nit: extra un-necessary indenting managed to get in here.
There was a problem hiding this comment.
we should also restore our styling convention of branching on newlines for functions implementations here.
Merging this for now. We can fix the styling in a separate trivial PR.
random-zebra
added a commit
that referenced
this pull request
Apr 20, 2021
…/.cpp 1431af9 [Trivial] fix code styling in netaddress.h/.cpp (random-zebra) Pull request description: Trivial. Ref: #2304 (comment) ACKs for top commit: furszy: utACK 1431af9 Tree-SHA512: 981d3b145ab26e28d3b5549c60854e401016cd6247a712f29859c2d9f26fbe786918cc5b306c18ed3b913a7e2de03946f624b0734db982a6e6ca42c9fb4c2449
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Digging down the peers and ban databases commits path in upstream found some good stuff, back ported the following PRs: