aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_addrman.py
AgeCommit message (Collapse)Author
2023-07-26Merge bitcoin/bitcoin#27529: test: fix `feature_addrman.py` on big-endian ↵fanquake
systems 53c990ad3406ee945305af84af98d2f020e5f316 test: fix `feature_addrman.py` on big-endian systems (Sebastian Falbesoner) Pull request description: The test `feature_addrman.py` currently serializes the addrdb without specifying endianness for `int`s, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generated `peers.dat` would be invalid on big-endian systems (our internal (de)serializers always use little-endian, see `ser_{read,write}data32`). Fix this by explicitly specifying little-endian serialization via the `<` character in `struct.pack(...)`. This is not detected by CI as we unfortunately don't run functional tests on big-endian systems there (I think we definitely should!). ACKs for top commit: MarcoFalke: lgtm ACK 53c990ad3406ee945305af84af98d2f020e5f316 🔚 Tree-SHA512: 513af6f1f785a713e7a8ef3a57fcd3fe2520a7d537f63a9c8e1f4bdea4c2f605fd4c35001623d6b13458883dbc256f24943684ab8f224055c22bf8d8eeee5fe2
2023-06-21scripted-diff: Use wallets_path and chain_path where possibleMarcoFalke
Instead of passing the datadir and chain name to os.path.join, just use the existing properties, which are the same. -BEGIN VERIFY SCRIPT- sed -i --regexp-extended 's|\.datadir, self\.chain, .wallets.|.wallets_path|g' $(git grep -l '\.datadir, self\.chain,') sed -i --regexp-extended 's|\.datadir, self\.chain,|.chain_path,|g' $(git grep -l '\.datadir, self\.chain,') -END VERIFY SCRIPT-
2023-04-25test: fix `feature_addrman.py` on big-endian systemsSebastian Falbesoner
The test `feature_addrman.py` currently serializes the addrdb without specifying endianness for `int`s, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generated `peers.dat` would be invalid on big-endian systems. Fix this by explicitly specifying little-endian serialization via the `<` character in `struct.pack(...)`.
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2022-06-29streams: Add AutoFile without ser-type and ser-versionMacroFake
The moved parts can be reviewed with "--color-moved=dimmed-zebra". The one-char changes can be reviewed with "--word-diff-regex=.".
2022-02-25addrman: Log too low compat valueMarcoFalke
Also remove uint8_t{} casts from values that are already of the same type.
2022-02-25p2p: Avoid InitError when downgrading peers.datjunderw
fixes #24188 When downgrading, a peers.dat with a future version that has a minimum required version larger than the downgraded version would cause an InitError. This commit changes this behavior to overwrite the existing peers.dat with a new empty one, while creating a backup in peers.dat.bak.
2021-10-25Introduce new V4 format addrmanPieter Wuille
92617b7a758c0425330fba4b886296730567927c effectively changed the on-disk format in an incompatible way: old deserializers cannot deal with multiple entries for the same IP. Introduce a V4_MULTIPORT format, and increment the compatibility base, so that old versions correctly recognize it as an incompatible future version.
2021-09-28scripted-diff: Rename CAddrMan to AddrManAmiti Uttarwar
-BEGIN VERIFY SCRIPT- git grep -l CAddrMan src/ test/ | xargs sed -i 's/CAddrMan/AddrMan/g' -END VERIFY SCRIPT-
2021-09-27test: Add missing re.escape() to feature_addrman testMarcoFalke
2021-09-21addrman: Replace assert with throw on corrupt dataMarcoFalke
Assert should only be used for program internal logic errors, not to sanitize external user input.
2021-09-20test: Add addrman deserialization error testsMarcoFalke
2021-09-09Raise InitError when peers.dat is invalid or corruptedMarcoFalke
2021-09-05addrman: Fix format string in deserialize errorMarcoFalke
Also add a regression test.