Commit Graph

24419 Commits

Author SHA1 Message Date
W. J. van der Laan
f9b22b61e6
Merge bitcoin/bitcoin#22895: consensus: don't call GetBlockPos in ReadBlockFromDisk without cs_main lock
350e034e64d175f3db4c85ddca42e76e279912f6 consensus: don't call GetBlockPos in ReadBlockFromDisk without lock (Jon Atack)

Pull request description:

  Commit ccd8ef65 "Reduce cs_main lock in ReadBlockFromDisk, only read GetBlockPos under the lock" in #11281 moved the cs_main lock from caller to `ReadBlockFromDisk()` for calling `CBlockIndex::GetBlockPos()`, but the second invocation doesn't have the lock, and IIUC there is no guarantee the compiler can know if state has changed.

  Use the `blockPos` local variable instead, rename it to `block_pos`, and make it const.

ACKs for top commit:
  laanwj:
    Code review ACK 350e034e64d175f3db4c85ddca42e76e279912f6
  theStack:
    Code-review ACK 350e034e64d175f3db4c85ddca42e76e279912f6
  promag:
    Code review ACK 350e034e64d175f3db4c85ddca42e76e279912f6.

Tree-SHA512: 0df0614ab1876885c85f7b53c604a759a29008da8027e95503b4726d2b820ec6d27546020c613337ff954406e01cb5d191978ba4a12124052fed6e1b0e9a226f
2023-12-26 22:26:18 -06:00
merge-script
808926be7e
Merge bitcoin/bitcoin#22952: Cleanup headers after #20788
317442525586ba9ff8b9af6c506b48f87cd8cd87 Cleanup headers after #20788 (Hennadii Stepanov)

Pull request description:

  This is a header cleanup after #20788.

ACKs for top commit:
  vasild:
    ACK 317442525586ba9ff8b9af6c506b48f87cd8cd87

Tree-SHA512: 1c21b1ba43841880625289174f10e5b333f6eb857f448e1e4114b1ecdf32a6044ec91c5987c1d66806c1d408a4e3d46569eb41d69a0acb8296601d7c203d9f1d
2023-12-26 22:26:18 -06:00
fanquake
e0d893a11a
Merge bitcoin/bitcoin#22836: Stricter BIP32 decoding and test vector 5
56a42f10f452f0ac0e3e333646a8effcbebf6b30 Stricter BIP32 decoding and test vector 5 (Pieter Wuille)

Pull request description:

  This adds detection for various edge cases when decoding BIP32 extended pubkeys/privkeys, and tests them using the proposed https://github.com/bitcoin/bips/pull/921 BIP32 test vector 5.

ACKs for top commit:
  darosior:
    utACK 56a42f10f452f0ac0e3e333646a8effcbebf6b30 -- Had to implement essentially the same fix in python-bip32.
  kristapsk:
    ACK 56a42f10f452f0ac0e3e333646a8effcbebf6b30. Checked that test vectors are the same as in BIP32 and that tests pass.

Tree-SHA512: 5cc800cc9dc10e43ae89b659ce4f44026d04ec3cabac4eb5122d2e72ec2ed66cd5ace8c7502259e469a9ecaa5ecca2457e55dfe5fedba59948ecbf6673af67a7
2023-12-26 22:26:18 -06:00
PastaPastaPasta
6848a6a77d
Merge pull request #5787 from PastaPastaPasta/develop-trivial-2023-12-22
backport: trivial backports Dec 23 2023
2023-12-24 12:00:25 -06:00
MarcoFalke
e40d67a170
Merge bitcoin/bitcoin#22657: fuzz: Re-enable assert in banman again
fabed982ad9143cddaca8346f6b4c243dd84e0c4 fuzz: Re-enable assert in banman again (MarcoFalke)

Pull request description:

  Looks like this was accidentally fixed by removing the buggy code in commit efd6f904c78769ad2e93c1f1de43014d284e7561

ACKs for top commit:
  hebasto:
    ACK fabed982ad9143cddaca8346f6b4c243dd84e0c4

Tree-SHA512: 2dea5dad48ff2050ae7086c1c6306c40f650e9629918e79adc54164a375d777a70b29f5a480566dc6430f07ce33dfe703fc5d45a20125584b4a026c5832198a2
2023-12-24 11:59:47 -06:00
fanquake
83e374f081
Merge bitcoin/bitcoin#22609: [GetTransaction] remove unneeded cs_main lock acquire
4a1b2a7ba7f804e656a8cd29d5aa80fcbd40904f [GetTransaction] remove unneeded `cs_main` lock acquire (Sebastian Falbesoner)

