profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/fanquake/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Michael Ford fanquake Australia Bitcoin Core Maintainer. Also write software for precision agriculture 🚜

fanquake/core-review 61

Scripts, tools & info for doing Bitcoin Core development and code review

fanquake/bitcoin 6

Bitcoin integration/staging tree

fanquake/CoreRPC 6

Swift wrapper for the Bitcoin Core RPC

fanquake/autotools 3

Repository for demonstrating autotools usage. Also useful for tracking down and debugging build system issues.

fanquake/elf-reader 2

Swift 5 based ELF parser (WIP)

fanquake/gitian-builder 1

Build packages in a secure deterministic fashion inside a VM

fanquake/gitian.sigs 1

Trusted Build Process signatures

fanquake/apple-sdk-tools 0

Maintainer Wanted: python tools for extracting Apple xcode/sdk files

pull request commentbitcoin-core/gui

rpc: Do not accept command while executing another one

Wait @hebasto, a bit off topic, should I have had to make actual GitHub review in this interface, or comment is enough? Maybe sticking to always checking all files and producing GitHub review would be "better"?

hebasto

comment created time in a few seconds

pull request commentbitcoin-core/gui

rpc: Do not accept command while executing another one

re-utACK 716139584ddf7ef554962e0188ae8b8a74e310e4, range-diff does not show anything to actually review or test.

hebasto

comment created time in 2 minutes

pull request commentbitcoin/bitcoin

rpc: getblockfrompeer

Yes, I imagine it'd use the "background' fetching logic in SendMessages, not the direct fetch in response to an announcement one.

Sjors

comment created time in 16 minutes

push eventbitcoin/bitcoin

João Barbosa

commit sha 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842

refactor: Replace memset calls with array initialization

view details

W. J. van der Laan

commit sha b34bf2b42caaee7c8714c1229e877128916d914a

Merge bitcoin/bitcoin#21939: refactor: Replace memset calls with array initialization 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842 refactor: Replace memset calls with array initialization (João Barbosa) Pull request description: Follow up to https://github.com/bitcoin/bitcoin/pull/21905#pullrequestreview-657045699. ACKs for top commit: laanwj: re-ACK 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842 Crypt-iQ: Code review ACK 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842 Tree-SHA512: 4b61dec2094f4781ef1c0427ee3bda3cfea12111274eebc7bc40a84f261d9c1681dd0860c57200bea2456588e44e8e0aecd18545c25f1f1250dd331ab7d05f28

view details

push time in 20 minutes

PR merged bitcoin/bitcoin

refactor: Replace memset calls with array initialization Refactoring

Follow up to https://github.com/bitcoin/bitcoin/pull/21905#pullrequestreview-657045699.

+5 -14

5 comments

2 changed files

promag

pr closed time in 21 minutes

push eventbitcoin-core/gui

João Barbosa

commit sha 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842

refactor: Replace memset calls with array initialization

view details

W. J. van der Laan

commit sha b34bf2b42caaee7c8714c1229e877128916d914a

Merge bitcoin/bitcoin#21939: refactor: Replace memset calls with array initialization 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842 refactor: Replace memset calls with array initialization (João Barbosa) Pull request description: Follow up to https://github.com/bitcoin/bitcoin/pull/21905#pullrequestreview-657045699. ACKs for top commit: laanwj: re-ACK 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842 Crypt-iQ: Code review ACK 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842 Tree-SHA512: 4b61dec2094f4781ef1c0427ee3bda3cfea12111274eebc7bc40a84f261d9c1681dd0860c57200bea2456588e44e8e0aecd18545c25f1f1250dd331ab7d05f28

view details

push time in 21 minutes

pull request commentbitcoin/bitcoin

build: Fix undefined reference to __mulodi4

The steps to reproduce from https://github.com/bitcoin/bitcoin/pull/21920#issue-641280284 can be used here as well

hebasto

comment created time in 26 minutes

pull request commentbitcoin/bitcoin

rpc: getblockfrompeer

In practice I'm already able to use this PR to fetch stale blocks by simply looping over my peers and "spamming" them all. I then disconnect if the block doesn't show up, connect to random new peers and then try again.

So although the current incarnation is not ideal, it's already useful. A revamp of ProcessHeadersMessage with a separate block download manager sounds doesn't sound easy to me. It also needs different timeout rules than IBD, because most of the time a peer won't have the block.

The use case of re-fetching pruned blocks is more similar to IBD, since you can expect every non-pruned node with sufficiently high pindexLastCommonBlock to have it.

Sjors

comment created time in 33 minutes

pull request commentbitcoin/bitcoin

rpc: getblockfrompeer

@Sjors Sure, but that doesn't sound too hard to add. And doing it that way sounds a lot more useful.

Sjors

comment created time in an hour

pull request commentbitcoin/bitcoin

rpc: getblockfrompeer

@sipa the current block fetching logic is buried deep inside net_processing. A MSG_BLOCK is generated when processing received headers:

