WIP: Refactor claim index [currently being investigated, dont merge] #195
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#195
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor_claim_index"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
getClaimById
should not be called twice.thanks, squashed and force pushed
Squash all commits.
Update for style to avoid travis error.
We also need to test this to be sure it works as expected. There could be db corruption elsewhere unrelated to this, so let me know your findings.
Duplicate of line 409 (remove either this or your addition)
@ -833,3 +833,3 @@
const std::string name = "test";
CMutableTransaction tx1 = fixture.MakeClaim(fixture.GetCoinbase(), name, "one", 1);
CMutableTransaction tx1 = fixture.MakeClaim(fixture.GetCoinbase(), name, "one", 2);
uint160 claimId = ClaimIdHash(tx1.GetHash(), 0);
Why is this changing?
@ -840,6 +840,7 @@ BOOST_AUTO_TEST_CASE(get_claim_by_id_test)
pclaimTrie->getClaimById(claimId, claimName, claimValue);
BOOST_CHECK(claimName == name);
BOOST_CHECK(claimValue.claimId == claimId);
BOOST_CHECK(claimValue.nAmount == 2);
Why is this changing?
@ -833,3 +833,3 @@
const std::string name = "test";
CMutableTransaction tx1 = fixture.MakeClaim(fixture.GetCoinbase(), name, "one", 1);
CMutableTransaction tx1 = fixture.MakeClaim(fixture.GetCoinbase(), name, "one", 2);
uint160 claimId = ClaimIdHash(tx1.GetHash(), 0);
So the update can test the value stored at the index also gets updated from 2 to 1.
@ -840,6 +840,7 @@ BOOST_AUTO_TEST_CASE(get_claim_by_id_test)
pclaimTrie->getClaimById(claimId, claimName, claimValue);
BOOST_CHECK(claimName == name);
BOOST_CHECK(claimValue.claimId == claimId);
BOOST_CHECK(claimValue.nAmount == 2);
typo, fixing. I meant to do this only to tx1
squashed, fixed style, duplicated json field and typo on tests.
Added a command to debug the issue:
Please don't merge that commit. We can remove it once we have a definitive fix or the reason for that to be happening.
@shyba Thanks for bringing this issue up. I looked into it a little bit and have a theory on what's going wrong, but will need some more time analyzing before testing a fix. It's unrelated to this though, so no need to merge here. If there's an existing issue related to this, please link it here.
That one is actually a cosmetic byproduct from when I was investigating. It's some unit tests and a refactor. The only issue being solved in this PR is when the
value
field fails it won't return a result instead of returning an empty value. However that's also caused by the index issues.If the refactor and the unit tests proves to be useful you can merge them, but otherwise we can close this PR. It's mostly investigation byproducts.
See #197. If/when that's merged, please issue a PR to re-add the unit testing.
Pull request closed