Blockstream / electrs

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

Adapt parser for Bitcoin Core's block storage XOR #93

Open shesek opened 3 months ago

shesek commented 3 months ago

https://github.com/bitcoin/bitcoin/pull/28052

maflcko commented 3 months ago

Just for clarity: The XOR pattern is only applied when the blocksdir is freshly created, and there is also an option to disable it (on creation).

So an alternative to adapt the parser would be to require the option to be disabled, for now. (Possibly for esplora a config update similar to commit https://github.com/Blockstream/esplora/commit/52c1ecdb7e853a30d4486c3d9174f47b4b7ab5dd could work)

junderw commented 2 months ago

https://github.com/mempool/electrs/pull/101

I added support that basically doesn't look at any config, but rather uses the presence of the xor.dat file to decide whether to use it.

junderw commented 2 months ago

Blockstream:

https://github.com/Blockstream/electrs/blob/306f66acf2ab10bcd99b8012e95a0de30b2cc012/src/new_index/fetch.rs#L153-L170

mempool:

https://github.com/mempool/electrs/blob/10274b50ec4b8828c1d33aea0b3f87c86fb9f90e/src/new_index/fetch.rs#L149-L185

Looks like that portion is untouched so you could just merge that in if you want.

junderw commented 2 months ago

We plan to release it as a patch v3.0.1 once Core releases v28