https://github.com/bitcoin/bitcoin/blob/4741aec1dd28829f45abcc529cddaa0ff04d07a0/src/net_processing.cpp#L2011-L2021

Or when receiving a block: https://github.com/bitcoin/bitcoin/blob/4741aec1dd28829f45abcc529cddaa0ff04d07a0/src/net_processing.cpp#L1733-L1739

There doesn't seem to be a queue of blocks to fetch that's distributed over peers and checked in a background process.

Sjors

comment created time in an hour

pull request commentbitcoin/bitcoin

refactor: Replace memset calls with array initialization

Looking at the code I noticed both pchCommand, pchMessageStart are char arrays.

Another good point. There are only very few places where bare 'char' is a good choice. But let's leave it for a future PR.

promag

comment created time in an hour

pull request commentbitcoin/bitcoin

rpc: getblockfrompeer

Is it really necessary to make this specify which peer? It doesn't sound too hard to make the existing block fetching logic support extra requested blocks, I think.

Sjors

comment created time in an hour

Pull request review commentbitcoin/bitcoin

rpc: getblockfrompeer

 class PeerManagerImpl final : public PeerManager      /** Implement PeerManager */     void CheckForStaleTipAndEvictPeers() override;+    bool FetchBlock(NodeId id, uint256 hash, const CBlockIndex* index) override;

Added function documentation.

Sjors

comment created time in an hour

pull request commentbitcoin/bitcoin

Enable external signer support for GUI builds, reduce #ifdef

