-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coinbase maturity part 2 #160
Conversation
Update coinbase maturity
coinbase maturity
@beggsdl thanks for identifying the issue and @Jongjan88 thanks for preparing this PR. :) |
Thanks @Jongjan88 for creating this. I think it is important for this PR to get merged along with PR 157 before RC3. |
Both your contributions are greatly appreciated! |
Were there any other places where COINBASE_MATURITY needed fixing? |
I have a long list of files related to tests that I feel need to be addressed. I need to finish going through another set of files to finalize my list. I can add that as a separate Issue once I am done, hopefully in the next day or so. What's confusing is that the tests use COINBASE_MATURITY (8) and COINBASE_MATURITY_ORIGINAL (100). Other than the list I am creating, I think COINBASE_MATURITY is addressed everywhere. |
This PR addresses #161 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cACK. Great work. I would want the blessings of @gto90 and @JaredTate before any merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. This PR looks great! Code compiles & client runs. Thanks for doing this @Jongjan88 Awesome work!
Can someone check this code to make sure it does not need to be addressed also? Need to make sure this doesn't need to be changed too. digibyte/src/bench/block_assemble.cpp Lines 26 to 36 in e8247b0
|
We can change the 130 to 200. Great find, although we can have a discussion on what is the appropriate # here. 200 is the default for BTC. This is all in the bench folder, which is for benchmarking. Benchmarking is something I have never used/ done and it is not complete for the entire protocol. DGB codebase has never been even configured for benchmarking in the code. This benchmarking code can help us performance test parts of code and have performance data, but it's nothing essential for core protocol and consensus. More benchmarking info here:https://github.com/DigiByte-Core/digibyte/blob/develop/doc/benchmarking.md BenchmarkingDigiByte Core has an internal benchmarking framework, with benchmarks RunningFor benchmarking, you only need to compile
After compiling digibyte-core, the benchmarks can be run with:
|
Thanks for the clarification on that @JaredTate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With one minor formatting fix I think I am prepared to give this a cACK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. Thank you to everyone for your help on this! Will be great to get this tested on testnet. This code compiles & runs fine for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cACK. Good find @gto90! Thanks for everyone's efforts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cACK
Thank you all for your generous contributions!
Problem found by @beggsdl
beggsdl: I did this testing by solo mining to my core wallet. Here is a screenshot of the patched v8 wallet confirming a coinbase TX:
beggsdl: Here is that same coinbase TX in the 7.17.3 wallet:
beggsdl: The transaction detail screen in v8 says it needs to mature for 101 blocks before being spent, but you can see in the Status and Credit, that it is only confirming for 9.
beggsdl: This then affects the Immature and Available balances in the v8 wallet (top) compared to the v7 wallet (bottom):
beggsdl: I was then able to try to prematurely spend (before 100 confirmations) some of the coinbase TX from the v8 wallet (the v7 wallet did not allow me to do this due to insufficient funds):
beggsdl: This 50 DGB transaction is now stuck in mempool of the v8 wallet, even 17 hours after being created.
@JaredTate "It looks like there might be a couple of other places where COINBASE_MATURITY_2 needs added properly to fix the issue as @beggsdl mentioned above."
txmempool.cpp
wallet.cpp
#157 (comment)
With this pr. Generated coins must mature 101 blocks before they can be spent.