Pull request description:

  This PR is a follow-up to #22383. For reading from the mempool, only `mempool.cs` needs to be locked (see [suggestion by MarcoFalke](https://github.com/bitcoin/bitcoin/pull/22383#discussion_r675069128)):

  b620b2d58a/src/txmempool.h (L554-L558)

  `CTxMemPool::get()` acquires this lock:

  b620b2d58a/src/txmempool.cpp (L822-L829)

   so we don't need to acquire any lock ourselves in `GetTransaction()`, as the other functions called in the remaining parts also don't need to have `cs_main` locked.

ACKs for top commit:
  tryphe:
    Concept ACK. tested 4a1b2a7ba7f804e656a8cd29d5aa80fcbd40904f but not extensively.
  jnewbery:
    Code review ACK 4a1b2a7ba7f804e656a8cd29d5aa80fcbd40904f

Tree-SHA512: 60e869f72e65cf72cb144be1900ea7f3d87c12f322756994f6a3ed8cd975230b36c7c90c34b60bbf41f9186f4add36decaac1d4f0d0749fb5451b3938a8aa78c
2023-12-24 11:59:47 -06:00
fanquake
90f04217ca
Merge bitcoin/bitcoin#22557: fuzz: silence a compiler warning about unused CBanEntry comparator
787296eb6744b15ab693c053e4030ff68dfc95e0 fuzz: silence a compiler warning about unused CBanEntry comparator (Vasil Dimov)

Pull request description:

  ```
  test/fuzz/banman.cpp:35:13: warning: unused function 'operator==' [-Wunused-function]
  static bool operator==(const CBanEntry& lhs, const CBanEntry& rhs)
              ^
  1 warning generated.
  ```

  See https://github.com/bitcoin/bitcoin/pull/22517#issuecomment-886177699

ACKs for top commit:
  MarcoFalke:
    cr ACK 787296eb6744b15ab693c053e4030ff68dfc95e0
  practicalswift:
    cr ACK 787296eb6744b15ab693c053e4030ff68dfc95e0
  hebasto:
    ACK 787296eb6744b15ab693c053e4030ff68dfc95e0

Tree-SHA512: 72e483cef249170160879cf4b69b787fb6c539d61dda423f618e2c5f130bee8c42897487751e5b58e7679cdb0153eb80efcb104e8a85095daa60d47e39ce78b8
2023-12-24 11:59:46 -06:00
W. J. van der Laan
b28f25774a
Merge bitcoin/bitcoin#22481: mempool: apply rule of 5 to epochguard.h, fix compiler warnings
7b3a20b2602f902c344a615f23f8f0280b6f6bcc mempool: apply rule of 5 to epochguard.h, fix compiler warnings (Jon Atack)