The Win64 machine is failing to build the fuzz executable: undefined reference toExternalSigner::GetDescriptors(int)'. It's configured with--disable-external-signer`, but that shouldn't matter...

Sjors

comment created time in an hour

pull request commentbitcoin/bitcoin

wallet: allow toggling external_signer flag

Great, thanks!

Sjors

comment created time in 2 hours

PR opened bitcoin/bitcoin

wallet: Fix issues when `walletdir` is root directory(Windows)
  • Remove one character less from wallet path

  • After testing lot of random strings with special chars in wallet_name, I found that the issue was not related to special characters in the name. Reviewing PR https://github.com/bitcoin/bitcoin/pull/21907 helped me resolve the issue.

Real issue: If the path mentioned in walletdir is a root directory for Windows, first character of the wallet name or path is removed

Solution: if statement to check walletdir is a root directory for Windows

Fixes: https://github.com/bitcoin/bitcoin/issues/21510 https://github.com/bitcoin/bitcoin/issues/21501 Related PR: https://github.com/bitcoin/bitcoin/pull/20080

Consider the wallet directories w1 and w2 saved in D:\. Results for listwalletdir

Before this PR:


{
  "wallets": [
    {
      "name": "1"
    },
    {
      "name": "2"
    }
  ]
}
 

After this PR:

  "wallets": [
    {
      "name": "w1"
    },
    {
      "name": "w2"
    }
  ]
}
 
+7 -1

0 comment

1 changed file

pr created time in 2 hours

pull request commentbitcoin/bitcoin

refactor: Replace memset calls with array initialization

I have a patchset to remove char, but haven't pushed it yet

promag

comment created time in 2 hours

pull request commentbitcoin/bitcoin

cli: Improve -getinfo return format

Got it! Thanks for sending it to me and replying to me so quickly. My apologies the amount was hardcoded by me and I added fewer decimal places than what it would actually have. Here is the updated screenshot of what it would look like when one wallet contains "longer" balance than others

image

And maybe we can omit the : after the balances Yeah I agree <balance> <wallet> makes more sense as <balance> does not act as a key/fieldname. Will update it

klementtan

comment created time in 2 hours

Pull request review commentbitcoin/bitcoin

net_processing: lock clean up

 class PeerManagerImpl final : public PeerManager     void SetBestHeight(int height) override { m_best_height = height; };     void Misbehaving(const NodeId pnode, const int howmuch, const std::string& message) override;     void ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRecv,-                        const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc) override;+                        const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc) override LOCKS_EXCLUDED(m_mutex_message_handling);  private:+    /** Message handling mutex.+     *  Message processing is single-threaded, so anything only accessed+     *  by ProcessMessage(s) or SendMessages can be guarded by this mutex,+     *  which guarantees it's only accessed by a single thread.+     */+    Mutex m_mutex_message_handling;

If it is single-threaded, then we don't need to guard anything with a mutex?

It looks to me that PeerManagerImpl::m_mutex_message_handling is useless because it is only being acquired from a single thread. No two threads are ever going to race to acquire it at the same time:

ThreadMessageHandler() // there is just one thread executing this
   ProcessMessages()
       ...
       lock m_mutex_message_handling
       ...
   ...
   SendMessages()
       ...
       lock m_mutex_message_handling
       ...

I may be missing something but to me it looks like m_mutex_message_handling can be removed safely, which will reduce the complexity of the code.

ajtowns

comment created time in 2 hours

pull request commentbitcoin/bitcoin

refactor: Mark CAddrMan::Select const

<!--e57a25ab6845829454e8d69fc972939a-->

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

<!--174a7506f384e20aa4161008e828411d-->

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #21843 (p2p, rpc: enable GetAddr, GetAddresses, and getnodeaddresses by network by jonatack)
  • #20233 (addrman: Make consistency checks a runtime option by jnewbery)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

MarcoFalke

comment created time in 2 hours

pull request commentbitcoin/bitcoin

fuzz: Call const member functions in addrman fuzz test only once

<!--e57a25ab6845829454e8d69fc972939a-->

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

<!--174a7506f384e20aa4161008e828411d-->

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #21843 (p2p, rpc: enable GetAddr, GetAddresses, and getnodeaddresses by network by jonatack)
  • #20233 (addrman: Make consistency checks a runtime option by jnewbery)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

MarcoFalke

comment created time in 2 hours

pull request commentbitcoin/bitcoin

doc: update enumerator naming in developer notes

I don't have a strong opinion (on my own I'd probably use lowercase_underscore (snake_case) with scoped enums as AFAICT it's widely used nowadays) but I think the important thing is to say which naming to use and to clarify if our choice is different from the CPP Core Guidelines so people aren't confused on which style to use.

Again just an opinion to throw in the mix, but I like CONSTANT<<3/2 to emphasize unchangedness of expressions when enums are used as collections of constants in bitwise or arithmetic code, and I like Confused NotConfused NotConfusedAndHungry ConfusedButSleepy for readability of english words in logical / event-handling code that more closely resembles natural language. I would not want to codify this and think it's fine to have guidelines that say there is no rule, and please do what seems appropriate.

jonatack

comment created time in 2 hours

pull request commentbitcoin/bitcoin

docs: improve make with parallel jobs description.

<!--e57a25ab6845829454e8d69fc972939a-->

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

<!--174a7506f384e20aa4161008e828411d-->

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #20610 (doc: update for NetBSD 9.1, add GUI Build Instructions by jarolrod)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

klementtan

comment created time in 2 hours

pull request commentbitcoin/bitcoin

docs: improve make with parallel jobs description.

ACK, agree that this is a clearer wording.

klementtan

comment created time in 2 hours

pull request commentbitcoin/bitcoin

Dedup and RAII-fy the creation of a copy of CConnman::vNodes

<!--e57a25ab6845829454e8d69fc972939a-->

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

<!--174a7506f384e20aa4161008e828411d-->

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #21878 (Make all networking code mockable by vasild)
  • #21527 (net_processing: lock clean up by ajtowns)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

vasild

comment created time in 2 hours

pull request commentbitcoin/bitcoin

refactor: Replace memset calls with array initialization

Code review ACK 1c9255c7dd2d4f12bfb508bcc8d123a6354d8842

Looking at the code I noticed both pchCommand, pchMessageStart are char arrays. There is a memcpy done from MessageStartChars (unsigned char array) to pchMessageStart, and some architectures specify char as signed. May be a case for explicitly making them unsigned char arrays?

promag

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

refactor: Replace memset calls with array initialization

 const static std::string allNetMessageTypes[] = { }; const static std::vector<std::string> allNetMessageTypesVec(std::begin(allNetMessageTypes), std::end(allNetMessageTypes)); -CMessageHeader::CMessageHeader()-{-    memset(pchMessageStart, 0, MESSAGE_START_SIZE);-    memset(pchCommand, 0, sizeof(pchCommand));-    memset(pchChecksum, 0, CHECKSUM_SIZE);-}- CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn)

We could also change the type here to std::string or std::span instead of a loose pointer, at some point and clean up the loop (oh and rename the argument to message_type maybe instead of command, when we're at it). No need to do so in this PR though.

promag

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

rpc: getblockfrompeer

 class PeerManagerImpl final : public PeerManager      /** Implement PeerManager */     void CheckForStaleTipAndEvictPeers() override;+    bool FetchBlock(NodeId id, uint256 hash, const CBlockIndex* index) override;

Maybe document that index may be null here?

Sjors

comment created time in 3 hours

Pull request review commentbitcoin/bitcoin

rpc: getblockfrompeer

 class PeerManagerImpl final : public PeerManager      /** Implement PeerManager */     void CheckForStaleTipAndEvictPeers() override;+    bool FetchBlock(NodeId id, uint256 hash, const CBlockIndex* index) override;

Consider passing uint256 by const reference (to avoid unnecessary copying, generally only basic types should be passed by value).

Sjors

comment created time in 3 hours

pull request commentbitcoin/bitcoin

cli: Improve -getinfo return format

Sent you some signet coins (wow, the faucet used to be 10 sBTC and now it's max .01). Thanks for updating! Looking pretty good. I think the balances alignment should based on the decimal point (apologies, I was unclear) which might require padding spaces after the balance as well if there are fewer than 8 digits after the decimal point (I thought there were always 8). And maybe we can omit the : after the balances. WDYT? I'll re-test soon.

klementtan

comment created time in 3 hours