bf66a93cb Correctly seed the liquidv1 paklist pre-dynafed (Gregory Sanders)
Pull request description:
Currently PAK is blank for anyone running on liquidv1 network. This is wrong.
No PAK list changes are expected prior to dynafed roll-out, so this should remain constant until activation.
Tree-SHA512: eef819c62ee887fdb36b194e52f896306e567a9e7a059fec0620c87b9e126f594a78128e7beec7e86c00976b180c7ea43412a7bb123c3f50e4800d3c837b7f6b
674f3c747 When RPC server disabled, only warn on validatepegin failure (Gregory Sanders)
Pull request description:
QT starts up normally, and fails when `-server=1` is set, and continues otherwise, by turning off peg-in validation.
This should be tested on liquidv1 with fresh syncs.
Tree-SHA512: acf188b2eead8db2f2b8d92ae90b510a05e6ab15639249917a3fb99bf3ec48b3d741e372a4bfcf44b8c632d199e56070bbfe1f6a69ef1c991f126b4d34b218a8
5a4d61169 Test raw transaction peg-in (Andrew Chow)
ac6f052a6 Have find_vout_for_address only get non-confidential address when using elements chain (Andrew Chow)
cefe40767 Allow specifying peg-in info in raw transaction RPC inputs (Andrew Chow)
42babb81f Refactor peg-in input construction into its own function in rpc/rawtransaction.cpp (Andrew Chow)
a90d1521c Refactor peg-in witness construction to it's own function (Andrew Chow)
Pull request description:
Adds to `createrawtransaction` the fields `pegin_bitcoin_tx`, `pegin_txout_proof`, and `pegin_claim_script` so that raw transactions can contain peg-in inputs too.
Since `ConstructTransaction` is used by `createpsbt` and `walletcreatefundedpsbt` but those should not support peg-ins yet (the peg-in data should go into PSBT fields for peg-ins but those don't exist yet), an argument is added to it to optionally reject peg-in data.
Tree-SHA512: fcf3e4be87f92bfc5b00321bec405001d98615cefb76118345e0c759c6bfcb90b6050735960b6fbdbe26479fa11c9273f9963873a8adc1fbad9ed31dc7953ee0
3a2888cca Give more descriptive error for non-WSH(OP_TRUE) block generation (Gregory Sanders)
Pull request description:
If someone transitions to a different block type, including something else op_true-ey but not exactly, `generatetoaddress` and ilk will complain without much recourse.
Tree-SHA512: 720e6888eb3985ad3619d2570b4c22985365a63d72d4a0d9b7d75d2091f6839db034d1b192a177901f0dfbb0d97cef330183438b02c6a11b64d33fe480023d88
67a669e69 Take mempool locks when doing compact block RPC calls touching mempool (Gregory Sanders)
Pull request description:
This may help reduce the failures in `feature_blocksign.py` that seem to occur fairly often. It could be that the mempool is in an inconsistent state, which messed up compact block finalization.
Tree-SHA512: cd066933cf58b3c57869db3fd97c2de0ff554d442e91051f43626b12778d55835065ad5fc42fed09b7750796e9e0b2e6947f1ac54e02fe4c8e2a84fe340429ae
809f4acd3 Dynafed blocks must have sighash byte (Gregory Sanders)
Pull request description:
It is not included in the signature hash.
The sighash byte MUST be SIGHASH_ALL to avoid malleability.
Tree-SHA512: d4a658448e3a8b3609b32fc24e8d28fc65ea13021ba0b49109b6c4477253d08183ac6e77e0658f23b2630cbb916c6b19e86db241c5d7456391385a308235d0bd
6650067bb Add unit test for dynafed CalculateRoot methods (Steven Roose)
Pull request description:
I created these for having test vectors for rust-elements, but it makes sense to have them around so that we don't accidentally change them.
Tree-SHA512: 1e6fef4a09e1ab15cf462858c83e65c1224b15e14aa73b7ae1788b74aca3c2c46147affb44a1a1a64bf8c4ff7f57f3859e220652f4ea2ab5ff14738a33ab756a
f7905d6df Generalize the number of epochs old a peg-in can be and still be valid (Gregory Sanders)
b105ff45e feature_fedpeg.py: Run in various dynafed transition settings (Gregory Sanders)
feef196a2 Fix compilation of raw transaction operations with peg-in inputs (Gregory Sanders)
953dd82ea p2sh-wrap peg-in addresses if fedpeg_program is p2sh-wrapped (Gregory Sanders)
e2be2356d Refactor IsPAKValid to not magically acquire chainparams (Gregory Sanders)
ecdefc5cb Remove script/standard dependence of ContextualCheckDynaFedHeader (Gregory Sanders)
59bed57a1 Remove dyanfed.cpp's dependency on script/standard.h (Gregory Sanders)
50a2b599c After a reorg, boot all peg-ins and peg-outs from mempool (Gregory Sanders)
6000752a9 Enforce PAK checks on dynafed proposals (Gregory Sanders)
dce4cecdd Replace fedpeg template init check for pak one (Gregory Sanders)
afdf0239b Update python test framework for DynaFedParamEntry fedpeg program (Gregory Sanders)
95d8339f4 Add functional test for illegal proposals (Gregory Sanders)
1baad6bf5 Update dynafed functional test to new behavior (Gregory Sanders)
a3cf151de fixup proposal checks (Gregory Sanders)
04cc76743 getnewblockhex fills out proposal fedpeg program (Gregory Sanders)
44f55d36c Make future parent segwit versions in fedpegscripts be vacuously true (Gregory Sanders)
d7faffdca Add dynafed proposal restrictions (Gregory Sanders)
37f90ba50 Add description of NextBlockIsParameterTransition (Gregory Sanders)
d9387cb5d Remove misleading comment for ContextualCheckDynaFedHeader use (Gregory Sanders)
bd11097ce Add fedpeg_program field in dynafed header (Gregory Sanders)
4ad2b8018 CreatePAKListFromExtensionSpace just uses FromBytes for correctness (Gregory Sanders)
6a5eaa189 Remove short-circuit dynafed vote fail for readability (Gregory Sanders)
dddc040aa s/m_dyna_params/m_dynafed_params/ (Gregory Sanders)
6ed63c1fb Light explanation of dynamic federations fields (Gregory Sanders)
15996384d s/ConsensusParamEntry/DynaFedParamEntry/ (Gregory Sanders)
642260a12 s/m_sbs_wit_limit/m_signblock_witness_limit/ (Gregory Sanders)
b66804678 s/HF_MASK/DYNAFED_HF_MASK/ (Gregory Sanders)
0fd39edf5 s/d_params/dynafed_params/ (Gregory Sanders)
1779956e6 signrawtransaction* should use up to date fedpegscript for peg-in signing (Gregory Sanders)
47db75e39 Dynafed RPC support, tests, and deployment for custom chains (Gregory Sanders)
aac354b5b OP_TRUE outputs should be allowed to be segwit-ified by decodescript (Gregory Sanders)
055514b68 Have removeForBlock boot transactions when required (Gregory Sanders)
525b24cf5 Expose fedpeg fetching to consensus and mempool internals (Gregory Sanders)
4ac437b87 GetTransactionSigOpCost shouldn't need fedpegscript to evaluate (Gregory Sanders)
5097c3880 Add and update startup args for dynafed (Gregory Sanders)
24535d6a9 Add unused dynamic genesis block style in chainparams (Gregory Sanders)
d10c42a26 Create epoch length chainparam (Gregory Sanders)
b996a425e Set default of multi_data_permitted to enforce_pak (Gregory Sanders)
f6f6308c9 Correct comment about liquidv1 fedpeg matching template (Gregory Sanders)
4c00eb408 Miner should stop trying to account for old PAK system (Gregory Sanders)
0e10287f7 Add miner ability to make dynafed blocks (Gregory Sanders)
5d281e7e6 ContextualCheckBlockHeader: dynafed doesn't call CheckChallenge (Gregory Sanders)
9fe43cdf8 Introduce contextual block checks for dynafed (Gregory Sanders)
3605505c9 Enable pak enforcement at mempool/block level when appropriate (Gregory Sanders)
802a05519 ScriptHasValidPAKProof takes fedpeg as arg (Gregory Sanders)
89174e961 Remove old mempool-booting logic (Gregory Sanders)
edb865cc2 Remove standardness checks for PAK (Gregory Sanders)
804cd9f75 Update PAK internals, helper functions (Gregory Sanders)
16b87ba95 Disable PAK loading from configuration on init, disable pak test (Gregory Sanders)
918896d6f Add inactive versionbits dynafed deployment (Gregory Sanders)
0a8565bbf ReadBlockFromDisk: do genesis block check before block proof check (Gregory Sanders)
6f0d9244f Bump last old block version for versonbits due to elements (Gregory Sanders)
563cd93d4 Add python implementation of dynafed block serialization (Gregory Sanders)
8d3091bbc Deserialize merkle proofs without witness, which matters for dynafed (Gregory Sanders)
830f91723 Add fedpegscript-fetching helper (Gregory Sanders)
b56fe1495 calculate_contract: remove most template checks and assert in preperation for dynafed (Gregory Sanders)
fd63cee1a Add note on peg-in sigops (Gregory Sanders)
f17d7de52 Add dynafed helper functions (Gregory Sanders)
4aa5f991f Refactor block_proof to support dynafed (Gregory Sanders)
4e52f2c83 Add dynamic federation blockheader fields to chaindb serialization (Gregory Sanders)
a74accf7d Add dynamic federations blockheader serialization with HF bit (Gregory Sanders)
2845e7811 Define dynamic federations primitives (Gregory Sanders)
Pull request description:
This is a proposal implementation of something myself and Andrew have been working on, to enable dynamic membership in the blocksigning set, fedpeg signing set, and under the same coordination mechanism, the PAK enforcement.
At a really high level:
1) If 4/5 of last N(what we call an epoch length) blocks signal desire for a change in the parameters of the system, they are replaced with the proposed. These changes can be proposed/driven by `getnewblockhex`.
2) Once dynamic federations is active(versionbits deployment), signblockscripts can only be native segwit scripts, in other words, must be a version byte followed by the witness program. The blockheader now has a witness stack as well.
3) The fedpegscript of last N epochs are both allowed as a grace period for users putting money into the system.
4) PAK enforcement has been upgraded to consensus-enforcement once dynamic federations activates
A design document is forthcoming.
Tree-SHA512: 26c6e05c85adb77345d8d481f20e8095bc2f9e5ad7b9a8824008a056637af7c6e87e522b038a6c6c108889d60b2fd1d6ecbd3e0afe2b696579000d18b0f1ecad