profile
viewpoint

NicolasDorier/BCCSpliter 57

A command line utility to send split BTC from your BCC

LedgerHQ/ledger-dotnet-api 42

.NET API for Ledger

btcpayserver/btcTransmuter 39

A self-hosted ,modular IFTTT-inspired system for bitcoin services written in C#

dgarage/hack0-armbian 15

Armbian image to create a plug and play Raspberry PI with BTCPayServer on it

NicolasDorier/bips 7

Bitcoin Improvement Proposals

dgarage/hack0-hardware 6

Documentation of hack0 hardware

NicolasDorier/btcpayserver 3

A cross platform, self-hosted server compatible with Bitpay API

BSafe-network/bitcoin 2

Bitcoin Core integration/staging tree

NicolasDorier/BIPxDevs 2

A website to diminish the noise of blocksize debate

Pull request review commentbitcoin/bitcoin

[refactor] Move some net_processing globals into PeerManagerImpl

 static void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman& connma     } } -static bool TipMayBeStale(const Consensus::Params &consensusParams) EXCLUSIVE_LOCKS_REQUIRED(cs_main)+bool PeerManagerImpl::TipMayBeStale() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {     AssertLockHeld(cs_main);-    if (g_last_tip_update == 0) {-        g_last_tip_update = GetTime();+    const Consensus::Params& consensusParams = m_chainparams.GetConsensus();+    if (m_last_tip_update == 0) {+        m_last_tip_update = GetTime();

Now that m_last_tip_update isn't a global and can be initialized at the time that PeerManagerImpl is constructed, consider initializing it to GetTime() in the initializer list and removing this special casing.

ajtowns

comment created time in an hour

Pull request review commentbitcoin/bitcoin

[refactor] Move some net_processing globals into PeerManagerImpl

 namespace {      * We use this to avoid requesting transactions that have already been      * confirnmed.      */-    Mutex g_cs_recent_confirmed_transactions;-    std::unique_ptr<CRollingBloomFilter> g_recent_confirmed_transactions GUARDED_BY(g_cs_recent_confirmed_transactions);--    /** Blocks that are in flight, and that are in the queue to be downloaded. */-    struct QueuedBlock {-        uint256 hash;-        const CBlockIndex* pindex;                               //!< Optional.-        bool fValidatedHeaders;                                  //!< Whether this block has validated headers at the time of request.-        std::unique_ptr<PartiallyDownloadedBlock> partialBlock;  //!< Optional, used for CMPCTBLOCK downloads-    };-    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> > mapBlocksInFlight GUARDED_BY(cs_main);--    /** Stack of nodes which we have set to announce using compact blocks */-    std::list<NodeId> lNodesAnnouncingHeaderAndIDs GUARDED_BY(cs_main);--    /** Number of preferable block download peers. */-    int nPreferredDownload GUARDED_BY(cs_main) = 0;--    /** Number of peers from which we're downloading blocks. */-    int nPeersWithValidatedDownloads GUARDED_BY(cs_main) = 0;+    Mutex m_cs_recent_confirmed_transactions;+    std::unique_ptr<CRollingBloomFilter> m_recent_confirmed_transactions GUARDED_BY(m_cs_recent_confirmed_transactions); -    /** Number of peers with wtxid relay. */-    int g_wtxid_relay_peers GUARDED_BY(cs_main) = 0;+    bool MarkBlockAsReceived(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main);+    bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr, std::list<QueuedBlock>::iterator** pit = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main);+    bool TipMayBeStale() EXCLUSIVE_LOCKS_REQUIRED(cs_main);+    void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller) EXCLUSIVE_LOCKS_REQUIRED(cs_main); -    /** Number of outbound peers with m_chain_sync.m_protect. */-    int g_outbound_peers_with_protect_from_disconnect GUARDED_BY(cs_main) = 0;+    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> > mapBlocksInFlight GUARDED_BY(cs_main);      /** When our tip was last updated. */-    std::atomic<int64_t> g_last_tip_update(0);+    std::atomic<int64_t> m_last_tip_update{0};++    CTransactionRef FindTxForGetData(const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main);

Move function comment to the declaration.

ajtowns

comment created time in an hour

Pull request review commentbitcoin/bitcoin

[refactor] Move some net_processing globals into PeerManagerImpl

 namespace {      * We use this to avoid requesting transactions that have already been      * confirnmed.      */-    Mutex g_cs_recent_confirmed_transactions;-    std::unique_ptr<CRollingBloomFilter> g_recent_confirmed_transactions GUARDED_BY(g_cs_recent_confirmed_transactions);--    /** Blocks that are in flight, and that are in the queue to be downloaded. */-    struct QueuedBlock {-        uint256 hash;-        const CBlockIndex* pindex;                               //!< Optional.-        bool fValidatedHeaders;                                  //!< Whether this block has validated headers at the time of request.-        std::unique_ptr<PartiallyDownloadedBlock> partialBlock;  //!< Optional, used for CMPCTBLOCK downloads-    };-    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> > mapBlocksInFlight GUARDED_BY(cs_main);--    /** Stack of nodes which we have set to announce using compact blocks */-    std::list<NodeId> lNodesAnnouncingHeaderAndIDs GUARDED_BY(cs_main);--    /** Number of preferable block download peers. */-    int nPreferredDownload GUARDED_BY(cs_main) = 0;--    /** Number of peers from which we're downloading blocks. */-    int nPeersWithValidatedDownloads GUARDED_BY(cs_main) = 0;+    Mutex m_cs_recent_confirmed_transactions;+    std::unique_ptr<CRollingBloomFilter> m_recent_confirmed_transactions GUARDED_BY(m_cs_recent_confirmed_transactions); -    /** Number of peers with wtxid relay. */-    int g_wtxid_relay_peers GUARDED_BY(cs_main) = 0;+    bool MarkBlockAsReceived(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main);+    bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr, std::list<QueuedBlock>::iterator** pit = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main);+    bool TipMayBeStale() EXCLUSIVE_LOCKS_REQUIRED(cs_main);+    void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller) EXCLUSIVE_LOCKS_REQUIRED(cs_main);

Move the function comments to the declarations now that these are declared separately from the function definition.

ajtowns

comment created time in an hour

Pull request review commentbitcoin/bitcoin

[refactor] Move some net_processing globals into PeerManagerImpl

 namespace {      * We use this to avoid requesting transactions that have already been      * confirnmed.      */-    Mutex g_cs_recent_confirmed_transactions;-    std::unique_ptr<CRollingBloomFilter> g_recent_confirmed_transactions GUARDED_BY(g_cs_recent_confirmed_transactions);--    /** Blocks that are in flight, and that are in the queue to be downloaded. */-    struct QueuedBlock {-        uint256 hash;-        const CBlockIndex* pindex;                               //!< Optional.-        bool fValidatedHeaders;                                  //!< Whether this block has validated headers at the time of request.-        std::unique_ptr<PartiallyDownloadedBlock> partialBlock;  //!< Optional, used for CMPCTBLOCK downloads-    };-    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> > mapBlocksInFlight GUARDED_BY(cs_main);--    /** Stack of nodes which we have set to announce using compact blocks */-    std::list<NodeId> lNodesAnnouncingHeaderAndIDs GUARDED_BY(cs_main);--    /** Number of preferable block download peers. */-    int nPreferredDownload GUARDED_BY(cs_main) = 0;--    /** Number of peers from which we're downloading blocks. */-    int nPeersWithValidatedDownloads GUARDED_BY(cs_main) = 0;+    Mutex m_cs_recent_confirmed_transactions;

Since you're already renaming this, consider dropping the outdated cs naming. Perhaps m_recent_confirmed_transactions_mutex?

ajtowns

comment created time in an hour

Pull request review commentbitcoin/bitcoin

[refactor] Move some net_processing globals into PeerManagerImpl

 namespace {      */     std::map<uint256, std::pair<NodeId, bool>> mapBlockSource GUARDED_BY(cs_main);

Perhaps rename this to m_block_sources?

ajtowns

comment created time in an hour

Pull request review commentbitcoin/bitcoin

[refactor] Move some net_processing globals into PeerManagerImpl

 class PeerManagerImpl final : public PeerManager      * their own locks.      */     std::map<NodeId, PeerRef> m_peer_map GUARDED_BY(m_peer_mutex);-};-} // namespace -namespace {     /** Number of nodes with fSyncStarted. */     int nSyncStarted GUARDED_BY(cs_main) = 0;

You're renaming the other data members as you move them into PeerManagerImpl. Perhaps rename this to m_sync_started?

ajtowns

comment created time in an hour

pull request commentbitcoin/bitcoin

build: fix linking against -latomic when building for riscv

Testing this. Doing a compile on the SiFive Unleashed is a bit slow, so give it some time.

Master without this PR:

configure:5619: checking whether std::atomic can be used without link library
configure:5637: g++ -std=c++17 -o conftest -g -O2   conftest.cpp  >&5
configure:5637: $? = 0
configure:5639: result: yes

Now trying a build of master to see if it fails. Will then try with this PR.

fanquake

comment created time in an hour

Pull request review commentbitcoin/bitcoin

Implement Bech32m and use it for v1+ segwit addresses

  #include <stdint.h> #include <string>+#include <tuple> #include <vector>  namespace bech32 { -/** Encode a Bech32 string. If hrp contains uppercase characters, this will cause an assertion error. */-std::string Encode(const std::string& hrp, const std::vector<uint8_t>& values);+enum class Encoding {+    INVALID, -/** Decode a Bech32 string. Returns (hrp, data). Empty hrp means failure. */-std::pair<std::string, std::vector<uint8_t>> Decode(const std::string& str);+    BECH32,  //! Bech32 encoding as defined in BIP173+    BECH32M, //! Bech32m encoding as defined in bip-bech32m

Commit 6b28812881375311891e80c1d4e9df6aaa0b85d5

Perhaps too unorthodox, but it would theoretically be possible to do

   BECH32 = 1, //...
   BECH32M = 0x2bc830a3, // ...

and get rid of EncodingConstant. (But the amount of casting required is probably not worth it.)

sipa

comment created time in 2 hours

pull request commentbitcoin/bitcoin

doc: Update tor.md for notes on how to preserve v2 urls (with a not recommended note)

Thanks @nolim1t. Unless this change is backported to 0.21.1, by the time 22.0 (the next release) is out tor v2 will be EOL, so maybe the existing release notes are enough. It may be good to squash your commits down to one when you are finished.

Squashed into one. Yep I recognize that it may be deprecated too, hence not recommended mention

nolim1t

comment created time in 2 hours

pull request commentbitcoin/bitcoin

wallet: Add BerkeleyDB version sanity check at init time

@adamjonas whoops wrong aj :slightly_smiling_face:

laanwj

comment created time in 2 hours

Pull request review commentbitcoin/bitcoin

[Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex

 bool ChainstateManager::ProcessNewBlock(const CChainParams& chainparams, const s         bool ret = CheckBlock(*pblock, state, chainparams.GetConsensus());         if (ret) {             // Store to disk-            ret = ::ChainstateActive().AcceptBlock(pblock, state, chainparams, &pindex, fForceProcessing, nullptr, fNewBlock);+            ret = ActiveChainstate().AcceptBlock(pblock, state, chainparams, &pindex, fForceProcessing, nullptr, fNewBlock);         }         if (!ret) {             GetMainSignals().BlockChecked(*pblock, state);             return error("%s: AcceptBlock FAILED (%s)", __func__, state.ToString());         }     } -    NotifyHeaderTip();+    NotifyHeaderTip(ActiveChainstate());      BlockValidationState state; // Only used to report errors, not invalidity - ignore it-    if (!::ChainstateActive().ActivateBestChain(state, chainparams, pblock))+    if (!ActiveChainstate().ActivateBestChain(state, chainparams, pblock))         return error("%s: ActivateBestChain failed (%s)", __func__, state.ToString());      return true; } -bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot)+bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainparams, CChainState& chainstate, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot)

Same comment as for the declaration. Consider splitting this line.

dongcarl

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

[Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex

 static RPCHelpMan generateblock()         LOCK(cs_main);          BlockValidationState state;-        if (!TestBlockValidity(state, chainparams, block, LookupBlockIndex(block.hashPrevBlock), false, false)) {+        if (!TestBlockValidity(state, chainparams, ::ChainstateActive(), block, g_chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock), false, false)) {

Any reason not to just jump straight to using EnsureChainman(request.context) in all the rpc methods that you're touching here?

dongcarl

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

[Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex

 struct ChainTxData; struct DisconnectedBlockTransactions; struct PrecomputedTransactionData; struct LockPoints;+struct CCheckpointData;

No need for this forward declaration. You're including chainparams.h, which is where this is included.

dongcarl

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

[Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex

 bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex); bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true, bool fCheckMerkleRoot = true);  /** Check a block is completely valid from start to finish (only works on top of our current best block) */-bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true) EXCLUSIVE_LOCKS_REQUIRED(cs_main);+bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainparams, CChainState& chainstate, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true) EXCLUSIVE_LOCKS_REQUIRED(cs_main);

I find these very long lines almost impossible to read. If you touch this branch again, could you be convinced to split it up. Something like:

bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainparams,
                       CChainState& chainstate, const CBlock& block, CBlockIndex* pindexPrev,
                       bool fCheckPOW = true, bool fCheckMerkleRoot = true)
    EXCLUSIVE_LOCKS_REQUIRED(cs_main);
dongcarl

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

[Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex

 void CTxMemPool::check(const CCoinsViewCache *pcoins) const     uint64_t innerUsage = 0;      CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins));-    const int64_t spendheight = GetSpendHeight(mempoolDuplicate);+    const int64_t spendheight = WITH_LOCK(::cs_main, return g_chainman.m_blockman.GetSpendHeight(mempoolDuplicate));

The lock ordering is to take cs_main then take mempool.cs so at first glance, this looks like a lock inversion since it's locking cs_main while already holding mempool.cs. In fact, whenever mempool.check() is called, we're already holding cs_main (see the two call sites in net_processing).

I think it'd be better to add an EXCLUSIVE_LOCKS_REQUIRED(cs_main) annotation to check() and remove the re-entrant lock-taking here.

dongcarl

comment created time in 3 hours

issue commentbitcoin/bitcoin

Interface is unresponsive while syncing with bitcoin-qt 0.21.0

u might want to take a look at tyi.https://github.com/bitcoin-core/gui/issues/16

puchu

comment created time in 3 hours

pull request commentbitcoin/bitcoin

doc: Update tor.md for notes on how to preserve v2 urls (with a not recommended note)

Thanks @nolim1t. Unless this change is backported to 0.21.1, by the time 22.0 (the next release) is out tor v2 will be EOL, so maybe the existing release notes are enough. It may be good to squash your commits down to one when you are finished.

nolim1t

comment created time in 3 hours

pull request commentbitcoin/bitcoin

test: Fix get_previous_releases.py for aarch64

In what environment? Why CI jobs are ok?

aarch64. all of them because none of them use aarch64

MarcoFalke

comment created time in 3 hours

PR opened bitcoin/bitcoin

doc: Update tor.md for notes on how to preserve v2 urls (with a not recommended note)

Add the the text from the release notes to the actual documentation docs/tor.md to document how users can preserve their old address.

Just in case users would like for some reason to preserve their existing v2 address with a not recommended text.

+6 -0

0 comment

1 changed file

pr created time in 3 hours

pull request commentbitcoin/bitcoin

test: Fix get_previous_releases.py for aarch64

Otherwise it will fail with "Not sure which binary to download..."

In what environment? Why CI jobs are ok?

MarcoFalke

comment created time in 3 hours

issue openedbitcoin/bitcoin

Interface is unresponsive while syncing with bitcoin-qt 0.21.0

The interface gets unresponsive while syncing the blockchain.

It sometimes takes minutes until the interface recognises the user input

Expected behavior

The interface is responsive and 0.20.* didn't have this massive lagging

Actual behavior

the interface responds at least in a few seconds

To reproduce

start bitcoin-qt with a not fully synced blockchain

System information

Bitcoin 0.21.0 compiled from source

Linux KDE

created time in 4 hours

pull request commentbitcoin/bitcoin

refactor: split CWallet::Create

Thanks ryanofsky and achow101, I have a better understanding now and adjusted my PR accordingly:

  1. I removed the last commit and restored AttachChain call within CWallet::Create
  2. I made chain arg of CWallet::Create optional to accommodate wallet tool use-case

I kept the 3rd commit which moves chain related checks to AttachChain. This way we can have all chain related code in AttachChain method in alignment with what achow101 said. As a benefit we need to check if chain is passed into CWallet::Create only once.

Thanks for your reviews, I'm more satisfied with how this PR looks right now.

S3RK

comment created time in 4 hours

pull request commentbitcoin/bitcoin

rpc/validation: enable packages through testmempoolaccept

@ariard i think it is only intended to be a convenient way to sanity check for "static" standardness bounds, not for testing the whole validity prior to broadcast (which is intractable..).

glozow

comment created time in 4 hours

PR opened bitcoin/bitcoin

test: Fix get_previous_releases.py for aarch64

Otherwise it will fail with "Not sure which binary to download..."

+1 -0

0 comment

1 changed file

pr created time in 5 hours

pull request commentbitcoin/bitcoin

Add I2P support using I2P SAM

Concept ACK. Built and working with no major issues.

vasild

comment created time in 5 hours

issue commentbitcoin/bitcoin

CGminer can't connect over RPC on 0.20.0

I've tried using bfgminer but it reports the pool is down or invalid, using the same server settings that I use for cgminer. I'll keep checking into this, I was using cgminer since it was updated for my device. If anyone has any suggestions, I'd appreciate them.

Relaxo143

comment created time in 6 hours

Pull request review commentbitcoin/bitcoin

fuzz: Consolidate fuzzing TestingSetup initialization

 bool operator==(const Coin& a, const Coin& b)  void initialize_coins_view() {-    static const ECCVerifyHandle ecc_verify_handle;-    ECC_Start();-    SelectParams(CBaseChainParams::REGTEST);+    static const auto testing_setup = MakeFuzzingContext<const TestingSetup>();

why is it needed to spin up more than just ecc and params?

dongcarl

comment created time in 6 hours

pull request commentbitcoin/bitcoin

fuzz: Consolidate fuzzing TestingSetup initialization

Looks like an issue with your code. Could it mean that you destroyed some object twice?

dongcarl

comment created time in 6 hours

issue commentbtcpayserver/btcpayserver

Google safe browsing is tagging BTCPay Instances

https://gomox.medium.com/google-safe-browsing-can-kill-your-startup-7d73c474b98d

NicolasDorier

comment created time in 7 hours

issue commentbitcoin/bitcoin

Failed to start bitcoin daemon using Ubuntu 20.04

@blainerb4 Is this still a problem for you? I cannot replicate on an Ubuntu 20.04 VM

blainerb4

comment created time in 9 hours

more