Skip to content

V0.12.1.x governance pr - part 1 - base functionality - #944

Merged
schinzelh merged 21 commits into
dashpay:v0.12.1.xfrom
tgflynn:v0.12.1.x-governance-PR
Aug 17, 2016
Merged

V0.12.1.x governance pr - part 1 - base functionality#944
schinzelh merged 21 commits into
dashpay:v0.12.1.xfrom
tgflynn:v0.12.1.x-governance-PR

Conversation

@tgflynn

Copy link
Copy Markdown

No description provided.

This macro allows debugging statements (typically printf's or cout's) to
be activated or deactivated with a single comment. Uncomment the line:
//#define ENABLE_DASH_DEBUG
in util.h to enable debugging statements.
When commented any code wrapped with the DBG() macro will simply be removed
by the preprocessor. When not commented all such wrapped statements will
be present.
For maximum effectiveness it is best that util.h be the first effective include
in all source files. It is also possible to enable the macro for a single file
by temporarily adding #define ENABLE_DASH_DEBUG to the top of the file.
Code committed to non-development branches should always have the define
commented.
…stnet phase II
This commit contains the core governance system changes for 0.12.1. Any unrelated
changes have either been removed or moved to separate commits.
 Changed mode 0755->0644 on several source files.
 - Added reminder to revert temporary reduction of number of votes
required to trigger superblock to 1 for testing
This is for efficiency since this function is called often and is
only 1 line of code.
…rblockTriggered.
Since calls to the later function are always protected by the former there's
no reason to keep these separate and this simplifies the code in
masternode-payments.cpp.
Note this has an effect on testing because we can now only create
1 superblock per day. Devs may need to temporarily change testnet params
for easier testing.
 - We assume that payment values in JSON are in units of DASH
for consistency with other RPC functions, such as
createrawtransaction.
 - Also ensure that number of votes required is never smaller than 1
Exceptions are now thrown consistently rather than using a mix of
exceptions and return code checking. Exceptions are now caught only
in AddNewTrigger when the CSuperblock constructor is called. Unnecessary object
status members have been removed.
This appears to help with travis tests, for unknown reasons.
Comment threadsrc/governance-classes.h Outdated
@@ -0,0 +1,261 @@

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: newline

@schinzelh

Copy link
Copy Markdown

utACK d7c8a6b

Comment threadsrc/governance-classes.cpp Outdated
LOCK(governance.cs);
// GET ALL ACTIVE TRIGGERS
std::vector<CSuperblock_sptr> vecTriggers = triggerman.GetActiveTriggers();
//int nYesCount = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: commented unused? could probably remove it completely

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to leave it for now. Uncommenting line 310 is the patch I apply for dev testing. (Although next time I'll use a small payment amount to avoid knocking out any more testnet nodes).

Comment threadsrc/miner.cpp Outdated

{
LOCK2(cs_main, mempool.cs);
LOCK(cs_main);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how any of changes here (miner.cpp) are related to this PR. Should be reverted imo.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had reverted that but it looks like I missed it somehow.

#ifndef MASTERNODE_PAYMENTS_H
#define MASTERNODE_PAYMENTS_H

#include "util.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to include it here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making util.h the first include ensures that the DBG macro can be enabled on a per file basis.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include "util.h" is already there in masternode-payments.cpp, if you need DBG somewhere else where masternode-payments.h is included imo it's better to include util.h there explicitly rather than having chaining dependencies through masternode-payments.h.

@eduffield222

Copy link
Copy Markdown

ACK, merge when ready 👍

@tgflynn

tgflynn commented Aug 17, 2016

Copy link
Copy Markdown
Author

What about the miner reward (ie. my question on the core-dev channel) ?

This should have been done in the original PR but was overlooked.
 - Replaced redundantly defined function with inclusion of governance-vote.h
- Replaced magic numbers with their corresponding constant symbols
@tgflynn

Copy link
Copy Markdown
Author

I pushed commits that fix the omitted locking reversion and most of the other issues raised.

Not sure what to do about miner rewards. Maybe we leave that for another PR, that I think should also better resolve the issues with block validation for nodes that are not in sync ?

@UdjinM6UdjinM6 changed the title V0.12.1.x governance prV0.12.1.x governance pr - part 1 - base functionalityAug 17, 2016
@UdjinM6

Copy link
Copy Markdown

I'm leaning towards merging this as it is and fixing CSuperblock::IsValid and other mining reward related issues (if any) in another PR. All other major issues seems to be fixed, so should be helpful to have new base and solve issues/refactor pieces individually later.
utACK 0a37966

@schinzelh

Copy link
Copy Markdown

utACK 0a37966 as well - will merge when Travis is ready :)

@schinzelh
schinzelh merged commit de7b2b6 into dashpay:v0.12.1.xAug 17, 2016
@schinzelh

Copy link
Copy Markdown

Squashed and merged de7b2b6

@tgflynn
tgflynn deleted the v0.12.1.x-governance-PR branch September 7, 2016 13:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@tgflynn@schinzelh@eduffield222@UdjinM6