Commit graph

20456 commits

Author SHA1 Message Date
Gregory Sanders
d8dc3f2f29 modify p2p_feefilter test to catch rounding error 2019-10-14 10:17:32 -04:00
Gregory Sanders
130d190e70 Disallow implicit conversion for CFeeRate constructor 2019-10-14 10:17:32 -04:00
Gregory Sanders
36fceda4ab feefilter: Compute the absolute fee rather than stored rate to match mempool acceptance logic 2019-10-14 10:17:32 -04:00
Steven Roose
073cb3cb94
Merge #732: Give more descriptive error for non-WSH(OP_TRUE) block generation
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
2019-10-14 13:38:39 +01:00
Gregory Sanders
b0f4cb397a
Merge #745: finalizecompactblock: Fix it
7126d1fe3 finalizecompactblock: Fix it, make test easier to fail (Gregory Sanders)

Pull request description:

  We were putting together the block wrong in a couple ways.

  The order of the transactions matter when give as the "missing transactions" list. We're simply feeding it two lists of transactions that together should contain the full block. Also we should actually serialized the 2nd argument rather than the 1st, again.

Tree-SHA512: a1ecbc737d39113a517bc0ce3c53dc66472b0789fa60ef86083672e946d2c5ba1e06207314760f3358f34996b794b72d30279c96f65d9f784d35603e4db727d4
2019-10-11 09:24:50 -04:00
Gregory Sanders
7126d1fe38 finalizecompactblock: Fix it, make test easier to fail 2019-10-10 15:46:43 -04:00
Steven Roose
8fd1b52f9d
Merge #744: Fix finalizecompactblock filling in more found txs from mempool
cb90cdb7b Fix finalizecompactblock filling in more found txs from mempool (Gregory Sanders)

Pull request description:

  If you instantiate `InitData` with a non-empty mempool, it may find "missing transactions", fill them in, and then the missing transaction index vector is now faulty and fails.

  All data is already available to finish the block(or not in case of collision), just use given data.

  Fixes intermittent feature_blocksign.py failure.

Tree-SHA512: d0d984b72daf710a1889c1e7032fe4fc81a26701d595441d9978bd6ab37f59b3a90df52a45df120007eb9465c6c4879807b6bea3602bb32ed1c05814d041c6fb
2019-10-10 17:05:33 +01:00
Gregory Sanders
cb90cdb7bf Fix finalizecompactblock filling in more found txs from mempool 2019-10-10 10:52:34 -04:00
Steven Roose
3c01b3435e
Merge #742: Don't run normal functional tests twice.
d71ddbee4 Don't run normal functional tests twice. (Gregory Sanders)

Pull request description:

Tree-SHA512: f10aeaa6e2b56e1a50cc76b1df24f3a509201f34ff8e890c55f15c56ec33b6fd3223adcd423243944672e4e16d63c323a20267753d754c797eeafb703011c472
2019-10-10 10:26:01 +01:00
Gregory Sanders
d71ddbee40 Don't run normal functional tests twice. 2019-10-09 17:32:25 -04:00
Steven Roose
a2a0a83716
Merge #738: feature_fedpeg.py: just use testmempoolaccept checking blinded peg-in…
3e912deef Sprinkle a bunch of syncs to avoid peg-in failure hanging (Gregory Sanders)
3ac8e298a feature_fedpeg.py: just use testmempoolaccept checking blinded peg-in transactions (Gregory Sanders)

Pull request description:

  … transactions

  Previous test had race condition causing spurious failures for no additional coverage.

  Resolves https://github.com/ElementsProject/elements/issues/728

Tree-SHA512: f128bb0b8ad54da683c66bbd6ad1385927659fab4cc8e77e57943dea6c7d989389c39e29ff8d282bdab3e068ec38af449e2941e03f802fe477d839b636587e92
2019-10-09 20:06:13 +01:00
Gregory Sanders
3e912deefc Sprinkle a bunch of syncs to avoid peg-in failure hanging 2019-10-09 13:24:51 -04:00
Gregory Sanders
3ac8e298a9 feature_fedpeg.py: just use testmempoolaccept checking blinded peg-in transactions 2019-10-09 13:24:51 -04:00
Gregory Sanders
81fd79ab94
Merge #739: Take mempool locks when doing compact block RPC calls touching mempool
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
2019-10-09 13:13:14 -04:00
Gregory Sanders
67a669e692 Take mempool locks when doing compact block RPC calls touching mempool 2019-10-09 12:11:52 -04:00
Steven Roose
4b2fac45b9
Merge #730: Change Proprietary types to use the method specified in BIP 174
34e135011 Use Elements PSBT magic when in Elements mode (Andrew Chow)
3fa355c76 Change Proprietary types to use the method specified in BIP 174 (Andrew Chow)

Pull request description:

  https://github.com/bitcoin/bips/pull/849 (not yet merged) adds to BIP 174 proprietary types. This PR changes the PSBT types used in Elements to be in line with the proposed changes to the BIP/

Tree-SHA512: 73085a16005448d9f6ad1b74da4a40043ec29738256a439f35106793d11d0e95cb8d728db5cfefe1ddd49cd80367f7f5790d09efaa95bc443e1d6ba295240c4d
2019-10-09 16:46:15 +01:00
Andrew Chow
34e1350114 Use Elements PSBT magic when in Elements mode
Elements PSBTs are incompatible with normal PSBTs due to differing transaction
formats, so use different magic bytes to distinguish.
2019-10-08 14:12:04 -04:00
Andrew Chow
3fa355c767 Change Proprietary types to use the method specified in BIP 174 2019-10-08 14:04:44 -04:00
Gregory Sanders
3a2888ccad Give more descriptive error for non-WSH(OP_TRUE) block generation 2019-10-08 10:22:40 -04:00
Steven Roose
ee14d88de2
Merge #734: Don't run unit tests for compatibility run(which is a NOP)
b53ad3118 Disable functional tests for sanitzer runs which just OOM (Gregory Sanders)
1893ba191 Don't run unit tests for compatibility run(which is a NOP) (Gregory Sanders)

