Page MenuHomePhabricator

[backport#16400] refactor: Rewrite AcceptToMemoryPoolWorker() using smaller parts
ClosedPublic

Authored by majcosta on Oct 30 2020, 22:48.

Details

Summary

4a87c5cfdf7dd72d999ebeaf17db6695a7c6298d [refactor] Rewrite AcceptToMemoryPoolWorker() using smaller parts (Suhas Daftuar)

Pull request description:

This is in preparation for re-using these validation components for a new version of AcceptToMemoryPool() that can operate on multiple transactions ("package relay").

Because of how our code handles SigChecks I could not remove the code commented under "Validate input
scripts against standard script flags" from the new PreChecks function into the PR's new PolicyScriptChecks
because since D5128 anything related to that number can only be run after CheckInputs.

The other code in the above new function was related to SegWit therefore I just removed the
PolicyScriptChecks function altogether.

Other missing members of the Workspace and ATMPArgs that were unused due to us not having RBF
were also taken out.

Backport of Core PR16400

Test Plan
ninja all check check-functional

Diff Detail

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

Event Timeline

deadalnix requested changes to this revision.Oct 31 2020, 15:35
deadalnix added inline comments.
src/validation.cpp
444 ↗(On Diff #25295)

I don't see what is gained except confusion here, creating many aliases to the same thing. Also, hello temporal dependency. This code is going to be broken at some point, this is 100% guaranteed, it is too fragile.

445 ↗(On Diff #25295)

These variable definition at 25km from where they are being use makes the code very unreadable.

448 ↗(On Diff #25295)

Considering this is the only use of m_config, this departure from the source material seems completely unnecessary.

647 ↗(On Diff #25295)

That seems superfluous.

713 ↗(On Diff #25295)

reflow

This revision now requires changes to proceed.Oct 31 2020, 15:35
majcosta marked an inline comment as done.

addressed feedback and prefetched the next block's verify flags in order to make it a const member of Workspace

This revision is now accepted and ready to land.Dec 8 2020, 01:31