Pull request description:

  Apply the rule of five to `src/util/epochguard.h::{Epoch, Marker}` for safety, which also nicely fixes the `-Wdeprecated-copy` compiler warnings with Clang 13.

  References:

  - https://en.cppreference.com/w/cpp/language/rule_of_three
  - https://www.stroustrup.com/C++11FAQ.html#default
  - https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-five

  <details><summary>Compiler warnings fixed</summary><p>

  ```bash
  In file included from policy/rbf.cpp:5:
  In file included from ./policy/rbf.h:8:
  In file included from ./txmempool.h:24:
  ./util/epochguard.h:53:17: warning: definition of implicit copy constructor for 'Marker' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
          Marker& operator=(const Marker&) = delete;
                  ^
  ./txmempool.h:81:7: note: in implicit copy constructor for 'Epoch::Marker' first required here
  class CTxMemPoolEntry
        ^
  policy/rbf.cpp:29:29: note: in implicit copy constructor for 'CTxMemPoolEntry' first required here
      CTxMemPoolEntry entry = *pool.mapTx.find(tx.GetHash());
  ```

  ```bash
  In file included from txmempool.cpp:6:
  In file included from ./txmempool.h:24:
  ./util/epochguard.h:53:17: warning: definition of implicit copy constructor for 'Marker' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
          Marker& operator=(const Marker&) = delete;
                  ^
  ./txmempool.h:81:7: note: in implicit copy constructor for 'Epoch::Marker' first required here
  class CTxMemPoolEntry
        ^
  /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:150:23: note: in implicit copy constructor for 'CTxMemPoolEntry' first required here
          { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
                               ^
  /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:512:8: note: in instantiation of function template specialization '__gnu_cxx::new_allocator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry>>>>>>>>::construct<CTxMemPoolEntry, const CTxMemPoolEntry &>' requested here
            __a.construct(__p, std::forward<_Args>(__args)...);
                ^
  /usr/include/boost/multi_index_container.hpp:655:24: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::hashed_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy, boost::multi_index::detail::index_node_base<CTxMemPoolEntry, std::allocator<CTxMemPoolEntry>>>>>>>>>::construct<CTxMemPoolEntry, const CTxMemPoolEntry &>' requested here
      node_alloc_traits::construct(
                         ^
  /usr/include/boost/multi_index/detail/index_base.hpp:108:15: note: in instantiation of member function 'boost::multi_index::multi_index_container<CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid>, mempoolentry_wtxid, SaltedTxidHasher>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>>>::construct_value' requested here
        final().construct_value(x,v);
                ^
  /usr/include/boost/multi_index/detail/ord_index_impl.hpp:770:33: note: (skipping 5 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
      final_node_type* res=super::insert_(v,x,variant);
                                  ^
  /usr/include/boost/multi_index_container.hpp:693:33: note: in instantiation of function template specialization 'boost::multi_index::detail::hashed_index<mempoolentry_txid, SaltedTxidHasher, std::equal_to<uint256>, boost::multi_index::detail::nth_layer<1, CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid>, mempoolentry_wtxid, SaltedTxidHasher>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>>, std::allocator<CTxMemPoolEntry>>, boost::mpl::vector0<>, boost::multi_index::detail::hashed_unique_tag>::insert_<boost::multi_index::detail::lvalue_tag>' requested here
      final_node_type* res=super::insert_(v,x,variant);
                                  ^
  /usr/include/boost/multi_index_container.hpp:705:12: note: in instantiation of function template specialization 'boost::multi_index::multi_index_container<CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid>, mempoolentry_wtxid, SaltedTxidHasher>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>>>::insert_<boost::multi_index::detail::lvalue_tag>' requested here
      return insert_(v,detail::lvalue_tag());
             ^
  /usr/include/boost/multi_index/detail/index_base.hpp:213:21: note: in instantiation of member function 'boost::multi_index::multi_index_container<CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid>, mempoolentry_wtxid, SaltedTxidHasher>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>>>::insert_' requested here
      {return final().insert_(x);}
                      ^
  /usr/include/boost/multi_index/hashed_index.hpp:284:46: note: in instantiation of member function 'boost::multi_index::detail::index_base<CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid>, mempoolentry_wtxid, SaltedTxidHasher>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>>, std::allocator<CTxMemPoolEntry>>::final_insert_' requested here
      std::pair<final_node_type*,bool> p=this->final_insert_(x);
                                               ^
  txmempool.cpp:363:53: note: in instantiation of member function 'boost::multi_index::detail::hashed_index<mempoolentry_txid, SaltedTxidHasher, std::equal_to<uint256>, boost::multi_index::detail::nth_layer<1, CTxMemPoolEntry, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, boost::multi_index::hashed_unique<boost::multi_index::tag<index_by_wtxid>, mempoolentry_wtxid, SaltedTxidHasher>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<descendant_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByDescendantScore>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<entry_time>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByEntryTime>, boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score>, boost::multi_index::identity<CTxMemPoolEntry>, CompareTxMemPoolEntryByAncestorFee>>, std::allocator<CTxMemPoolEntry>>, boost::mpl::vector0<>, boost::multi_index::detail::hashed_unique_tag>::insert' requested here
      indexed_transaction_set::iterator newit = mapTx.insert(entry).first;
  ```

  ```bash
  In file included from test/fuzz/policy_estimator.cpp:9:
  In file included from ./test/fuzz/util.h:27:
  In file included from ./txmempool.h:24:
  ./util/epochguard.h:53:17: warning: definition of implicit copy constructor for 'Marker' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
          Marker& operator=(const Marker&) = delete;
                  ^
  ./txmempool.h:81:7: note: in implicit copy constructor for 'Epoch::Marker' first required here
  class CTxMemPoolEntry
        ^
  /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:150:23: note: in implicit move constructor for 'CTxMemPoolEntry' first required here
          { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
                               ^
  /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:512:8: note: in instantiation of function template specialization '__gnu_cxx::new_allocator<CTxMemPoolEntry>::construct<CTxMemPoolEntry, CTxMemPoolEntry>' requested here
            __a.construct(__p, std::forward<_Args>(__args)...);
                ^
  /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/vector.tcc:115:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<CTxMemPoolEntry>>::construct<CTxMemPoolEntry, CTxMemPoolEntry>' requested here
              _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
                             ^
  /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1204:9: note: in instantiation of function template specialization 'std::vector<CTxMemPoolEntry>::emplace_back<CTxMemPoolEntry>' requested here
        { emplace_back(std::move(__x)); }
          ^
  test/fuzz/policy_estimator.cpp:49:37: note: in instantiation of member function 'std::vector<CTxMemPoolEntry>::push_back' requested here
                      mempool_entries.push_back(ConsumeTxMemPoolEntry(fuzzed_data_provider, tx));
  ```
  </p></details>

