Commit Graph

33 Commits

Author SHA1 Message Date
Sebastian Grewe
a0fa71b264 [IMPROVEMENT] Adding incremental round/user shares
This will address #510. It needs thorough testing and is a WiP but
is a start to improve cron runtime and DB loads.
2013-09-18 09:45:52 +02:00
Sebastian Grewe
3cfef93580 WiP to disable fees for specific accounts
* added new account table column: `no_fee`
* honor `no_fee` flag during payout process
* added upgrade SQL file for this feature

Address #260
2013-07-23 10:56:45 +02:00
Sebastian Grewe
fdf97c8832 fixing config access in share class for archive purge 2013-07-10 14:24:15 +02:00
Sebastian Grewe
b4b6b118bf Ensure to return 0 if no valid/invalid shares are found 2013-07-09 23:19:36 +02:00
Sebastian Grewe
ecf3db3a5b Removed BETWEEN call for round shares
Now shares are calculated proper with

`id > ? AND id <= ?`

as boundaries. This will ensure the upstream result is also calculated
for the round.

Addresses #143
2013-07-09 22:41:21 +02:00
Sebastian Grewe
ba240000ab Latest version for PPLNS payouts
* Rebased with next to add logging functions
* Added block method to fetch specific block
* Modified getArchive shares method to be more constistent
* Added new global configuration
* Adjusted smarty globals with new configuration
* More verbose pplns cron with logging
* Re-target the round in case of PPLNS not being matched by archive

Fixes #143
2013-07-09 21:59:44 +02:00
Sebastian Grewe
2f2acdad6d First working version of PPLNS payouts
* Based PPLNS on Prop Payout script
* Using defaults from prop payout, no class adjustments
* Added more methods required for PPLNS
* Added block methods for dynamic payout calculations
* Added PPLNS Sidebar that also displays the PPLNS Target
 * Shares beyond this target will not be included in payouts
 * Shares missing to this target will be added from archives
* Enabled archiving by default for PPLNS
* Added configuration options for PPLNS
 * Documented the usage for PPLNS, defaults are sane
* Added pplns_payout to run-crons

Addresses #143 and if accepted will fix it
2013-07-09 21:59:44 +02:00
Sebastian Grewe
52e02a545b fixing issue with upstream shares not being found 2013-07-09 15:43:42 +02:00
Sebastian Grewe
abef09b08c Added blockhash solution checking
Stratum of @moopless supports blockhash as a solution. Check for that
one first.

Addresses #405
2013-07-09 14:50:23 +02:00
Sebastian Grewe
7f759708c8 Adding share type to log output
This will display which detection mechanism caught the share.
Fixed stratum detection

Fixes #405
2013-07-09 11:43:12 +02:00
Sebastian Grewe
e4f8537165 removing debug output 2013-07-09 11:34:49 +02:00
Sebastian Grewe
f6b350370d Adding solution detections for blocks
This will finally fix all block finding issues with a 4 way detection.
The find upstream method will continue to try other ways to find a
proper share until they are all exhausted or a match was found.

* Use stratum solution, create scrypt hash from block header
* Use pushpoold solution, create solution string from block header
* Use first available upstream share in timerange of block time
* Use *any* first available valid share older than time of block

This will fix #405 - no more unknown blocks. Ever.
2013-07-09 11:27:20 +02:00
Sebastian Grewe
6193604598 Fallback call if upstream share not found properly
Implemented a fallback method in case no upstream share can be found for
a block. This will result in same strange behaviour especially if a
later block has properly added a valid share and this will be used for a
previous block. At least now even the last block will be properly found
and marked as discovered by a user, even though no actual upstream share
was involved in this.

This is a dirty workaround for pools having payout issues. After all
blocks are processed and assuming upstream shares continue to work as
expected, this will *skip* broken blocks/shares.

