Page MenuHomePhabricator

[chronik] Determine lokad indexing by enable_lokad_id_index param
ClosedPublic

Authored by bytesofman on Jul 3 2024, 16:33.

Details

Summary

Typo bug where enabling the lokad index is determined by the enable_token_index param

Patch so the enable_lokad_id_index param behaves as expected

Test Plan
mkdir buildChronik
pushd buildChronik
cmake -GNinja .. -DBUILD_BITCOIN_CHRONIK=ON
ninja
ninja check-functional
cd test/functional
./test_runner.py chronik_lokad_id_group

Diff Detail

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

Event Timeline

bytesofman published this revision for review.Jul 4 2024, 14:32
bytesofman edited the test plan for this revision. (Show Details)
bytesofman added inline comments.
test/functional/chronik_lokad_id_group.py
271 ↗(On Diff #48509)

Before making the change to line 221 of indexer.rs, I got this test file to pass with these lines instead:

# Restarting with chroniklokadidindex=0 and chroniktokenindex=1 accidentally reindexes the LOKAD ID index
# but only for confirmed txs
self.restart_node(0, ["-chronik", "-reindex", "-chroniktokenindex=1", "-chroniklokadidindex=0"])
assert_equal(lokad_id_conf(b"lok0"), sorted([tx0.hash, tx1.hash, tx2.hash]))
assert_equal(lokad_id_conf(b"lok1"), [tx1.hash])
assert_equal(lokad_id_conf(b"lok2"), [tx2.hash])
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/chronik_lokad_id_group.py
272 ↗(On Diff #48509)

not only for confirmed txs, unconfirmed are also not indexed. Just simplify the comment:
# Restarting with chroniklokadidindex=0 and chroniktokenindex=1 DOES NOT reindex the LOKAD ID index

This revision is now accepted and ready to land.Jul 4 2024, 18:10