ACKs for top commit:
  laanwj:
    Code review ACK 7b3a20b2602f902c344a615f23f8f0280b6f6bcc
  vasild:
    ACK 7b3a20b2602f902c344a615f23f8f0280b6f6bcc

Tree-SHA512: 0406dfcec180152d4f9ed07cbc2f406ad739b41f9c9cb38f8c75159c15d9d8a9a5c7526765966e40d695d265c178f6a80152e7edf82da344a65e55938dddb63d
2023-12-24 11:59:46 -06:00
MarcoFalke
d2b9631a90
Merge bitcoin/bitcoin#22492: wallet: Reorder locks in dumpwallet to avoid lock order assertion
9b85a5e2f7e003ca8621feaac9bdd304d19081b4 tests: Test for dumpwallet lock order issue (Andrew Chow)
25d99e6511d8c43b2025a89bcd8295de755346a7 Reorder dumpwallet so that cs_main functions go first (Andrew Chow)

Pull request description:

  When a wallet is loaded which has an unconfirmed transaction in the mempool, it will end up establishing the lock order of cs_wallet -> cs_main -> cs_KeyStore. If `dumpwallet` is used on this wallet, then a lock order of cs_wallet -> cs_KeyStore -> cs_main will be used, which causes a lock order assertion. This PR fixes this by reordering `dumpwallet` and `GetKeyBirthTimes` (only used by `dumpwallet`). Specifically, in both functions, the function calls which lock cs_main are done prior to locking cs_KeyStore. This avoids the lock order issue.

  Additionally, I have added a test case to `wallet_dump.py`. Of course testing this requires `--enable-debug`.

  Fixes #22489

ACKs for top commit:
  MarcoFalke:
    review ACK 9b85a5e2f7e003ca8621feaac9bdd304d19081b4 🎰
  ryanofsky:
    Code review ACK 9b85a5e2f7e003ca8621feaac9bdd304d19081b4. Nice to reduce lock scope, and good test!
  prayank23:
    tACK 9b85a5e2f7
  lsilva01:
    Tested ACK 9b85a5e2f7 under the same conditions reported in issue #22489 and the `dumpwallet` command completed successfully.

Tree-SHA512: d370a8f415ad64ee6a538ff419155837bcdbb167e3831b06572562289239028c6b46d80b23d227286afe875d9351f3377574ed831549ea426fb926af0e19c755
2023-12-24 11:59:46 -06:00
MarcoFalke
9e5ee6ac52
Merge #20316: test: Fix wallet_multiwallet test issue on Windows
fa00ff0399fe54f42d80daa04140d19bcfe0e2d8 test: Fix wallet_multiwallet test issue on Windows (MarcoFalke)