Workaround fix for #392
2013-07-07 22:24:52 +02:00
Sebastian Grewe
2586aca34e Revert "Fixing issue with delayed inserts for shares"
This reverts commit 752b3e810f.
2013-07-07 19:52:24 +02:00
Sebastian Grewe
752b3e810f Fixing issue with delayed inserts for shares
When shares are inserted with a delay for performance optimizations,
this will cause block timestamps to be completely off with share
timestamps. Hence the timestamp limited search is now removed, it would
cause too many issues for Stratum users/pools.

Addresses #392
2013-07-06 23:11:28 +02:00
Sebastian Grewe
f4ce22bee8 Skip bogus upstream shares
This will fix an issue with blocks being assigned upstream shares that
are marked as valid but are not the actual solution for a block.

Only shares inserted when or after the block timestamp are now looked
at. This will ensure other shares inserted earlier and marked as
upstream valid are skipped.

This will not fix edge cases where many shares are inserted at the same
time and are all in the same timeframe of the block. Then the first
valid share in that time is used.

This worked fine on a testnet with a number of blocks found and false
shares inserted by hand.

Fixes #352
2013-07-03 15:01:08 +02:00
Sebastian Grewe
34509051e2 Properly detect if we did find an upstream share
Avoid returning true even if no share was found.

Addresses #189
2013-06-18 09:30:13 +02:00
Sebastian Grewe
4745a2f6f8 Adding support for PPS payout method
This commit changed a few things in the backend and classes code:

* Any <type>_PPS transaction does NOT need to be confirmed
* Queries updated for added <type>_PPS transactions
* Template updated to properly display these transactions

Cronjob

* Added pps_payput cron to run payouts based on worker submitted shares
* **IMPORTANT**: Can NOT be run with proportional_payout!

Addresses #70
2013-06-10 18:49:57 +02:00
Sebastian Grewe
8a1dc20ec8 Changing upstream share finding function
* Fetch all blocks unaccounted for in ASC oder (low to high height)
* Use lowest height block to find lowest ID upstream accepted share
* Use this share as the finding share for a block
* Set share as last found upstream share for further blocks
 * This only applies if shares are not deleted at all which they should!
2013-05-31 12:11:56 +02:00
Sebastian Grewe
b5ab1a02fb Adding more in-line documentation and some cleanup 2013-05-30 09:55:21 +02:00
Sebastian Grewe
e1f92218a3 addressing #66 with higher timerange for upstream shares 2013-05-27 14:55:13 +02:00
Sebastian Grewe
93fa758ab6 increase timerange for upstream share to cope with slower db writes 2013-05-24 15:31:29 +02:00
Sebastian Grewe
9536e7c193 fixing pps payout, getRoundShares system MUST be search by ID or round shares are NOT calculated properly 2013-05-14 17:58:10 +02:00
Sebastian Grewe
5c72a859eb added secondary table related to shares to share class 2013-05-14 16:30:11 +02:00
Sebastian Grewe
12f60a4567 adding DATETIME column for archive 2013-05-14 16:10:52 +02:00
Sebastian Grewe
9bf99e3c8e get both valid and invalid round shares 2013-05-14 12:44:42 +02:00
Sebastian Grewe
c4d5e31bac add method to return shares table name, added getRoundShares 2013-05-13 23:28:11 +02:00
Sebastian Grewe
e8dcba2dcc removed some warning output on shares class 2013-05-13 09:20:37 +02:00
Sebastian Grewe
91144afa4e search shares by IDs not timestamps, cleaned up transaction class in the process 2013-05-12 16:58:33 +02:00
Sebastian Grewe
47b3816d27 cleaned up crons, changed timestamp range to properly find shares, added verbose parameter 2013-05-11 18:51:10 +02:00
Sebastian Grewe
3971ea797c further work on sharecounter cron, almost all features available now 2013-05-11 09:15:19 +02:00
Sebastian Grewe
42d2fa2618 calculate propotional payout for all shares of this block 2013-05-11 00:22:23 +02:00
Sebastian Grewe
571e26413b adding new share class 2013-05-10 22:36:42 +02:00