Page MenuHomePhabricator

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

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

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

majcosta created this revision.Thu, May 21, 23:38
Herald added a reviewer: Restricted Project. · View Herald TranscriptThu, May 21, 23:38
majcosta requested review of this revision.Thu, May 21, 23:38
teamcity edited the summary of this revision. (Show Details)Thu, May 21, 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.Fri, May 22, 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.Fri, May 22, 00:15
nakihito requested changes to this revision.Fri, May 22, 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.Fri, May 22, 19:08

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

nakihito accepted this revision.Fri, May 22, 19:47
deadalnix requested changes to this revision.Fri, May 22, 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.Fri, May 22, 21:14
majcosta added inline comments.Fri, May 22, 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.Fri, May 22, 22:22

rebase, addressed feedback

deadalnix accepted this revision.Fri, May 22, 22:31
deadalnix added inline comments.
src/net_processing.cpp
2809 ↗(On Diff #20551)

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

2862 ↗(On Diff #20551)

dito

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