Blockstream / electrs

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

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

Closed shesek closed 9 months ago

shesek commented 9 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 9 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 9 months ago

utACK 0739d50357d418a9f9194df5bce911da0e845dc8, code review