Commit Graph

154 Commits

Author SHA1 Message Date
Evan Duffield
1f35a12033 disable ix for fin budget submit 2015-08-03 12:57:15 -07:00
Evan Duffield
92be1268bb Fixed bug with AutoCheck finalbudget voting 2015-08-03 12:54:54 -07:00
UdjinM6
dd8fa7c365 Continue work on more debug categories
- rebased to latest v12
- masternode, mnpayments, mnbudget and keepass categories
- remove c_str in logprint(f)
2015-07-31 19:01:18 +03:00
Evan Duffield
1cf19c64ac Check prop FeeHash separate w/o banning prop 2015-07-30 13:15:27 -07:00
Evan Duffield
5024b7d3f6 Added sendtoaddressix for api IX support 2015-07-30 11:33:56 -07:00
Evan Duffield
ebc2591e4b Revert "lock debugging"
This reverts commit e230762d5a.
2015-07-30 07:49:08 -07:00
Evan Duffield
7a9028631a Revert "Disable CheckAndRemove on file dumps"
This reverts commit 3fc9ea4adf.
2015-07-30 07:41:14 -07:00
Evan Duffield
3a72bea5b3 fixed sync edge case 2015-07-30 06:27:57 -07:00
Evan Duffield
3fc9ea4adf Disable CheckAndRemove on file dumps
- Testing theory for lockups
2015-07-30 06:27:57 -07:00
Evan Duffield
805452955b Proposal nTime based on fee transaction block 2015-07-30 06:27:29 -07:00
Evan Duffield
e230762d5a lock debugging 2015-07-30 06:27:28 -07:00
Evan Duffield
0152a1fc11 Removed IsBudgetPaymentBlock lock 2015-07-29 13:59:07 -07:00
Evan Duffield
dfad32272c Refactored locking for masternode winners and budgets 2015-07-29 12:29:46 -07:00
Evan Duffield
fc33c3b963 fixed GetBudget bug 2015-07-29 01:29:15 -07:00
Evan Duffield
0edb236801 Fixed item count functionality and sync with no budegt 2015-07-29 01:06:30 -07:00
Evan Duffield
dc829e9d2c added syncing counts 2015-07-28 21:16:11 -07:00
Evan Duffield
8acfd77750 Fixed HaveBudget, allow failure after 3 tries 2015-07-28 13:14:32 -07:00
Evan Duffield
ffaedc1829 Fixed proposal nTime calculation and usage 2015-07-28 08:55:11 -07:00
Evan Duffield
d72d3d022d Various Fixes
- Testnet budget adjustments to allow quick cycles that create no inflation in the testnet environment
- Budget proposal are sorted by YesCount-NoCount now
- Added nTime to proposals
- Only allow proposals more than 1 day old into budgets
2015-07-28 06:40:48 -07:00
Evan Duffield
9689e5c077 improve errors for missing finbudgets/props 2015-07-27 10:28:10 -07:00
Evan Duffield
145c845d1f Changed vote restrition model
- Masternodes can only vote once per hour now, instead of 100 times a day total
- UI reports back errors now
2015-07-26 07:01:49 -07:00
Evan Duffield
f82b34f3f2 better sorting algorithm
-- sort props by votes then nFeeHashTX
2015-07-26 05:26:15 -07:00
Evan Duffield
2b3edff435 Only relay good budget items 2015-07-25 21:23:38 -07:00
Evan Duffield
04fc6e1fb4 Change rest of sync process to direct inv messages / reduced sync timeout 2015-07-25 20:17:53 -07:00
Evan Duffield
c0a5dfba61 Masternode inv messages / save seen in mncache 2015-07-25 12:07:30 -07:00
Evan Duffield
0b9d761a38 only take newest votes 2015-07-25 09:59:59 -07:00
Evan Duffield
8187228be1 Fixed budget syncing issues / forking issues / syncing issues
- Budgets now store the seen objects locally so they're not overwritten when saving/loading to check validity of budget.dat
- Added safer sync "failure" mode, that will retry an hour later if the sync fails for some reason. This will stop the client from thinking it has budget data and rejecting blocks when they're valid.
- protocol bump
- version bump
2015-07-25 09:29:29 -07:00
UdjinM6
491c46c412 remove sync forcing and count already seen as a success instead 2015-07-24 21:35:11 +03:00
Evan Duffield
9fb56d9479 Various improvements
- Use INV messages where possible in syncing process
- Ask 4 peers intend of 2 to send of inventory of mnw, and budgets
- Special regtest sync mode
- Fix mnw freezing issue (maybe)
2015-07-23 14:35:14 -07:00
Evan Duffield
fa6216f115 Check for existing budget hash before submitting 2015-07-23 11:48:19 -07:00
Evan Duffield
f727b2dbd7 Fixed RemainingPayments display bug
- When proposal hasn't started yet, remaining payment is calculated incorrectly.
2015-07-23 07:36:41 -07:00
Evan Duffield
35cc21edf3 New masternodes must wait till end of queue 2015-07-23 07:16:55 -07:00
Evan Duffield
cd862ac1ea Disable multisig proposals / IsScheduled read ahead 8 blocks 2015-07-23 06:46:38 -07:00
Evan Duffield
18a908065f Fixed mnbudget suggestion 2015-07-22 18:53:17 -07:00
Evan Duffield
b9d47a0c6f Submit finalized budget 2 days before payment 2015-07-22 17:54:47 -07:00
Evan Duffield
de485fe93d Allow peers to ask for budget votes on testnet more than once 2015-07-21 07:05:35 -07:00
UdjinM6
dba572ac96 use specific protocols 2015-07-20 04:54:02 +03:00
Evan Duffield
7aa9676118 Only check vote sigs once / payee cache update on newblock 2015-07-18 12:24:06 -07:00
Evan Duffield
90f508c67e Pay masternodes when no valid budget 2015-07-18 08:53:40 -07:00
Evan Duffield
637805b2de Require 7 confirmations for finalized budget 2015-07-18 07:49:39 -07:00
Evan Duffield
916deaa398 Small syncing improvement 2015-07-17 21:38:15 -07:00
Evan Duffield
d5c4f3bea4 Only ask for missing masternodes/budget items after sync is complete 2015-07-17 11:03:49 -07:00
evan82
f9ada02a7d Merge pull request #433 from UdjinM6/v0.12.0.x_ref_budget
V0.12.0.x Budget module refactor
2015-07-17 10:29:59 -07:00
UdjinM6
b84bf76324 Budget module refactor
- readability (names / spaces / simplify constructions / etc)
- proper types (int for block height, CAmount for money)
- prettify log output / drop c_str() there
- read budgets on dump before writing (safety)
- microoptimization (++it)
- sort proposals by Yeas
- sort finalized budgets by votes
- fix few small bugs
2015-07-17 18:07:07 +03:00
Evan Duffield
b6001065ae Set fValid=true when receiving new votes 2015-07-17 07:40:26 -07:00
Evan Duffield
7101c951f8 Budget Improvements
- Client bump
- Improved syncing logic (sholud stop hanging issues)
- New spork for turning on super blocks
- Fixed issue with sending old/invalid finalized budgets
- Fixed issue with syncing clients and lack of confirmations with budget items (for IX)
2015-07-16 20:03:42 -07:00
Evan Duffield
017217f423 Added IsTransactionValid for finalized budgets 2015-07-16 10:47:51 -07:00
Evan Duffield
f139dbbc74 Fixed prepare -- shouldn't check collateral 2015-07-15 15:56:40 -07:00
Evan Duffield
ffed6dc948 Added CBudgetManager::ToString 2015-07-15 14:21:21 -07:00
Evan Duffield
21769085ec Test feeTX in IsValid 2015-07-15 07:18:03 -07:00
Evan Duffield
6e0a468701 Highly improved syncing process 2015-07-14 19:48:02 -07:00
Evan Duffield
9e9e01b5f6 Fixed GetBudget 2015-07-14 16:06:00 -07:00
Evan Duffield
a4e3031db1 Refactored CleanAndRemove Proposals 2015-07-14 15:52:07 -07:00
Evan Duffield
50d1b827eb Fixed proposal fee IX confirmations 2015-07-14 12:52:46 -07:00
UdjinM6
59271beabd Fix CBudgetProposalBroadcast::IsBudgetCollateralValid log output / strError 2015-07-14 11:32:49 +03:00
Evan Duffield
bee6941195 Fixed Propagation Of Budgets / Proto Bump 2015-07-13 20:03:08 -07:00
Evan Duffield
6fa0d23714 Commit collateral transaction correctly for finalized budget 2015-07-13 06:34:54 -07:00
Evan Duffield
acf09d1bc1 Collateral is now checked for age 2015-07-12 16:37:55 -07:00
Evan Duffield
304ab6c7ab Various improvements to the proposal system
- Proposal scripts are now checked correctly
- Fee transactions are created correctly for IX and non-IX types
2015-07-12 14:02:39 -07:00
Evan Duffield
0b3ef3c9fe Various fixes
- Proposal submitting now works properly
- Syncing proposals now works properly
- Finalized budgets are now created correctly
2015-07-12 10:34:21 -07:00
Evan Duffield
a59c5d9edd fixed issues with rpc commands 2015-07-12 07:45:58 -07:00
Evan Duffield
c701839a43 Proposal Security Overhaul
Submissions to the network now require a fee to be paid to the network (mining fee) using a special transaction with a OP_RETURN && ProposalHash in one of the outputs. This allows the network to filter spam quickly, while also allowing anyone to submit a proposal to the network.

