Page MenuHomePhabricator

[backport#15644] Simplify orphan processing in preparation for interruptibility
ClosedPublic

Authored by majcosta on May 21 2020, 23:38.

Details

Summary
Test Plan
ninja check
./test/functional/test_runner.py --extended

Event Timeline

majcosta created this revision.May 21 2020, 23:38
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 21 2020, 23:38
majcosta requested review of this revision.May 21 2020, 23:38
teamcity edited the summary of this revision. (Show Details)May 21 2020, 23:38

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.May 22 2020, 00:15
deadalnix added a subscriber: deadalnix.

There is clearly some txid confusion that needs to be cleared before this can proceed.

src/net_processing.cpp
2815 ↗(On Diff #20501)

Why do you need a conversion here? This is wrong, that means you got to convert some code to use txid first (or worse, this isn't not meant to be a txid and then you created a problem).

2832 ↗(On Diff #20501)

Is it the hash of the txid?

This revision now requires changes to proceed.May 22 2020, 00:15
nakihito requested changes to this revision.May 22 2020, 00:31
nakihito added a subscriber: nakihito.
nakihito added inline comments.
src/net_processing.cpp
2832 ↗(On Diff #20501)

This is a TxId not a TxHash, so it should still be named orphanId.

majcosta updated this revision to Diff 20536.May 22 2020, 19:08

rebased, made a couple implicit narrowing conversions in the construction of COutPoint explicit

nakihito accepted this revision.May 22 2020, 19:47
deadalnix requested changes to this revision.May 22 2020, 21:14
deadalnix added inline comments.
src/net_processing.cpp
2809 ↗(On Diff #20536)
uint32_t(i)

Also not sure about the {}. Why the change?

2862 ↗(On Diff #20536)

dito

This revision now requires changes to proceed.May 22 2020, 21:14
majcosta added inline comments.May 22 2020, 22:01
src/net_processing.cpp
2809 ↗(On Diff #20536)

this is what is actually happening under the hood: we're doing a narrowing conversion from size_t (unsigned long int on my machine) to uint32_t (unsigned int)

the list initializer forces us to be be explicit about that and will error out if you remove the static_cast

majcosta updated this revision to Diff 20551.May 22 2020, 22:22

rebase, addressed feedback

deadalnix accepted this revision.May 22 2020, 22:31
deadalnix added inline comments.
src/net_processing.cpp
2809

I would recommend using a regular constructor instead of the curly braces things.

2862

dito

This revision is now accepted and ready to land.May 22 2020, 22:31