Pull request description:

  This particular build is intended for bitcoin_functional tests only, and the unit tests are timing out consistently for some unrelated reason, so turn them off.

Tree-SHA512: 8f31b5f4fef38271652a3c534c2191d6b6d567e992ef27ba4a6f2fc8c3aebd6d9aef755563780554609346ab397adc71e16229878cad48289918d1ff71cfa0fb
2019-10-08 15:19:54 +01:00
Gregory Sanders
b53ad31189 Disable functional tests for sanitzer runs which just OOM 2019-10-08 10:07:07 -04:00
Gregory Sanders
d93e27ef93
Merge #733: Fix assets_tutorial.py signblock dynafed error
f302515f7 Fix assets_tutorial.py signblock dynafed error (wintercooled)

Pull request description:

  Versions 0.18+ require a witnessScript argument for signblock unless the start arguments specify the ``con_dyna_deploy_start`` argument as ``0``.

Tree-SHA512: cb12eaf7664868ad741a72188db8e5c6337e9376b48972698eda7c333afbaf8f99b138aadba3b877977a2b34d0a32551c6c0606e1836af2c41939b227dd58647
2019-10-08 09:12:18 -04:00
Gregory Sanders
1893ba1910 Don't run unit tests for compatibility run(which is a NOP) 2019-10-08 08:37:54 -04:00
wintercooled
f302515f7c Fix assets_tutorial.py signblock dynafed error 2019-10-08 11:34:00 +01:00
Gregory Sanders
ed03bfc899
Merge #726: Support descriptors with checksums in initpegoutwallet
5af17a42b Update initpegoutwallet help to describe derivation paths properly. (Gregory Sanders)
55c4c6cd2 Fix other bug in initpegoutwallet descriptor parsing (Steven Roose)
28dac17c4 Temp disable pegout descriptors that are not pkh() (Steven Roose)
fdba8c45f Support descriptors with checksums in initpegoutwallet (Steven Roose)

Pull request description:

  Non-pkh descriptor types will be re-enabled once entire liquid network functionary set is updated to use elements daemons.

Tree-SHA512: 41203f767c4879251eb958f938a8cc88b8f5d03ffa16bb598645f5c1bd5b45d7e6468cadcb3c5c12abd62c73913834718b9ad48a24f721537d1e8a0a3cf7e6fc
2019-09-30 12:39:56 -04:00
Gregory Sanders
5af17a42bc Update initpegoutwallet help to describe derivation paths properly. 2019-09-30 12:36:45 -04:00
Steven Roose
55c4c6cd20
Fix other bug in initpegoutwallet descriptor parsing 2019-09-30 17:40:33 +02:00
Steven Roose
28dac17c4d
Temp disable pegout descriptors that are not pkh() 2019-09-30 16:07:20 +02:00
Steven Roose
fdba8c45f9
Support descriptors with checksums in initpegoutwallet 2019-09-30 15:50:27 +02:00
Steven Roose
280c33f865
Merge #723: [HF] Dynafed blocks must have sighash byte
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
2019-09-30 01:18:46 +02:00
Gregory Sanders
b1c36a8ba6
Merge #719: Add unit test for dynafed CalculateRoot methods
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
2019-09-27 15:29:28 -04:00
Gregory Sanders
809f4acd3b Dynafed blocks must have sighash byte
It is not included in the signature hash.
The sighash byte MUST be SIGHASH_ALL to avoid
malleability.
2019-09-27 14:43:50 -04:00
Steven Roose
690fed668c
Merge #720: Fix liquidv1 sync
85de70cdf Don't activate dynafed like custom chains (Gregory Sanders)
b73ff4ccf Fix liquidv1 sync (Gregory Sanders)

Pull request description:

  A single field wasn't given a positive value which
  meant it considers no peg-ins to be valid. This is something introduced by dynafed.

  I put in a guess placeholder, the important part is that it's > 0.

Tree-SHA512: 5a70b282fcf3a47fb17181eafd74f6f5cc2209f18111d6ae21ca0cac50bf63e4864f694826902e1a9ca032f5686c537653fe080d42a5e6ca946354a74998ebf5
2019-09-27 10:39:16 +02:00
Gregory Sanders
85de70cdfa Don't activate dynafed like custom chains 2019-09-26 09:06:31 -04:00
Gregory Sanders
b73ff4ccfe Fix liquidv1 sync
A single field wasn't given a positive value which
meant it considers no peg-ins to be valid.
2019-09-26 09:06:31 -04:00
Steven Roose
6650067bb3
Add unit test for dynafed CalculateRoot methods 2019-09-26 00:47:58 +02:00
Steven Roose
1e5da20b5e
Merge #717: Add legacy pak arg for custom chains
8f6266dae Add legacy pak arg for custom chains (Gregory Sanders)

Pull request description:

  Needs backport for 0.18.1 release

Tree-SHA512: ca9a14f8ff97dc7c6f7587527aa53f4ad3767faf1077c680e3316ca71df7d9b5e5a37d0001e0f9469aab66e26afc9a8530e7bd0a9000034a29c7df9161f733a0
2019-09-25 16:08:59 +02:00
Gregory Sanders
8f6266dae4 Add legacy pak arg for custom chains 2019-09-25 09:10:13 -04:00
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