Skip to content

Add fields for tracking package data#2

Open
schancel wants to merge 1 commit into
masterfrom
chains-for-real2
Open

Add fields for tracking package data#2
schancel wants to merge 1 commit into
masterfrom
chains-for-real2

Conversation

@schancel
Copy link
Copy Markdown
Collaborator

Summary:
Add additional fields to allow tracking package information

Depends on D2862

Test Plan:
make check

Tags: #mining

Summary:
Add additional fields to allow tracking package information

Depends on D2862

Test Plan:
  make check

Reviewers: O1 Bitcoin ABC!, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D2863
schancel pushed a commit that referenced this pull request Feb 8, 2020
…split keys after upgrading to hd chain split

Summary:
(commit #1)
Changes the maximum upgradewallet version to the latest wallet version
number, 190700. Non-HD wallets will be upgraded to use HD derivation.
Non HD chain split wallets will be upgraded to HD chain split.

(commit #2)
After upgrading to HD chain split, we want to continue to use keys
from the old keypool. To do this, before we generate any new keys after
upgrading, we mark all of the keypool entries as being pre-chain
split and move them to a separate pre chain split keypool. Keys are
fetched from that keypool until it is emptied. Only then are the new
internal and external keypools used.

Since upgradewallet is effectively run during a first run, all of the
first run initial setup stuff is combined with the upgrade to HD

Partial backport of Core PR12560 (3/4)
bitcoin/bitcoin@5c50e93
bitcoin/bitcoin@dfcd9f3

Depends on D4202

Test Plan:
Recommend to perform testing on `regtest` or else this process may take a very long time.
  make check
  ./bitcoind -upgradewallet
  ./bitcoin-cli getwalletinfo > preupgradewalletinfo
  ./bitcoin-cli generate 1
  Kill bitcoind
  ./bitcoind -printtoconsole -upgradewallet
bitcoind should output to console the two following lines:
  Performing wallet upgrade to 190700
  Upgrading wallet to use HD chain split
Compare previous `preupgradewalletinfo` with `./bitcoin-cli getwalletinfo` post upgrade

preupgradewalletinfo:
  {
    "walletname": "",
    "walletversion": 160300,
    "balance": 0.00000000,
    "unconfirmed_balance": 0.00000000,
    "immature_balance": 0.00000000,
    "txcount": 0,
    "keypoololdest": 1551725443,
    "keypoolsize": 1000,
    "keypoolsize_hd_internal": 1000,
    "paytxfee": 0.00000000,
    "hdmasterkeyid": "c13ec93790a56f74edd2da42d231317eb6dbf02b"
  }

post upgrade wallet info:
  {
    "walletname": "",
    "walletversion": 190700,
    "balance": 0.00000000,
    "unconfirmed_balance": 0.00000000,
    "immature_balance": 50.00000000,
    "txcount": 1,
    "keypoololdest": 1551725443,
    "keypoolsize": 1000,
    "keypoolsize_hd_internal": 1000,
    "paytxfee": 0.00000000,
    "hdmasterkeyid": "c13ec93790a56f74edd2da42d231317eb6dbf02b"
  }
The newly upgraded wallet should not be able to be downgraded to a previous version
  Kill bitcoind
  ./bitcoind -upgradewallet=160300
This should fail and cause `bitcoind` to shutdown with the following line:
  Error: Cannot downgrade wallet

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4206
schancel pushed a commit that referenced this pull request Feb 8, 2020
Summary:
In Bitcoin Core, virtual size has two meanings:

1. BIP 141 defines virtual size = weight/4 (rounded up), i.e. transaction size
  plus witness size divided by 4.
  (https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#additional-definitions )

2. Virtual size = max(weight, sigopscost*bytespersigop) / 4 rounded up, used in
  all mempool code to punish very very high sigops transactions.

Currently we have no code that uses meaning #2, but we do have some weird
backported code that uses meaning #1, which is definitely inappropriate
for BCH since we don't have segwit.

This diff removes that stuff and also removes the ability to ask for
virtual size in the BIP141 convention (without a sigops count), which is always
going to be a conceptual mistake in our codebase.

(see D3655 D3316 D3180 D3243)

Test Plan: `ninja all check bench-bitcoin`

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4895
schancel pushed a commit that referenced this pull request Aug 28, 2021
Summary:
Some Bitcoin activity is completely local (offline), e.g., reindexing.

The `setnetworkactive` RPC command is already present. This PR adds the corresponding command-line argument / config option, and allows to start the client with disabled p2p network by providing `-networkactive=0` or `-nonetworkactive`.

Commit message #1:
> net: Add -networkactive option
>
> The `setnetworkactive' RPC command is already present.
> This new option allows to start the client with disabled p2p network
> activity for testing or reindexing.

Commit message #2:
>net: Log network activity status change unconditionally

Commit message #3:
> test: Add test coverage for -networkactive option

This is a backport of [[bitcoin/bitcoin#19473 | core#19473]]

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9713
schancel pushed a commit that referenced this pull request Nov 20, 2021
Summary:
See https://build.bitcoinabc.org/viewLog.html?buildId=300891&guest=1 for a tsan race while running `interface_zmq.py`
```
 node0 stdout ==================
WARNING: ThreadSanitizer: data race (pid=10367)
  Read of size 8 at 0x7b2400030238 by thread T19:
    #0 memcpy <null> (bitcoind+0x2645a7)
    #1 <null> <null> (libzmq.so.5+0x76220)

  Previous write of size 8 at 0x7b2400030238 by thread T12:
    #0 malloc <null> (bitcoind+0x258ee4)
    #1 <null> <null> (libzmq.so.5+0x39578)
    #2 CZMQAbstractPublishNotifier::SendZmqMessage(char const*, void const*, unsigned long) /work/abc-ci-builds/build-tsan/../../src/zmq/zmqpublishnotifier.cpp:164:14 (bitcoind+0xa1e7a9)
    ...
0
  Location is heap block of size 140 at 0x7b2400030210 allocated by thread T12:
    #0 malloc <null> (bitcoind+0x258ee4)
    #1 <null> <null> (libzmq.so.5+0x39578)
    #2 CZMQAbstractPublishNotifier::SendZmqMessage(char const*, void const*, unsigned long) /work/abc-ci-builds/build-tsan/../../src/zmq/zmqpublishnotifier.cpp:164:14 (bitcoind+0xa1e7a9)
    ...

  Thread T19 'ZMQbg/1' (tid=10388, running) created by main thread at:
    #0 pthread_create <null> (bitcoind+0x25a7ab)
    #1 <null> <null> (libzmq.so.5+0x6e8b3)
    #2 CZMQNotificationInterface::Initialize() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:86:23 (bitcoind+0xa199d4)
    #3 CZMQNotificationInterface::Create() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:61:36 (bitcoind+0xa19328)
    #4 AppInitMain(Config&, RPCServer&, HTTPRPCRequestProcessor&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /work/abc-ci-builds/build-tsan/../../src/init.cpp:2482:36 (bitcoind+0x30d673)
    #5 AppInit(int, char**) /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:181:16 (bitcoind+0x2eaa8e)
    #6 main /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:208:13 (bitcoind+0x2eaa8e)

  Thread T12 'b-scheduler' (tid=10380, running) created by main thread at:
    #0 pthread_create <null> (bitcoind+0x25a7ab)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.67.0+0x1396a)
    #2 boost::thread::thread<std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)>&>(std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)>&) /usr/include/boost/thread/detail/thread.hpp:266:13 (bitcoind+0x330342)
    #3 boost::thread* boost::thread_group::create_thread<std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)> >(std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)>) /usr/include/boost/thread/detail/thread_group.hpp:79:60 (bitcoind+0x32039e)
    #4 AppInitMain(Config&, RPCServer&, HTTPRPCRequestProcessor&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /work/abc-ci-builds/build-tsan/../../src/init.cpp:2243:17 (bitcoind+0x309628)
    #5 AppInit(int, char**) /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:181:16 (bitcoind+0x2eaa8e)
    #6 main /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:208:13 (bitcoind+0x2eaa8e)

    #1 <null> <null> (libzmq.so.5+0x6e8b3)
    #2 CZMQNotificationInterface::Initialize() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:86:23 (bitcoind+0xa199d4)
    #3 CZMQNotificationInterface::Create() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:61:36 (bitcoind+0xa19328)
    #4 AppInitMain(Config&, RPCServer&, HTTPRPCRequestProcessor&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /work/abc-ci-builds/build-tsan/../../src/init.cpp:2482:36 (bitcoind+0x30d673)
    #5 AppInit(int, char**) /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:181:16 (bitcoind+0x2eaa8e)
```

This is a backport of [[bitcoin/bitcoin#20748 | core#20748]]

Test Plan:
With TSAN:
`for i in $(seq 100); do TSAN_OPTIONS=second_deadlock_stack=1: TSAN_OPTIONS=suppressions=/home/pierre/dev/bitcoin-abc/test/sanitizer_suppressions/tsan test/functional/test_runner.py interface_zmq; done`

This failure is intermittent, but relatively easy to reproduce: I was able to get it with 10 repetitions of the test, prior to adding the suppression.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10315
PiRK pushed a commit to PiRK/lotusd that referenced this pull request Aug 16, 2022
Summary:
See https://build.bitcoinabc.org/viewLog.html?buildId=300891&guest=1 for a tsan race while running `interface_zmq.py`
```
 node0 stdout ==================
WARNING: ThreadSanitizer: data race (pid=10367)
  Read of size 8 at 0x7b2400030238 by thread T19:
    #0 memcpy <null> (bitcoind+0x2645a7)
    givelotus#1 <null> <null> (libzmq.so.5+0x76220)

  Previous write of size 8 at 0x7b2400030238 by thread T12:
    #0 malloc <null> (bitcoind+0x258ee4)
    givelotus#1 <null> <null> (libzmq.so.5+0x39578)
    givelotus#2 CZMQAbstractPublishNotifier::SendZmqMessage(char const*, void const*, unsigned long) /work/abc-ci-builds/build-tsan/../../src/zmq/zmqpublishnotifier.cpp:164:14 (bitcoind+0xa1e7a9)
    ...
0
  Location is heap block of size 140 at 0x7b2400030210 allocated by thread T12:
    #0 malloc <null> (bitcoind+0x258ee4)
    givelotus#1 <null> <null> (libzmq.so.5+0x39578)
    givelotus#2 CZMQAbstractPublishNotifier::SendZmqMessage(char const*, void const*, unsigned long) /work/abc-ci-builds/build-tsan/../../src/zmq/zmqpublishnotifier.cpp:164:14 (bitcoind+0xa1e7a9)
    ...

  Thread T19 'ZMQbg/1' (tid=10388, running) created by main thread at:
    #0 pthread_create <null> (bitcoind+0x25a7ab)
    givelotus#1 <null> <null> (libzmq.so.5+0x6e8b3)
    givelotus#2 CZMQNotificationInterface::Initialize() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:86:23 (bitcoind+0xa199d4)
    givelotus#3 CZMQNotificationInterface::Create() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:61:36 (bitcoind+0xa19328)
    givelotus#4 AppInitMain(Config&, RPCServer&, HTTPRPCRequestProcessor&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /work/abc-ci-builds/build-tsan/../../src/init.cpp:2482:36 (bitcoind+0x30d673)
    givelotus#5 AppInit(int, char**) /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:181:16 (bitcoind+0x2eaa8e)
    givelotus#6 main /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:208:13 (bitcoind+0x2eaa8e)

  Thread T12 'b-scheduler' (tid=10380, running) created by main thread at:
    #0 pthread_create <null> (bitcoind+0x25a7ab)
    givelotus#1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.67.0+0x1396a)
    givelotus#2 boost::thread::thread<std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)>&>(std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)>&) /usr/include/boost/thread/detail/thread.hpp:266:13 (bitcoind+0x330342)
    givelotus#3 boost::thread* boost::thread_group::create_thread<std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)> >(std::_Bind<void (* (char const*, std::function<void ()>))(char const*, std::function<void ()>)>) /usr/include/boost/thread/detail/thread_group.hpp:79:60 (bitcoind+0x32039e)
    givelotus#4 AppInitMain(Config&, RPCServer&, HTTPRPCRequestProcessor&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /work/abc-ci-builds/build-tsan/../../src/init.cpp:2243:17 (bitcoind+0x309628)
    givelotus#5 AppInit(int, char**) /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:181:16 (bitcoind+0x2eaa8e)
    givelotus#6 main /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:208:13 (bitcoind+0x2eaa8e)

    givelotus#1 <null> <null> (libzmq.so.5+0x6e8b3)
    givelotus#2 CZMQNotificationInterface::Initialize() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:86:23 (bitcoind+0xa199d4)
    givelotus#3 CZMQNotificationInterface::Create() /work/abc-ci-builds/build-tsan/../../src/zmq/zmqnotificationinterface.cpp:61:36 (bitcoind+0xa19328)
    givelotus#4 AppInitMain(Config&, RPCServer&, HTTPRPCRequestProcessor&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /work/abc-ci-builds/build-tsan/../../src/init.cpp:2482:36 (bitcoind+0x30d673)
    givelotus#5 AppInit(int, char**) /work/abc-ci-builds/build-tsan/../../src/bitcoind.cpp:181:16 (bitcoind+0x2eaa8e)
```

This is a backport of [[bitcoin/bitcoin#20748 | core#20748]]

Test Plan:
With TSAN:
`for i in $(seq 100); do TSAN_OPTIONS=second_deadlock_stack=1: TSAN_OPTIONS=suppressions=/home/pierre/dev/bitcoin-abc/test/sanitizer_suppressions/tsan test/functional/test_runner.py interface_zmq; done`

This failure is intermittent, but relatively easy to reproduce: I was able to get it with 10 repetitions of the test, prior to adding the suppression.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant