Commit graph

20418 commits

Author SHA1 Message Date
Gregory Sanders
3c8aacee72
Merge #712: fix len check in blech32 decode() in test framework
522a147be Add blech32 roundtrip test for python implementation (Gregory Sanders)
32564b0a9 fix len check in blech32 decode() in test framework (Dmitry Petukhov)

Pull request description:

  I used the code from test/functional/test_framework/liquid_addr.py with the same length check adjustments in python-elementstx to decode Liquid's blech32 addresses, and it seems to be working fine.

Tree-SHA512: 4ac4589e0cdbeb7397a4f3c9000b8fdb91516ca257b757cddbfb6df2d75df4587ddcee37b8f9f1d0364d5e78515ea2e1f4270eecca42ea9a59b8f28578d7ab1c
2019-09-13 14:56:16 -04:00
Gregory Sanders
522a147be7
Add blech32 roundtrip test for python implementation 2019-09-13 20:28:07 +05:00
Dmitry Petukhov
32564b0a99
fix len check in blech32 decode() in test framework 2019-09-13 20:24:23 +05:00
Steven Roose
cfc4cca1fd
Merge #710: Fix feature_pak.py in light of #706
606f5665a Fix feature_pak.py in light of #706 (Gregory Sanders)

Pull request description:

  someone didn't look at Travis output :O

Tree-SHA512: 586a8a77c7c221d6ff799ca01f939e70cb82de9da14b246f1761ffcaa92e3e4cb538de116c2343f6f613761b49cdfa167ee80a6f99e92491f16d6fa874f59a1f
2019-09-12 17:45:52 +01:00
Gregory Sanders
606f5665a9 Fix feature_pak.py in light of #706 2019-09-12 10:35:45 -04:00
Steven Roose
4d9fa049af
Merge #708: Fix nit in blech32_hrp assignment in Bitcoin chains
a71279610 Fix nit in blech32_hrp assignment in Bitcoin chains (Steven Roose)

Pull request description:

  I don't think this had a real effect, though since blech32 should be disabled for the Bitcoin networks.

Tree-SHA512: fc532cc54d7b42c32369a7fa9b85cd0f4411f394005ad6e507571a660b56fea38cbeade30e4363318d7adc9d7f08cf2bf3731f78ea22a3ecaedf7e920be63756
2019-09-12 12:31:07 +01:00
Steven Roose
a712796108
Fix nit in blech32_hrp assignment in Bitcoin chains 2019-09-11 16:21:49 +01:00
Steven Roose
51c4ebbe81
Merge #706: sendtomainchain_pak: Fix minimum send amount message
3fa6c9ca3 sendtomainchain_pak: Fix minimum send amount message (Gregory Sanders)

Pull request description:

Tree-SHA512: 202da1fc4e3df9df13a0188d64bea77e65439780486cb6baacb736518b16116a91961545f02f2234db929d43352d95de878886de44d68db0153b2fb6d7279c6a
2019-09-11 14:46:02 +01:00
Gregory Sanders
3fa6c9ca3a sendtomainchain_pak: Fix minimum send amount message 2019-09-11 09:27:53 -04:00
Steven Roose
d75d1f3331
Merge #704: RPC: Fix tweakfedpegscript for dynafed, add basic test
f3ce121a6 RPC: Fix tweakfedpegscript for dynafed, add basic test (Gregory Sanders)

Pull request description:

