-
Notifications
You must be signed in to change notification settings - Fork 725
Addrdb code deduplication + Native support for FLATDATA + Add file syncing logging and error handling #2304
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
Addrdb code deduplication + Native support for FLATDATA + Add file syncing logging and error handling #2304
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Just a compatibility concern with the last commit.
86a1517 to
d593e7e
Compare
|
Updated per feedback |
random-zebra
left a comment
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.
ACK d593e7e
Fuzzbawls
left a comment
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.
ACK d593e7e
with a minor nit
| READWRITE(FLATDATA(portN)); | ||
| if (ser_action.ForRead()) | ||
| port = ntohs(portN); | ||
| } |
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.
nit: extra un-necessary indenting managed to get in here.
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.
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.
…/.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
Digging down the peers and ban databases commits path in upstream found some good stuff, back ported the following PRs: