bitcoin:eloipool.git
10 years agoMerge branch 'ambig_t'
Luke Dashjr [Thu, 23 Feb 2012 18:26:27 +0000 (13:26 -0500)]
Merge branch 'ambig_t'

Conflicts:
eloipool.py

10 years agoReplace ambiguous 't' variables with 'txn' and 'cbtxn' as applicable
Luke Dashjr [Thu, 23 Feb 2012 18:20:11 +0000 (13:20 -0500)]
Replace ambiguous 't' variables with 'txn' and 'cbtxn' as applicable

10 years agoBugfix: Actually work on a valid block if wrong bits is detected (shortly after we...
Luke Dashjr [Mon, 20 Feb 2012 22:30:54 +0000 (17:30 -0500)]
Bugfix: Actually work on a valid block if wrong bits is detected (shortly after we find the last block of the difficulty-period)

10 years agoPromote new block from debug to info
Luke Dashjr [Mon, 20 Feb 2012 06:08:33 +0000 (01:08 -0500)]
Promote new block from debug to info

10 years agoSilence more debug info
Luke Dashjr [Mon, 20 Feb 2012 05:42:11 +0000 (00:42 -0500)]
Silence more debug info

10 years agoSimplify bitcoin.node code by removing pre-Feb20 compatibility attempts/hacks
Luke Dashjr [Mon, 20 Feb 2012 00:47:30 +0000 (19:47 -0500)]
Simplify bitcoin.node code by removing pre-Feb20 compatibility attempts/hacks

10 years agoCheck for stale-work and time-too-old/new only after possibly submitting a share...
Luke Dashjr [Sun, 19 Feb 2012 23:55:19 +0000 (18:55 -0500)]
Check for stale-work and time-too-old/new only after possibly submitting a share upstream

10 years agoBugfix: Clear jsonrpcserver._CheckForDupesHACK when the block changes, so it doesn...
Luke Dashjr [Sun, 19 Feb 2012 23:42:21 +0000 (18:42 -0500)]
Bugfix: Clear jsonrpcserver._CheckForDupesHACK when the block changes, so it doesn't grow infinitely

10 years agoSupport for binding sockets using external program (possibly with setuid root or...
Luke Dashjr [Thu, 9 Feb 2012 20:57:11 +0000 (15:57 -0500)]
Support for binding sockets using external program (possibly with setuid root or capabilities)

10 years agoRaise timeout on persistent connections to 150 seconds
Luke Dashjr [Sat, 4 Feb 2012 02:47:19 +0000 (21:47 -0500)]
Raise timeout on persistent connections to 150 seconds

10 years agoImplement "Connection: close" header
Luke Dashjr [Sat, 4 Feb 2012 02:45:23 +0000 (21:45 -0500)]
Implement "Connection: close" header

10 years agoBugfix: handle_error on error, not handle_close
Luke Dashjr [Sat, 4 Feb 2012 02:45:05 +0000 (21:45 -0500)]
Bugfix: handle_error on error, not handle_close

10 years agoFor now, enable No Early Longpoll Headers quirk by default
Luke Dashjr [Fri, 3 Feb 2012 20:25:51 +0000 (15:25 -0500)]
For now, enable No Early Longpoll Headers quirk by default

We can revisit this when we find out which clients have trouble with it

10 years agoTrack downtime across restarts
Luke Dashjr [Fri, 3 Feb 2012 20:23:28 +0000 (15:23 -0500)]
Track downtime across restarts

10 years agoSkip restoring workLog iff the state file is over 2 minutes old
Luke Dashjr [Fri, 3 Feb 2012 20:07:19 +0000 (15:07 -0500)]
Skip restoring workLog iff the state file is over 2 minutes old

We can possibly save some time by not restoring expired work.
Note this changes the statefile format, but supports loading an old one.

10 years agoBugfix: Ignore subsequent close attempts
Luke Dashjr [Fri, 3 Feb 2012 20:00:24 +0000 (15:00 -0500)]
Bugfix: Ignore subsequent close attempts

10 years agoBugfix: Ignore errors waking longpoll handlers
Luke Dashjr [Fri, 3 Feb 2012 14:55:15 +0000 (09:55 -0500)]
Bugfix: Ignore errors waking longpoll handlers

Non-socket errors debug-log

10 years agoWait to restoreState until right before starting the server tasks, and don't delete...
Luke Dashjr [Thu, 2 Feb 2012 21:55:51 +0000 (16:55 -0500)]
Wait to restoreState until right before starting the server tasks, and don't delete the worklog file

10 years agoBugfix: Close sockets on BitcoinNode at shutdown/restart too
Luke Dashjr [Thu, 2 Feb 2012 18:02:43 +0000 (13:02 -0500)]
Bugfix: Close sockets on BitcoinNode at shutdown/restart too

10 years agoBugfix: Ignore BitcoinNodeAddresses missing in config
Luke Dashjr [Thu, 2 Feb 2012 17:02:55 +0000 (12:02 -0500)]
Bugfix: Ignore BitcoinNodeAddresses missing in config

10 years agoBitcoinLink: Fix pre-Feb20 "version" checksum handling
Luke Dashjr [Thu, 2 Feb 2012 17:01:18 +0000 (12:01 -0500)]
BitcoinLink: Fix pre-Feb20 "version" checksum handling

10 years agoMerge branch 'bcnode'
Luke Dashjr [Thu, 2 Feb 2012 16:58:08 +0000 (11:58 -0500)]
Merge branch 'bcnode'

Conflicts:
jsonrpcserver.py

10 years agoMerge branch 'savework'
Luke Dashjr [Thu, 2 Feb 2012 16:45:35 +0000 (11:45 -0500)]
Merge branch 'savework'

10 years agoNew CLI command restart() to save state, re-exec, and restore
Luke Dashjr [Thu, 2 Feb 2012 15:33:05 +0000 (10:33 -0500)]
New CLI command restart() to save state, re-exec, and restore

10 years agoSave workLog and DupeShareHACK to eloipool.worklog on exit(), and restore (and delete...
Luke Dashjr [Thu, 2 Feb 2012 15:12:27 +0000 (10:12 -0500)]
Save workLog and DupeShareHACK to eloipool.worklog on exit(), and restore (and delete) on startup

10 years agogitignore: midstate.so
Luke Dashjr [Thu, 2 Feb 2012 09:22:35 +0000 (04:22 -0500)]
gitignore: midstate.so

10 years agoImplement outgoing BitcoinLink connections, and restore UpstreamBitcoindNode
Luke Dashjr [Thu, 2 Feb 2012 09:03:02 +0000 (04:03 -0500)]
Implement outgoing BitcoinLink connections, and restore UpstreamBitcoindNode

10 years agoBugfix: Move some cleanup from JSONRPCServer to SocketHandler
Luke Dashjr [Thu, 2 Feb 2012 09:01:40 +0000 (04:01 -0500)]
Bugfix: Move some cleanup from JSONRPCServer to SocketHandler

10 years agoReplace (broken) single-node BitcoinLink with AsyncSocketServer-based BitcoinNode
Luke Dashjr [Thu, 2 Feb 2012 08:24:43 +0000 (03:24 -0500)]
Replace (broken) single-node BitcoinLink with AsyncSocketServer-based BitcoinNode

This doesn't support outbound connections yet

10 years agoAsyncSocketServer: Abstract Waker out of JSONRPCServer for general use
Luke Dashjr [Thu, 2 Feb 2012 08:21:55 +0000 (03:21 -0500)]
AsyncSocketServer: Abstract Waker out of JSONRPCServer for general use

10 years agoNetworkListener: Allow non-INET6 sockets
Luke Dashjr [Thu, 2 Feb 2012 00:41:57 +0000 (19:41 -0500)]
NetworkListener: Allow non-INET6 sockets

10 years agoAbstract various parts of JSONRPCServer out into AsyncSocketServer
Luke Dashjr [Thu, 2 Feb 2012 00:25:56 +0000 (19:25 -0500)]
Abstract various parts of JSONRPCServer out into AsyncSocketServer

10 years agoExplain how to bind IPv4 addresses
Luke Dashjr [Wed, 1 Feb 2012 04:51:09 +0000 (23:51 -0500)]
Explain how to bind IPv4 addresses

10 years agoStash the server_address on the JSONRPCListener object just in case the user wants...
Luke Dashjr [Wed, 1 Feb 2012 04:50:49 +0000 (23:50 -0500)]
Stash the server_address on the JSONRPCListener object just in case the user wants to see it

10 years agoLog when new block notification received
Luke Dashjr [Wed, 1 Feb 2012 04:37:17 +0000 (23:37 -0500)]
Log when new block notification received

10 years agoBugfix: Survive a SIGUSR1 interrupting epoll
Luke Dashjr [Wed, 1 Feb 2012 04:34:45 +0000 (23:34 -0500)]
Bugfix: Survive a SIGUSR1 interrupting epoll

10 years agoStore JSONRPCListeners in an array for CLI users to access
Luke Dashjr [Wed, 1 Feb 2012 01:07:24 +0000 (20:07 -0500)]
Store JSONRPCListeners in an array for CLI users to access

10 years agoBugfix: Ignore errors on listener sockets
Luke Dashjr [Wed, 1 Feb 2012 01:06:02 +0000 (20:06 -0500)]
Bugfix: Ignore errors on listener sockets

10 years agoExplain why the gotwork error
Luke Dashjr [Wed, 1 Feb 2012 00:42:59 +0000 (19:42 -0500)]
Explain why the gotwork error

10 years agoBugfix: Fix handling of params-free requests
Luke Dashjr [Tue, 31 Jan 2012 15:43:42 +0000 (10:43 -0500)]
Bugfix: Fix handling of params-free requests

10 years agoBugfix: check body exists before checking body[0]
Luke Dashjr [Tue, 31 Jan 2012 15:35:59 +0000 (10:35 -0500)]
Bugfix: check body exists before checking body[0]

10 years agoBugfix: Catch non-object JSON input too; also log errors during actual method calls...
Luke Dashjr [Mon, 30 Jan 2012 16:06:49 +0000 (11:06 -0500)]
Bugfix: Catch non-object JSON input too; also log errors during actual method calls for debugging/catching

10 years agoBugfix: Send errors as proper JSON-RPC responses
Luke Dashjr [Mon, 30 Jan 2012 15:59:26 +0000 (10:59 -0500)]
Bugfix: Send errors as proper JSON-RPC responses

10 years agoRefactor JSONRPCHandler task scheduling, so that there is (almost) always *some*...
Luke Dashjr [Mon, 30 Jan 2012 01:46:02 +0000 (20:46 -0500)]
Refactor JSONRPCHandler task scheduling, so that there is (almost) always *some* task scheduled

By default, a 15 second timeout which closes the connection ;)

10 years agoIgnore extra newlines preceding HTTP request
Luke Dashjr [Mon, 30 Jan 2012 00:35:50 +0000 (19:35 -0500)]
Ignore extra newlines preceding HTTP request

10 years agoJSONRPCHandler: Set _LPTask to True for NELH-quirk LP clients, so they're cleaned...
Luke Dashjr [Sun, 29 Jan 2012 23:26:40 +0000 (18:26 -0500)]
JSONRPCHandler: Set _LPTask to True for NELH-quirk LP clients, so they're cleaned up properly

10 years agoBugfix: Refactor JSONRPCHandler.cleanupLP to remove scheduled wakeLongpoll even if...
Luke Dashjr [Sun, 29 Jan 2012 22:58:57 +0000 (17:58 -0500)]
Bugfix: Refactor JSONRPCHandler.cleanupLP to remove scheduled wakeLongpoll even if it's not part of the LPClients dict anymore (due to having been LP'd)

10 years agoBugfix: Don't error trying to write to peer-closed sockets
Luke Dashjr [Sun, 29 Jan 2012 22:56:39 +0000 (17:56 -0500)]
Bugfix: Don't error trying to write to peer-closed sockets

10 years agoIgnore read data on "closed" sockets
Luke Dashjr [Sun, 29 Jan 2012 21:16:21 +0000 (16:16 -0500)]
Ignore read data on "closed" sockets

10 years agoBugfix: if there is still data to write to the socket, defer socket close until that...
Luke Dashjr [Sun, 29 Jan 2012 21:07:31 +0000 (16:07 -0500)]
Bugfix: if there is still data to write to the socket, defer socket close until that's done

bitcoin-mining-proxy sends an extra \r\n\r\n which causes an error and closed the socket before the initial request's reply got sent

10 years agoBound methods generate new objects every time you reference them, so store them if...
Luke Dashjr [Sun, 29 Jan 2012 06:32:16 +0000 (01:32 -0500)]
Bound methods generate new objects every time you reference them, so store them if we might want to remove the scheduled task later.

This fixes longpoll oddities

10 years agoBugfix: ScheduleDict heap rebuilding was broken
Luke Dashjr [Sun, 29 Jan 2012 06:31:09 +0000 (01:31 -0500)]
Bugfix: ScheduleDict heap rebuilding was broken

10 years agoDocument name & license in README
Luke Dashjr [Sat, 28 Jan 2012 20:20:46 +0000 (15:20 -0500)]
Document name & license in README

10 years agoMerge branch 'AGPL'
Luke Dashjr [Sat, 28 Jan 2012 20:19:53 +0000 (15:19 -0500)]
Merge branch 'AGPL'

Conflicts:
bitcoin/node.py
interactivemode.py
jsonrpcserver.py

10 years agoHandle some invalid garbage on JSONRPC sockets more gracefully
Luke Dashjr [Sat, 28 Jan 2012 03:34:46 +0000 (22:34 -0500)]
Handle some invalid garbage on JSONRPC sockets more gracefully

10 years agomerkleMaker: Add isOverflowed attribute for checking even during 5 minute window
Luke Dashjr [Sat, 28 Jan 2012 01:59:02 +0000 (20:59 -0500)]
merkleMaker: Add isOverflowed attribute for checking even during 5 minute window

10 years agoWarn when coinbase data overflows (max once every 5 minutes)
Luke Dashjr [Sat, 28 Jan 2012 01:56:56 +0000 (20:56 -0500)]
Warn when coinbase data overflows (max once every 5 minutes)

10 years agoSlap an ugly warning on bitcoin.node that it doesn't work reliably on mainnet
Luke Dashjr [Sat, 28 Jan 2012 01:50:58 +0000 (20:50 -0500)]
Slap an ugly warning on bitcoin.node that it doesn't work reliably on mainnet

10 years agoDocument optional midstate dependency
Luke Dashjr [Sat, 28 Jan 2012 01:49:03 +0000 (20:49 -0500)]
Document optional midstate dependency

10 years agoWarn at startup if midstate Python module is missing
Luke Dashjr [Sat, 28 Jan 2012 01:38:48 +0000 (20:38 -0500)]
Warn at startup if midstate Python module is missing

10 years agoUse JSON-RPC getmemorypool to submit blocks to upstream bitcoind
Luke Dashjr [Sat, 28 Jan 2012 01:38:29 +0000 (20:38 -0500)]
Use JSON-RPC getmemorypool to submit blocks to upstream bitcoind

10 years agointeractivemode: Add exit() function to SIGTERM the entire process
Luke Dashjr [Fri, 27 Jan 2012 21:12:47 +0000 (16:12 -0500)]
interactivemode: Add exit() function to SIGTERM the entire process

10 years agoBugfix: Skip coinbaser if CoinbaserCmd is None
Luke Dashjr [Fri, 27 Jan 2012 20:56:43 +0000 (15:56 -0500)]
Bugfix: Skip coinbaser if CoinbaserCmd is None

10 years agoDump block payload to log, and store it in an unbounded array just in case
Luke Dashjr [Fri, 27 Jan 2012 17:21:47 +0000 (12:21 -0500)]
Dump block payload to log, and store it in an unbounded array just in case

10 years agoMake BitcoinNode more robust, and use checksum on ver message
Luke Dashjr [Fri, 27 Jan 2012 08:01:51 +0000 (03:01 -0500)]
Make BitcoinNode more robust, and use checksum on ver message

10 years agoDisable early longpoll headers for PhoenixMiner < 2.8.1
Luke Dashjr [Fri, 27 Jan 2012 05:57:18 +0000 (00:57 -0500)]
Disable early longpoll headers for PhoenixMiner < 2.8.1

Older versions of PhoenixMiner have some weird bug where they stop mining after receiving the response headers for a longpoll.
This is unfortunate, since chunked transfer encoding is the most reliable method to keep a connection open.
We detect these old clients, and wait to send any headers, hoping that TCP keepalive will do the job.

10 years agoTrack lowest merkleroot volumes seen
Luke Dashjr [Fri, 27 Jan 2012 01:29:58 +0000 (20:29 -0500)]
Track lowest merkleroot volumes seen

10 years agoBugfix: Fix TopLPers tool
Luke Dashjr [Fri, 27 Jan 2012 00:44:06 +0000 (19:44 -0500)]
Bugfix: Fix TopLPers tool

10 years agoJSONRPCServer: Refactor longpolling to occur within the regular thread, eliminating...
Luke Dashjr [Fri, 27 Jan 2012 00:41:37 +0000 (19:41 -0500)]
JSONRPCServer: Refactor longpolling to occur within the regular thread, eliminating all locks

10 years agoBugfix: coinbase txnid doesn't belong in merged-mining merkle-link
Luke Dashjr [Fri, 27 Jan 2012 00:15:45 +0000 (19:15 -0500)]
Bugfix: coinbase txnid doesn't belong in merged-mining merkle-link

10 years agoBugfix: actually expire work after 120 seconds (rejected as 'stale-work')
Luke Dashjr [Thu, 26 Jan 2012 23:12:37 +0000 (18:12 -0500)]
Bugfix: actually expire work after 120 seconds (rejected as 'stale-work')

10 years agoSend submitold in LP responses
Luke Dashjr [Thu, 26 Jan 2012 22:25:30 +0000 (17:25 -0500)]
Send submitold in LP responses

10 years agoBugfix: Start the server anyway, even if we failed to bind listener(s)
Luke Dashjr [Thu, 26 Jan 2012 22:13:16 +0000 (17:13 -0500)]
Bugfix: Start the server anyway, even if we failed to bind listener(s)

10 years agoConfig: Support for binding multiple JSON-RPC listeners
Luke Dashjr [Thu, 26 Jan 2012 22:07:26 +0000 (17:07 -0500)]
Config: Support for binding multiple JSON-RPC listeners

10 years agoJSONRPCServer: make server_address optional for constructor
Luke Dashjr [Thu, 26 Jan 2012 22:00:32 +0000 (17:00 -0500)]
JSONRPCServer: make server_address optional for constructor

10 years agoWarn about clearMerkleRoots getting low
Luke Dashjr [Thu, 26 Jan 2012 21:49:58 +0000 (16:49 -0500)]
Warn about clearMerkleRoots getting low

10 years agoJSONRPCServer: support for adding multiple listeners
Luke Dashjr [Thu, 26 Jan 2012 21:48:03 +0000 (16:48 -0500)]
JSONRPCServer: support for adding multiple listeners

10 years agoHandy server.TopLPers function to print out the IPs with the most active LP connections
Luke Dashjr [Thu, 26 Jan 2012 21:29:05 +0000 (16:29 -0500)]
Handy server.TopLPers function to print out the IPs with the most active LP connections

10 years agoBugfix: Handle scheduled task errors
Luke Dashjr [Thu, 26 Jan 2012 21:07:17 +0000 (16:07 -0500)]
Bugfix: Handle scheduled task errors

10 years agoDemote socket.error during read/write events to debug-level
Luke Dashjr [Thu, 26 Jan 2012 20:57:18 +0000 (15:57 -0500)]
Demote socket.error during read/write events to debug-level

10 years agoBugfix: logger needs a method
Luke Dashjr [Thu, 26 Jan 2012 20:53:58 +0000 (15:53 -0500)]
Bugfix: logger needs a method

10 years agoInclude Server header in HTTP replies
Luke Dashjr [Thu, 26 Jan 2012 20:52:25 +0000 (15:52 -0500)]
Include Server header in HTTP replies

10 years agoBugfix: Skip X-Long-Polling header on actual longpoll replies
Luke Dashjr [Thu, 26 Jan 2012 20:51:03 +0000 (15:51 -0500)]
Bugfix: Skip X-Long-Polling header on actual longpoll replies

10 years agoCache and work with fds instead of socket objects, since it seems they sometimes...
Luke Dashjr [Thu, 26 Jan 2012 20:48:57 +0000 (15:48 -0500)]
Cache and work with fds instead of socket objects, since it seems they sometimes change/lose their fd out from under us ;)

Also, close sockets if any error occurs

10 years agoUse a priority queue (aka heapq) to track scheduled tasks more efficiently
Luke Dashjr [Thu, 26 Jan 2012 20:32:57 +0000 (15:32 -0500)]
Use a priority queue (aka heapq) to track scheduled tasks more efficiently

10 years agoBugfix: asynchat.find_prefix_at_end returns lengths, not positions, so we want max...
Luke Dashjr [Thu, 26 Jan 2012 18:33:46 +0000 (13:33 -0500)]
Bugfix: asynchat.find_prefix_at_end returns lengths, not positions, so we want max instead of min

10 years agoJSONRPCServer: Replace asyncore with raw epoll implementation
Luke Dashjr [Thu, 26 Jan 2012 18:32:52 +0000 (13:32 -0500)]
JSONRPCServer: Replace asyncore with raw epoll implementation

(We still recycle some asynchat functions)

10 years agoMove basic sanity checks a bit earlier
Luke Dashjr [Thu, 26 Jan 2012 08:25:39 +0000 (03:25 -0500)]
Move basic sanity checks a bit earlier

10 years agoSilence error when HTTP connection doesn't send request path
Luke Dashjr [Thu, 26 Jan 2012 08:21:06 +0000 (03:21 -0500)]
Silence error when HTTP connection doesn't send request path

10 years agoUse more resources in example config
Luke Dashjr [Thu, 26 Jan 2012 08:18:03 +0000 (03:18 -0500)]
Use more resources in example config

10 years agoBe quieter by default
Luke Dashjr [Thu, 26 Jan 2012 08:17:45 +0000 (03:17 -0500)]
Be quieter by default

10 years agoTrack active longpollers by IP; also fix remote host logging
Luke Dashjr [Thu, 26 Jan 2012 08:17:22 +0000 (03:17 -0500)]
Track active longpollers by IP; also fix remote host logging

10 years agoFaster, simpler cleanup for LPs
Luke Dashjr [Thu, 26 Jan 2012 07:53:29 +0000 (02:53 -0500)]
Faster, simpler cleanup for LPs

10 years agoBugfix: Allow params to be omitted in JSON-RPC calls
Luke Dashjr [Thu, 26 Jan 2012 07:48:32 +0000 (02:48 -0500)]
Bugfix: Allow params to be omitted in JSON-RPC calls

10 years agoMake gotwork less loady
Luke Dashjr [Thu, 26 Jan 2012 07:42:13 +0000 (02:42 -0500)]
Make gotwork less loady

10 years agoSupport for outbound gotwork JSON-RPC call
Luke Dashjr [Thu, 26 Jan 2012 06:45:01 +0000 (01:45 -0500)]
Support for outbound gotwork JSON-RPC call

10 years agoAdd support for setworkaux JSON-RPC only from a secret user
Luke Dashjr [Thu, 26 Jan 2012 05:52:27 +0000 (00:52 -0500)]
Add support for setworkaux JSON-RPC only from a secret user

10 years agoBugfix: Fix midstate bugs
Luke Dashjr [Thu, 26 Jan 2012 03:08:25 +0000 (22:08 -0500)]
Bugfix: Fix midstate bugs

10 years agoBugfix: a2b_hex in Python 3.2 no longer accepts str, only bytes
Luke Dashjr [Thu, 26 Jan 2012 02:14:37 +0000 (21:14 -0500)]
Bugfix: a2b_hex in Python 3.2 no longer accepts str, only bytes

10 years agoBrief README file documenting dependencies and where to get them
Luke Dashjr [Thu, 26 Jan 2012 02:13:22 +0000 (21:13 -0500)]
Brief README file documenting dependencies and where to get them