Page MenuHomePhabricator

[Chronik] Add `compress_script` and `decompress_script` to `chronik-bridge` FFI
ClosedPublic

Authored by tobias_ruck on Apr 2 2023, 23:43.

Details

Summary

Used to reduce the size of scripts in the DB. We re-use the existing compression from the node.

Test Plan

ninja test_bitcoin && ./src/test/test_bitcoin -t bridgecompression_tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.Apr 3 2023, 10:27
Fabien added inline comments.
chronik/test/bridgecompression_tests.cpp
10 ↗(On Diff #39136)
18 ↗(On Diff #39136)

I appreciate the effort but I think it's not a good idea to check against the compressed hex. This is implementation dependent and makes the test obsolete if the compressor algorithm changes, or chronik picks another compression method.

What you want from a compressor is the make sure compressed.size() <= original.size() and the data is recovered after a roundtrip.

This revision now requires changes to proceed.Apr 3 2023, 10:27

Remove compressed hex in tests

This revision is now accepted and ready to land.Apr 3 2023, 15:54