To implement these changes we've introduced a few new commands:

mnbudget prepare PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS DASH_AMOUNT YES|NO|ABSTAIN [USE_IX(TRUE|FALSE)]
- To create the special transaction

mnbudget submit PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS DASH_AMOUNT YES|NO|ABSTAIN FEE_TX
- After the transaction is accepted by the network and has 3 confirmations, you can submit the transaction to the network here

mnbudget show
- Get the proposal hash from here

mnbudget vote PROPOSAL-HASH YES|NO|ABSTAIN
- You can now simply vote by hash using this command
2015-07-11 13:20:12 -07:00
Evan Duffield
a351456c17 Fixed invalid saved budget.dat issue 2015-07-08 10:17:16 -07:00
Evan Duffield
91a0887a0d Fix active removal of proposals 2015-07-08 08:55:52 -07:00
evan82
246037abdb Merge pull request #415 from UdjinM6/v0.12.0.x_budgets_var_naming_logging
V0.12.0.x use proper naming for variables in masternode-budget
2015-07-08 07:35:20 -07:00
UdjinM6
2fdb5b01f7 use proper naming for variables in masternode-budget 2015-07-08 05:35:58 +03:00
UdjinM6
9cfdaffee5 introduce RelayInv 2015-07-08 04:31:10 +03:00
evan82
10ad24226c Merge pull request #405 from UdjinM6/v0.12.0.x_prevent_ban_for_unknown_MN
V0.12.0.x Stop banning nodes for unknown masternodes while processing budget messages
2015-07-06 15:39:42 -07:00
Evan Duffield
5b98d9db05 fixed getinfo for 0-vote proposals 2015-07-06 15:06:09 -07:00
UdjinM6
e40de28900 Stop banning nodes for unknown masternodes while processing budget messages.
Also cleanup naming/logging a bit.
2015-07-07 00:00:00 +03:00
Evan Duffield
05e126f853 Clear expired proposals / added mnbudget check 2015-07-06 13:23:09 -07:00
Evan Duffield
5f3543efa5 merged 2015-07-06 10:52:09 -07:00
Evan Duffield
4596e7f336 Vastly improved proposal management implementation
-Syncing now happens in stages. Masternodes and Sporks, then Masternode winners, then proposals. Some of these require the masternode signatures, otherwise there are race conditions within the syncing process itself.
-Resigning - When a proposal is sent to the network initially it's signed by a masternode, if that masternode goes inactive the proposal becomes invalid. Resigning allows other masternodes to update proposal keep it valid with the coming and going of masternodes.
-Resigning compatibility - non masternodes will scan and flag proposals as invalid to accept updated owners.
-Invalid votes are now actively removed from the proposals when they go inactive
- Remove budgets with negative votes of more than 10% of network
- Only allow proposals into budget that have more than 10% of network support
- Faster removal of inactive masternodes
2015-07-06 10:46:58 -07:00
UdjinM6
ce41645713 fix CFinalizedBudget::AutoCheck() crash 2015-07-05 10:37:52 +03:00
crowning-
36f65addc7 Fixed typo 2015-07-05 02:02:14 +02:00
Evan Duffield
edaf479063 Added CleanAndRemove for Proposal votes 2015-07-04 15:49:42 -07:00
Evan Duffield
b1360473b4 Budget changes
- Remove budgets with negative votes of more than 10% of network
- Only allow proposals into budget that have more than 10% of network support
2015-07-04 10:42:42 -07:00
Evan Duffield
42d9a581a1 Smarter nHeight detection for masternode payments 2015-07-03 22:05:10 -07:00
Evan Duffield
6becaf0462 Added mnbudget projection and changed "show"
- Show now shows every proposal that is known, which seems to be the general expected behavior of the users
- Added "projection" for showing what will end up in the budget if it was finalized currently
2015-07-03 10:54:10 -07:00
Evan Duffield
4420d563cb fixed proposal display functionality 2015-07-02 17:51:31 -07:00
Evan Duffield
3bd8cc1e98 fixed bug with proposals 2015-07-02 15:34:11 -07:00
Evan Duffield
28052240a5 Improvements for syncing budget votes
- New orphan object and reprocessing logic
- Added some logic for asking peers for missing proposals and finalized budgets
2015-07-02 09:41:33 -07:00
Evan Duffield
d8a6057205 Fixed issues with budget syncing 2015-07-02 08:07:30 -07:00
Evan Duffield
c72355335c Coinbase Payee Cache Implementation
- Masternode nLastPaid is removed and a new caching system that keeps the last 30 days of coinbase payees replaces it
- To deal with some significant attack vectors, the masternode donation feature was removed. The donation feature was added to support developement anyway, so this will be replaced by the budgeting code.
-  This code should allow the network to come to consensus about who should be paid pretty effectively
2015-06-23 10:48:03 -07:00
Evan Duffield
df77f56e11 Budget stability fixes
- Proposals must start on a budget block now
- Finalized budgets now enforce proposal start and end periods
- Other misc fixes
2015-06-16 10:04:35 -07:00
UdjinM6
f1debd4688 fix segfault in budgets 2015-06-10 09:49:08 +03:00
Evan Duffield
928f6edcb6 Adjusted max payment per finalized budget to 10% of the monthly block reward 2015-06-09 20:46:24 -06:00
UdjinM6
17d3df5300 fix CBudgetManager::FindProposal 2015-06-03 19:45:15 +03:00
UdjinM6
d335c1ebbe MOVE: group classes` implementation together; REMOVE: GetMasternodeBudgetEscrow (not used) 2015-06-03 19:10:11 +03:00
UdjinM6
6e0a64bc5d simplify few IFs 2015-06-03 18:42:37 +03:00
Evan Duffield
439679f5bc Finalized Budget Voting and Payment
- Added strBudgetMode with modes of "auto", "output-vin" and "suggest". Auto votes for what the masternode sees as the most popular proposals, output-vin is a delegation mode to another party and "suggest" sends a message to the network, suggesting the most popular proposals
2015-06-01 12:06:03 -07:00
Evan Duffield
a93ceed090 Finalized Budget Changes
- Finalized budgets now pass proposal hash, payee and amount. This keeps them completely separate from the proposal system to aid in consensus.
- Added status messages for badly formed finalized budgets (probably attacks). If users see messages like this they should check the proposals to see if something is wrong with them before voting.
2015-05-30 13:12:12 -07:00
Evan Duffield
eaf7b940a6 Complete rewrite of consensus code for mn/budget payments
- Added FindProposal and FindFinalBudget to budgeting class
- Added 2 new sporks for Proposals and Budget payment enforcement. This is outside of the decentralized code so we can turn it off if there's a problem.
- Detect budget blocks and pay correct amounts in super blocks
2015-05-30 10:27:51 -07:00
Evan Duffield
d470eddc01 fixed hashing issues with mnw messages 2015-05-27 15:07:53 -07:00
Evan Duffield
fe55b12a1f added improvements for finding next masternode to get paid 2015-05-27 12:47:01 -07:00
Evan Duffield
66dcf6bbc7 cleaned up naming of budget functions 2015-05-27 10:11:00 -07:00
Evan Duffield
41eb74dc82 Stable budget implementation
- All budgeting code seems to be rather stable now. Serialization/caching is working rather well.
- Fixed some ambiguous variable names within the budgeting system that were causing the file caching to not work all of the time
2015-05-27 09:28:55 -07:00
Evan Duffield
efe377fa69 tie budget system to masternode payment system 2015-05-26 07:56:51 -07:00
Evan Duffield
40149c4e41 Budgeting Software / Reference Node Removal
- Added commands for using budgets "mnbudget" and "mnfinalbudget"
- Supports 100% decentralized budget control and view-only site with json meta data object
2015-05-14 18:01:15 -07:00
Evan Duffield
c6233880c3 draft 2015-05-04 03:05:08 -07:00