jtimon
commented at 10:33 pm on October 30, 2014:
contributor
EDIT:
This prepares AcceptToMemoryPool to be decoupled from Params() and creates a -policy command-line option to select the standard or test policy independently of the chain mode (ie main, testnet3, regtest).
Please let’s not delay policy.o even if it’s only with minRelayTxFee.
Later proposals to expand policy.o become more readable once the first step has been walked.
Even better, later proposed changes to main.o may become proposed changes to policy.o!!
In my opinion the biggest development bottleneck is reviewing changes to main.o.
/EDIT
It’s based on #5071 and eliminates Params().RequireStandard() by separating two policies for the 4 networks accessible with Params() as discussed in that PR.
It also includes a couple of “squashme” commits that solve my complains on #5071 in case you @luke-jr want to take them.
jtimon force-pushed
on Oct 30, 2014
jtimon
commented at 10:49 pm on October 30, 2014:
contributor
Since I touch chainparams, my version needed rebase…
luke-jr
commented at 11:33 pm on October 30, 2014:
member
Disagree with per-network policies and global Policy() function; the former overcomplicates modifications for no real benefit, and the latter would make multiple policies more difficult to add in circumstances where they would actually be desirable (ie, within the same running instance).
jtimon force-pushed
on Oct 31, 2014
jtimon force-pushed
on Oct 31, 2014
jtimon force-pushed
on Oct 31, 2014
jtimon
commented at 8:50 pm on October 31, 2014:
contributor
It’s not a per-network policy, please, read the code. It’s quite the opposite actually: it’s decoupling policies from networks.
Previously the user can only select 4 {policy, network} pairs: {standard, mainnet}, {test, testnet}, {test, regtest}, {standard, unitest}
With 2 separate policy classes the available combinations are 8: {standard, test} x {mainnet, testnet, regtest, unitest}.
It also simplifies modifications.
A pointer to an abstract class is by all means more flexible than a reference to a an extern object when it comes to support multiple policies.
With Policy::Factory() you can make as many of them as you want, as shown in the example.
If you want to avoid managing memory manually, Policy::Pool() can be used instead.
Of course, its interface can be simplified to Policy::FactoryPool() (hiding CPolicyPool class).
If we’re not going to have several policies with different states for the same policy type, Policy::Simple() is enough..
You can even hide CNodePolicy, exposing the abstract class is enough.
In fact, what is the point in exposing the abstract class if you’re not going to use polymorphism?
I will of course clean this up, but I hope this can convince you that CNodePolicy::fRequireStandardTx, exposing CNodePolicy and the extern CNodePolicy in main are mistakes.
I’m indifferent to “coins: GetTxFees method” because I don’t see it as specially useful, but if the new method is not even going to be used (as in “SQUASHME: actually use GetTxFees method”) I would say NACK. It seems completely orthogonal to the rest of the PR anyway.
jtimon force-pushed
on Dec 30, 2014
jtimon
commented at 1:30 am on December 30, 2014:
contributor
Updated initial description.
jtimon force-pushed
on Jan 3, 2015
jtimon
commented at 3:30 pm on January 3, 2015:
contributor
Updated code and description again without IsDust() this time.
jtimon renamed this:
Separate standard and testing policies
Policy: Separate standard and testing policies
on Jan 3, 2015
jtimon force-pushed
on Jan 3, 2015
jtimon force-pushed
on Jan 4, 2015
jtimon force-pushed
on Jan 4, 2015
jtimon force-pushed
on Jan 7, 2015
jtimon force-pushed
on Jan 7, 2015
jtimon
commented at 11:03 pm on January 7, 2015:
contributor
Rebased after #5521 has been merged for easier review.
jtimon force-pushed
on Jan 10, 2015
jtimon force-pushed
on Jan 13, 2015
jtimon
commented at 0:20 am on January 13, 2015:
contributor
The default -acceptnonstdtxn=0 is equivalent to the default -policy=standard.
To use the equivalent of -acceptnonstdtxn=1, you use -policy=test.
This has the advantages of decoupling policy from Params() and that adding new policies (say, -policy=fss_rbf) becomes easier in the future.
Anyway, this needs rebase.
jtimon renamed this:
DEPENDENT: Policy: Separate standard and testing policies
WIP: Policy: Separate standard and testing policies
on Jul 7, 2015
Policy: RENAME: Introduce CPolicy interface and hidden CStandardPolicy class implementing it
Policy: Turn globals fIsBareMultisigStd and fRequireStandard into CStandardPolicy attributescece42eb90
fixup! the whole point of exposing policy options is to allow users to select them2d71478a68
Introduce Container template38d64c96ff
Policy: Allow selection of different policies using a factory3ca225fbf2
Policy: Separate Standard and test policies to select them independently of the chain
...by replacing CChainParams::fRequireStandard with CChainParams::strDefaultPolicy
Also expose it as an option (-policy=test) equivalent to -acceptnonstdtxn.
This decouples policy/policy.cpp from Params()
e6ae42255e
jtimon force-pushed
on Jul 8, 2015
jtimon
commented at 12:34 pm on July 8, 2015:
contributor
Updated without deprecating anything.
Now -policy overwrites the chain selection but -acceptnonstdtxn overwrites -policy (at least for policies standard and test, other policies may not even have a -acceptnonstdtxn option).
I don’t care about keeping -acceptnonstdtxn even if you can just use -policy=test instead of -acceptnonstdtxn=1 (so keeping it is redundant), to me the important thing is decoupling policy from Params() and having a factory to make the creation maintenance of custom policies easier.
jtimon
commented at 12:12 pm on July 11, 2015:
contributor
I only reopened to show and discuss the updated version. But, again, closing until there’s a CPolicy interface class.
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-17 09:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me