Skip to content
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

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

Closed
shesek opened this issue Aug 6, 2024 · 5 comments
Closed

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

shesek opened this issue Aug 6, 2024 · 5 comments

Comments

@shesek
Copy link
Collaborator

shesek commented Aug 6, 2024

bitcoin/bitcoin#28052

@maflcko
Copy link

maflcko commented Aug 10, 2024

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 Blockstream/esplora@52c1ecd could work)

junderw pushed a commit to junderw/electrs that referenced this issue Sep 4, 2024
…block

Order History events in the same confirmation height.
@junderw
Copy link

junderw commented Sep 5, 2024

mempool/electrs#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
Copy link

junderw commented Sep 5, 2024

Blockstream:

fn blkfiles_reader(blk_files: Vec<PathBuf>) -> Fetcher<Vec<u8>> {
let chan = SyncChannel::new(1);
let sender = chan.sender();
Fetcher::from(
chan.into_receiver(),
spawn_thread("blkfiles_reader", move || {
for path in blk_files {
trace!("reading {:?}", path);
let blob = fs::read(&path)
.unwrap_or_else(|e| panic!("failed to read {:?}: {:?}", path, e));
sender
.send(blob)
.unwrap_or_else(|_| panic!("failed to send {:?} contents", path));
}
}),
)
}

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
Copy link

junderw commented Sep 5, 2024

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

@shesek
Copy link
Collaborator Author

shesek commented Nov 23, 2024

Resolved by #130.

@shesek shesek closed this as completed Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants