Blockstream / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
318 stars 130 forks source link

Use bincode's new API, add utility functions for safer use #70

Closed shesek closed 8 months ago

shesek commented 8 months ago

This resolves the deprecation warnings for the old bincode::config(), and adds wrapper utility functions that explicitly spells out whether serialization should use little or big endianness.

Switching from bincode::config() to bincode::options() changed the default settings, which requires explicitly enabling with_fixint_encoding and allow_trailing_bytes to restore the old behaviour.

Thanks @junderw for the investigative work and writing the code this is based on (https://github.com/mempool/electrs/pull/34).

shesek commented 8 months ago

I verified DB compatibility by creating a database with 3a105828cd6684be84e36fb1eb8f08f62428618a (the current new-index tip) and loading it with this PR, for both Bitcoin and Liquid modes.

LeoComandini commented 8 months ago

utACK 0739d50357d418a9f9194df5bce911da0e845dc8, code review