MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.87k stars 846 forks source link

[Meta, Brainstorming] Sudden influx of new NBitcoin users #370

Closed nopara73 closed 6 years ago

nopara73 commented 6 years ago

It looks like NBitcoin growing quite quickly. While NBitcoin is great, it's outdated and has only one part time maintainer @NicolasDorier. This may not be sustainable in the future.

For example a low hanging fruit is that NBitcoin could benefit a lot from like reviewing and bringing over the countless bug fixes and improvements of @dangershony's NStratis, yet nobody has the time and financial motivation of do some general maintenance on the software.

Do you guys have ideas how can we tackle scaling?

For example maybe we (heavy users of NBitcoin) could together hire someone who does full time maintenance, tackling issues and non-controversial improvements and bug fixes.

@knocte @dangershony @NicolasDorier @lontivero @sgryphon @bokobza @wintercooled @Aprogiena @Neurosploit

Aprogiena commented 6 years ago

This is superhard topic. There are just too many projects and not enough people with good enough knowledge. In Stratis we are always looking for such people but they just don't exist. So it doesn't really matter whether you can pay them or not if they don't exist. Very few people can actually maintain something like NBitcoin.

So basically I think you're looking for someone as special as Nicolas, which means excellent knowledge of bitcoin protocol and no need to work on something not directly related to bitcoin. The size of this set is very small and then if you include the requirement of love for C# then you have not many people left, worldwide.

lontivero commented 6 years ago

I think some features need someone as special as Nicolas, however there are others that do not. Take a look at this git log output:

$ git log -n 20 --pretty=format:"%h - %an, %ar : %s"
9ebb8785 - Roman Zeyde, 9 hours ago : Add missing space at README.md (#368)
85da96c8 - NicolasDorier, 14 hours ago : Fix #367
f82b1fec - Lucas Ontivero, 2 days ago : Add invalidblock rpc hidden method (#366)
02a6e42b - NicolasDorier, 2 days ago : Add synchronization options to GetChain
5c71c272 - NicolasDorier, 2 days ago : Pass SkipPowCheck as SynchronizeChain argument instead of Node level setting
7487b0de - NicolasDorier, 2 days ago : Can deserialize and serialize ConcurrentChain without the headers
750415fa - NicolasDorier, 4 days ago : fix build
f29e5c00 - NicolasDorier, 4 days ago : Can strip header from ChainedBlock
2f9183e0 - NicolasDorier, 4 days ago : Do not eagerly calculate the chain work, and make it possible to strip cached data in ChainedBlock
9d900b0d - NicolasDorier, 6 days ago : Allow to skip PoW check at Node level and ChainBehavior level
ca681c18 - nopara73, 7 days ago : Create directory if doesn't exist (#356)
7ebc7320 - NicolasDorier, 12 days ago : Update bech32 prefix on regtest
82a4c4a8 - NicolasDorier, 13 days ago : Make getinfo obsolete
f6d07171 - NicolasDorier, 13 days ago : Change default port for RPC, fix #348
98d07c78 - NicolasDorier, 13 days ago : bump
6ae1452e - NicolasDorier, 13 days ago : Should fix #345
fc8503db - NicolasDorier, 2 weeks ago : add NODE_NETWORK_LIMITED
51e5cfa7 - NicolasDorier, 2 weeks ago : fix TraceSource for NetCore
54419805 - Richard Bondi, 2 weeks ago : grammar, verb not noun (#347)
f1dcd9a3 - NicolasDorier, 2 weeks ago : Allow extension point for logs in NBitcoin if System TraceSource is not supported

I'm sure at least half of those could be done be anyone who knows c#. The rest commits/issues need more time, test, knowledge and only a few require highly talented developers. Moreover, there are lots of improvements, features, examples, documentation and other very important things that could be done. For example, NBitcoin:

My point is that there are lots of things that can be done that don't require a genius. Of course, nobody's time is free and even when we try to help when we find (or need) something, I agree that this requires money, and when money come, people come for it.

Those that based their business on top of NBitcoin should be interested on supporting the project with some money (real life evidence doesn't support this idea, am I wrong?). That could be used for paying for solving issue, reporting bugs, etc.

NicolasDorier commented 6 years ago

NBitcoin outdated? What is missing?

nopara73 commented 6 years ago

@NicolasDorier It's not really about features, rather subtle issues like these lead to time consuming debugging once in a while:

NicolasDorier commented 6 years ago

Countless memory leaks (undisposed/unsubscribed stuff).

Where?

Bunch of blocking code (.Result, .Wait(), .GetAwaiter().GetResult().

Where? Such code normally always have Async equivalent. (Exception behing some stuff in the Node class like SynchronizeChain which should be easily possible to add)

Plentiful exception swallowing (empty catch blocks).

Where ?

CI on both Linux and OSX to catch the many untested cross platform issues.

Yep, would be great.

NicolasDorier commented 6 years ago

That said if anything is done in the Stratis fork which is generically useful, let me know, I will port it here.

nopara73 commented 6 years ago

Memory Leaks

Blocking Code

Exception Swallowing

dangershony commented 6 years ago

Stratis builds on top of NBitcoin but we also did add many new changes and improvements (for example the P2P code has been refactored and now looks very different) and so on, this is sort of duplicated effort as now NBitcoin maintains it's own version of P2P implementation and so on.

Stratis is still heavily dependent on NBitcoin (the version we forked from) for low level blockchain stuff and I would very much hope we could use the NBitcoin package as its maintained constantly by Nicolas but we can't unless we find a way to make changes to how blocks and transactions are serialized (stratis blocks and transactions have some extra data)

@NicolasDorier seems to be open to that idea where we can make NBitcoin a bit more flexible for changes that other alts need, if we can do that I will be very much open to reference again NBitcoin directly (and stop doing manual merges).

I would also suggest perhaps to break NBitcoin to multiple packages (for example there is no need to have spv wallet available when all you need is class primitives or Script).

nopara73 commented 6 years ago

I guess there is not enough intent to contribute to the underlying library, maybe reopen it in a few years. Nevertheless it was an informative discussion, I think.