Pull request description:

  Fixes:

  ```
  Traceback (most recent call last):
    File "test\functional\test_framework\test_framework.py", line 126, in main
      self.run_test()
    File "test/functional/wallet_multiwallet.py", line 120, in run_test
      assert_equal(sorted(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), sorted(in_wallet_dir))
    File "test\functional\test_framework\util.py", line 49, in assert_equal
      raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
  AssertionError: not(['', 'sub\\w5', 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'] == ['', 'sub/w5', 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'])

ACKs for top commit:
  promag:
    ACK fa00ff0399fe54f42d80daa04140d19bcfe0e2d8.

Tree-SHA512: 7a809a352677a216465cef59e866e4881272e302e897cebf7d9645bf87aebeaf54435bb0692bb5c1381c2dd680e8a34e640ea18ca6e2a4087e3233cd9c24ed04
2023-12-24 11:59:43 -06:00
Odysseas Gabrielides
25cef45858
feat(rpc): gettxchainlocks should return mempool=false when tx not in mempool (#5742)
## Issue being fixed or feature implemented
Platform (in the scope of Withdrawals) need to be aware if a tx isn't in
mempool when requesting status of a tx using RPC `gettxchainlocks`.
cc @markin-io

## What was done?

- mempool is passed to `GetTransaction` and saving the result for
checking latter.
- If the returned tx_ref is nullptr, then the RPC returns null for the
corresponding tx in the array.

Example: 
`tx1` is mined and chainlocked, `tx2` is in mempool and `tx3` doesn't
exist.
The result now is:
`[
  {
    "height": 830,
    "chainlock": false,
    "mempool": true
  },
  {
    "height": -1,
    "chainlock": false,
    "mempool": true
  },
  {
    "height": -1,
    "chainlock": false,
    "mempool": false
  }
]`

## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-12-24 11:58:14 -06:00
Odysseas Gabrielides
563cc34b4e
feat(rpc): Asset Unlock status by index (#5776)
## Issue being fixed or feature implemented
Platform in the scope of credit withdrawals, need a way to get the
status of an Asset Unlock by index.

## What was done?
A new RPC was created `getassetunlockchainlocks` that accepts Asset
Unlock indexes array as parameter and return corresponding status for
each index.

The possible outcomes per each index are:
- `chainlocked`: If the Asset Unlock index is mined on a Chainlocked
block.
- `mined`: If no Chainlock information is available, and the Asset
Unlock index is mined.
- `mempooled`: If the Asset Unlock index is in the mempool.
- `unknown`: If none of the above are valid.

Note: This RPC is whitelisted for the Platform RPC user.

## How Has This Been Tested?
Inserted on `feature_asset_locks.py` covering cases where Asset Unlock
txs are in mempool, mined and not present.

## Breaking Changes
no

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
2023-12-22 14:27:00 -06:00
Konstantin Akimov
b5dc598525
chore: add builder key for knst (#5786)
## What was done?
Add builder key for @knst 

## How Has This Been Tested?
It is the same file with:
https://github.com/dashpay/guix.sigs/blob/master/builder-keys/knst.pgp
Checked a signature of guix.sigs for 20.0.2: `gpg --status-fd 1 --verify
20.0.2/knst/codesigned.SHA256SUMS.asc` - matched.


## Breaking Changes
N/A

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-12-22 14:16:45 -06:00
UdjinM6
7724eb4f03
fix: ScanQuorums should not start cache population for outdated quorums (#5784)
## Issue being fixed or feature implemented
Cache population for old quorums is a cpu heavy operation and should be
avoided for inactive quorums _at least_ oin `ScanQuorums`. This issue is
critical for testnet and other small network because every mn
participate in almost every platform quorum and cache population for 2
months of quorums can easily block everything for 15+ minutes on a 4 cpu
node. On mainnet quorum distribution is much better but it's still a
small waste of cpu (or not so small for unlucky nodes).

#5761 follow-up

## What was done?
Do not start cache population for outdated quorums, improve logs in
`StartCachePopulatorThread` to make it easier to see what's going on.

## How Has This Been Tested?
run a mn on testnet

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-12-22 13:56:43 -06:00
PastaPastaPasta
9bdb7464a1
Merge pull request #5762 from knst/bitcoinserver-15639-p2
refactor: pull libbitcoin_server (governance) code out of wallet code 4/N
2023-12-21 23:05:12 -06:00
Konstantin Akimov
b2ad5302ce
refactor: simplify comparator in rpc/governance 2023-12-21 23:04:44 -06:00
Konstantin Akimov
4083fff0b2
refactor: drop circular dependency governance/object <-> governance/validators 2023-12-21 23:04:43 -06:00
Konstantin Akimov
2bb6361dc0
cleanup: removed unused definitions from governance/object.h 2023-12-21 23:04:43 -06:00
Konstantin Akimov
7e13727738
refactor: drop circular dependency validationinterface <-> governance/object 2023-12-21 23:04:43 -06:00
Konstantin Akimov
4de30f4b61
refactor: a default constructor for Governance::Object 2023-12-21 23:04:42 -06:00
Konstantin Akimov
64a153d634
refactor: untie governance/object and wallet implementation 2023-12-21 23:04:40 -06:00
PastaPastaPasta
78a69043c6
Merge pull request #5753 from knst/refactor-llmq_vbc
refactor: drop usages of llmq/utils to check if hard-fork is active
2023-12-21 23:03:12 -06:00
Konstantin Akimov
42e65f4541 chore: remaining TODO goes to other PRs 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c3c9ccf261 refactor: drop global variable fDIP0001ActiveAtTip - partial implementation
Impossible to drop it completelly right now because:
 - net doesn't know any details about chain - can't check status of fork
 - the functional test feature_maxuploadtarget.py assume block size 1Mb
 - DIP0001 can't be activated from regtest early block2 because big txes are
 not allowed after DIP0001

refactor: drop global variable fDIP0001ActiveAtTip - attempt 2
2023-12-21 23:02:31 -06:00
Konstantin Akimov
1b3237d147 fix: remove unused cs_main lock from src/miner.cpp - it's not used by EHF logic anymore 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f57859f777 refactor: drop llmq_versionbitscache in favor of g_versionbitscache
Note: g_versionbitscache is reset in UnloadBlockIndex()
2023-12-21 23:02:31 -06:00
Konstantin Akimov
917089d542 refactor: drop public llmq::utils::IsV20Active method 2023-12-21 23:02:31 -06:00
Konstantin Akimov
bc0f0bf852 chore: removed TODO for TESTNET_LLMQ_25_67_ACTIVATION_HEIGHT so far as have no idea why it is not matching with v19 activation 2023-12-21 23:02:31 -06:00
Konstantin Akimov
70fa626381 refactor: drop dependency validation on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
db4379348c refactor: drop dependency miner on llmq::utils::IsV20Active 2023-12-21 23:02:31 -06:00
Konstantin Akimov
5d4b16a783 refactor: drop public method llmq::utils::IsV19Active 2023-12-21 23:02:31 -06:00
Konstantin Akimov
55abf7fa8d refactor: drop dependency test/evo_deterministicmns_tests on llmq::utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
ad4d753bd7 refactor: use DeploymentActiveAfter in llmq/blockprocessor 2023-12-21 23:02:31 -06:00
Konstantin Akimov
1ed7f0cca4 refactor: use DeploymentActiveAfter instead llmq::utils in rpc/ 2023-12-21 23:02:31 -06:00
Konstantin Akimov
39dc612eee refactor: drop dependency test/util/setup_common on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c4d634c051 refactor: use DeploymentActiveAfter in init.cpp 2023-12-21 23:02:31 -06:00
Konstantin Akimov
7bce9d8209 refactor: use CFinalCommitment::GetVersion in llmq/{commitment,dkgsession} 2023-12-21 23:02:31 -06:00
Konstantin Akimov
9aa437115a refactor: use DeploymentActiveAfter in evo/mnauth 2023-12-21 23:02:31 -06:00
Konstantin Akimov
2128d58b4f refactor: use DeploymentActiveAfter in cbtx 2023-12-21 23:02:31 -06:00
Konstantin Akimov
488c895a65 refactor: use DeploymentActiveAfter in ehf_signals 2023-12-21 23:02:31 -06:00
Konstantin Akimov
377d929edc refactor: drop dependency evo/simplifiedmns on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c742b9acf5 refactor: drop unused llmq::utils::IsMNRewardReallocationActive 2023-12-21 23:02:31 -06:00
Konstantin Akimov
a79aa56d9b refactor: move out helper IsDIP3Enforced from deterministicmns 2023-12-21 23:02:31 -06:00
Konstantin Akimov
5a84eb0f0a refactor: drop default value from IsDIP3Enforced() 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f7274c450b refactor: use deployment status in deterministicmns instead llmq's helpers 2023-12-21 23:02:31 -06:00
Konstantin Akimov
13adedb423 refactor: move common code in deterministicmns to the helper 2023-12-21 23:02:31 -06:00
Konstantin Akimov
251a89736d refactor: rename argument pindex to pindexPrev in GetMNPayee and GetProjectedMNPayees 2023-12-21 23:02:31 -06:00
Konstantin Akimov
82c01ea664 refactor: drop dependency creditpool on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
e94f5753c9 refactor: drop dependency of specialtxman on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
bacaa805ea fix: use proper pindex/pindex->pprev in credit pool code during v20/mn_rr activations 2023-12-21 23:02:31 -06:00