Tree-SHA512: eae8f7133ae4eda8f57a3a00ba66f03e34103855ae08443dc8ab5894c5bd974f5684e26dcccdee0bb07d72baaced9b646cba778fa82118d863c29a48b84cfdfc
2019-09-10 17:55:19 +01:00
Gregory Sanders
f3ce121a6a RPC: Fix tweakfedpegscript for dynafed, add basic test 2019-09-10 11:03:03 -04:00
Steven Roose
5b2fe5563b
Merge #642: Dynamic federations
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
2019-09-06 12:02:28 +01:00
Gregory Sanders
f7905d6dfb Generalize the number of epochs old a peg-in can be and still be valid 2019-09-05 10:51:09 -04:00
Gregory Sanders
b105ff45e5 feature_fedpeg.py: Run in various dynafed transition settings 2019-09-05 10:51:09 -04:00
Gregory Sanders
feef196a20 Fix compilation of raw transaction operations with peg-in inputs 2019-09-05 10:51:09 -04:00
Gregory Sanders
953dd82eae p2sh-wrap peg-in addresses if fedpeg_program is p2sh-wrapped 2019-09-05 10:51:09 -04:00
Gregory Sanders
e2be2356dd Refactor IsPAKValid to not magically acquire chainparams 2019-09-05 10:51:09 -04:00
Gregory Sanders
ecdefc5cb0 Remove script/standard dependence of ContextualCheckDynaFedHeader 2019-09-05 10:51:09 -04:00
Gregory Sanders
59bed57a12 Remove dyanfed.cpp's dependency on script/standard.h 2019-09-05 10:51:09 -04:00
Gregory Sanders
50a2b599ca After a reorg, boot all peg-ins and peg-outs from mempool 2019-09-05 10:51:09 -04:00
Gregory Sanders
6000752a92 Enforce PAK checks on dynafed proposals 2019-09-05 10:51:09 -04:00
Gregory Sanders
dce4cecdda Replace fedpeg template init check for pak one 2019-09-05 10:51:09 -04:00
Gregory Sanders
afdf0239ba Update python test framework for DynaFedParamEntry fedpeg program 2019-09-05 10:51:09 -04:00
Gregory Sanders
95d8339f43 Add functional test for illegal proposals 2019-09-05 10:51:09 -04:00
Gregory Sanders
1baad6bf5a Update dynafed functional test to new behavior 2019-09-05 10:51:09 -04:00
Gregory Sanders
a3cf151de1 fixup proposal checks 2019-09-05 10:51:09 -04:00
Gregory Sanders
04cc76743e getnewblockhex fills out proposal fedpeg program 2019-09-05 10:51:09 -04:00
Gregory Sanders
44f55d36c0 Make future parent segwit versions in fedpegscripts be vacuously true 2019-09-05 10:51:09 -04:00
Gregory Sanders
d7faffdca6 Add dynafed proposal restrictions 2019-09-05 10:51:09 -04:00
Gregory Sanders
37f90ba508 Add description of NextBlockIsParameterTransition 2019-09-05 10:51:09 -04:00
Gregory Sanders
d9387cb5d5 Remove misleading comment for ContextualCheckDynaFedHeader use 2019-09-05 10:51:09 -04:00
Gregory Sanders
bd11097cec Add fedpeg_program field in dynafed header 2019-09-05 10:51:09 -04:00
Gregory Sanders
4ad2b8018d CreatePAKListFromExtensionSpace just uses FromBytes for correctness 2019-09-05 10:51:09 -04:00
Gregory Sanders
6a5eaa189a Remove short-circuit dynafed vote fail for readability 2019-09-05 10:51:09 -04:00
Gregory Sanders
dddc040aa0 s/m_dyna_params/m_dynafed_params/ 2019-09-05 10:51:09 -04:00
Gregory Sanders
6ed63c1fb3 Light explanation of dynamic federations fields 2019-09-05 10:51:09 -04:00
Gregory Sanders
15996384d4 s/ConsensusParamEntry/DynaFedParamEntry/ 2019-09-05 10:51:09 -04:00
Gregory Sanders
642260a126 s/m_sbs_wit_limit/m_signblock_witness_limit/ 2019-09-05 10:51:09 -04:00
Gregory Sanders
b66804678c s/HF_MASK/DYNAFED_HF_MASK/ 2019-09-05 10:51:09 -04:00
Gregory Sanders
0fd39edf54 s/d_params/dynafed_params/ 2019-09-05 10:51:09 -04:00
Gregory Sanders
1779956e69 signrawtransaction* should use up to date fedpegscript for peg-in signing 2019-09-05 10:51:09 -04:00
Gregory Sanders
47db75e39f Dynafed RPC support, tests, and deployment for custom chains 2019-09-05 10:51:09 -04:00
Steven Roose
7c302d2bc4
Merge #702: fix no return at end of function introduced in 172ad71988
72186f8b7 f'Fix QT startup for custom chains' (Gregory Sanders)

Pull request description:

Tree-SHA512: b903ae09eeaf5a660444a69c8f058712a808f04ae5c037474c98d013077c80f39b697d679ec07d877188c2e53a93c8f7bcbf2bca1803ee6a43dd0b8eada1f962
2019-09-04 08:58:35 +01:00
Gregory Sanders
72186f8b7d f'Fix QT startup for custom chains' 2019-09-03 11:11:23 -04:00
Gregory Sanders
aac354b5ba OP_TRUE outputs should be allowed to be segwit-ified by decodescript 2019-09-03 10:55:29 -04:00
Gregory Sanders
055514b688 Have removeForBlock boot transactions when required 2019-09-03 10:55:29 -04:00
Gregory Sanders
525b24cf5c Expose fedpeg fetching to consensus and mempool internals 2019-09-03 10:55:29 -04:00
Gregory Sanders
4ac437b87c GetTransactionSigOpCost shouldn't need fedpegscript to evaluate 2019-09-03 10:55:29 -04:00
Gregory Sanders
5097c3880c Add and update startup args for dynafed 2019-09-03 10:55:28 -04:00
Gregory Sanders
24535d6a9f Add unused dynamic genesis block style in chainparams 2019-09-03 10:55:09 -04:00