[Pkg-bitcoin-commits] [p2pool] 03/04: New upstream release [14.0].
Dmitry Smirnov
onlyjob at moszumanska.debian.org
Sat Jul 4 05:26:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
onlyjob pushed a commit to branch master
in repository p2pool.
commit ba3e3c7
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date: Sat Jul 4 05:24:37 2015
New upstream release [14.0].
---
debian/changelog | 4 +-
debian/copyright | 2 +-
...rs-that-send-shares-that-fail-to-validate.patch | 89 ----------------------
...nefficiencient-behaviour-when-chain-is-fo.patch | 53 -------------
...print-share-hashes-when-share-check-fails.patch | 25 ------
...possible-crash-introduced-by-prior-commit.patch | 25 ------
debian/patches/debian.patch | 10 +--
debian/patches/series | 4 -
8 files changed, 8 insertions(+), 204 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d14ff48..c18af8a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-p2pool (13.4+dfsg-1) UNRELEASED; urgency=low
+p2pool (14.0+dfsg-1) UNRELEASED; urgency=low
* Initial release (Closes: #657712).
- -- Dmitry Smirnov <onlyjob at debian.org> Tue, 26 Nov 2013 01:32:36 +1100
+ -- Dmitry Smirnov <onlyjob at debian.org> Sat, 04 Jul 2015 15:18:09 +1000
diff --git a/debian/copyright b/debian/copyright
index c36fd23..6d300fc 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -98,7 +98,7 @@ License: BSD-3-clause
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Files: debian/*
-Copyright: 2013 Dmitry Smirnov <onlyjob at debian.org>
+Copyright: 2013-2015 Dmitry Smirnov <onlyjob at debian.org>
License: GPL-3+
diff --git a/debian/patches/0001-ban-peers-that-send-shares-that-fail-to-validate.patch b/debian/patches/0001-ban-peers-that-send-shares-that-fail-to-validate.patch
deleted file mode 100644
index 5b5aba1..0000000
--- a/debian/patches/0001-ban-peers-that-send-shares-that-fail-to-validate.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 012a8830c61226f48d979db9800edf1862d83df4 Mon Sep 17 00:00:00 2001
-From: Forrest Voight <forrest at forre.st>
-Date: Sun, 19 Jan 2014 17:05:35 -0500
-Subject: [PATCH 1/4] ban peers that send shares that fail to validate
-
----
- p2pool/data.py | 6 +++++-
- p2pool/node.py | 11 +++++++++--
- p2pool/p2p.py | 3 +--
- 3 files changed, 15 insertions(+), 5 deletions(-)
-
-diff --git a/p2pool/data.py b/p2pool/data.py
-index 3ebc1f7..0ce4f7a 100644
---- a/p2pool/data.py
-+++ b/p2pool/data.py
-@@ -438,6 +438,7 @@ class OkayTracker(forest.Tracker):
-
- def think(self, block_rel_height_func, previous_block, bits, known_txs):
- desired = set()
-+ bad_peer_addresses = set()
-
- # O(len(self.heads))
- # make 'unverified heads' set?
-@@ -464,6 +465,9 @@ class OkayTracker(forest.Tracker):
- for bad in bads:
- assert bad not in self.verified.items
- assert bad in self.heads
-+ bad_share = self.items[bad]
-+ if bad_share.peer_addr is not None:
-+ bad_peer_addresses.add(bad_share.peer_addr)
- if p2pool.DEBUG:
- print "BAD", bad
- self.remove(bad)
-@@ -527,7 +531,7 @@ class OkayTracker(forest.Tracker):
- for peer_addr, hash, ts, targ in desired:
- print ' ', None if peer_addr is None else '%s:%i' % peer_addr, format_hash(hash), math.format_dt(time.time() - ts), bitcoin_data.target_to_difficulty(targ), ts >= timestamp_cutoff, targ <= target_cutoff
-
-- return best, [(peer_addr, hash) for peer_addr, hash, ts, targ in desired if ts >= timestamp_cutoff], decorated_heads
-+ return best, [(peer_addr, hash) for peer_addr, hash, ts, targ in desired if ts >= timestamp_cutoff], decorated_heads, bad_peer_addresses
-
- def score(self, share_hash, block_rel_height_func):
- # returns approximate lower bound on chain's hashrate in the last self.net.CHAIN_LENGTH*15//16*self.net.SHARE_PERIOD time
-diff --git a/p2pool/node.py b/p2pool/node.py
-index 2b25fbe..4a91620 100644
---- a/p2pool/node.py
-+++ b/p2pool/node.py
-@@ -292,16 +292,23 @@ class Node(object):
- stop_signal.watch(t.stop)
-
- def set_best_share(self):
-- best, desired, decorated_heads = self.tracker.think(self.get_height_rel_highest, self.bitcoind_work.value['previous_block'], self.bitcoind_work.value['bits'], self.known_txs_var.value)
-+ best, desired, decorated_heads, bad_peer_addresses = self.tracker.think(self.get_height_rel_highest, self.bitcoind_work.value['previous_block'], self.bitcoind_work.value['bits'], self.known_txs_var.value)
-
- self.best_share_var.set(best)
- self.desired_var.set(desired)
-+ if self.p2p_node is not None:
-+ for bad_peer_address in bad_peer_addresses:
-+ # XXX O(n)
-+ for peer in self.p2p_node.peers.itervalues():
-+ if peer.addr == bad_peer_address:
-+ peer.badPeerHappened()
-+ break
-
- def get_current_txouts(self):
- return p2pool_data.get_expected_payouts(self.tracker, self.best_share_var.value, self.bitcoind_work.value['bits'].target, self.bitcoind_work.value['subsidy'], self.net)
-
- def clean_tracker(self):
-- best, desired, decorated_heads = self.tracker.think(self.get_height_rel_highest, self.bitcoind_work.value['previous_block'], self.bitcoind_work.value['bits'], self.known_txs_var.value)
-+ best, desired, decorated_heads, bad_peer_addresses = self.tracker.think(self.get_height_rel_highest, self.bitcoind_work.value['previous_block'], self.bitcoind_work.value['bits'], self.known_txs_var.value)
-
- # eat away at heads
- if decorated_heads:
-diff --git a/p2pool/p2p.py b/p2pool/p2p.py
-index 707d346..94db442 100644
---- a/p2pool/p2p.py
-+++ b/p2pool/p2p.py
-@@ -94,8 +94,7 @@ class Protocol(p2protocol.Protocol):
- self.badPeerHappened()
-
- def badPeerHappened(self):
-- if p2pool.DEBUG:
-- print "Bad peer banned:", self.addr
-+ print "Bad peer banned:", self.addr
- self.disconnect()
- if self.transport.getPeer().host != '127.0.0.1': # never ban localhost
- self.node.bans[self.transport.getPeer().host] = time.time() + 60*60
---
-1.8.5.2
-
diff --git a/debian/patches/0002-deal-with-inefficiencient-behaviour-when-chain-is-fo.patch b/debian/patches/0002-deal-with-inefficiencient-behaviour-when-chain-is-fo.patch
deleted file mode 100644
index 7cbaa94..0000000
--- a/debian/patches/0002-deal-with-inefficiencient-behaviour-when-chain-is-fo.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 11b0d96235a25f678b74151ac93e7e06a1b60c3c Mon Sep 17 00:00:00 2001
-From: Forrest Voight <forrest at forre.st>
-Date: Sun, 19 Jan 2014 19:20:30 -0500
-Subject: [PATCH 2/4] deal with inefficiencient behaviour when chain is forked
-
----
- p2pool/data.py | 12 +++++++-----
- 1 file changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/p2pool/data.py b/p2pool/data.py
-index 0ce4f7a..0e62a0f 100644
---- a/p2pool/data.py
-+++ b/p2pool/data.py
-@@ -445,15 +445,14 @@ class OkayTracker(forest.Tracker):
- # for each overall head, attempt verification
- # if it fails, attempt on parent, and repeat
- # if no successful verification because of lack of parents, request parent
-- bads = set()
-+ bads = []
- for head in set(self.heads) - set(self.verified.heads):
- head_height, last = self.get_height_and_last(head)
-
- for share in self.get_chain(head, head_height if last is None else min(5, max(0, head_height - self.net.CHAIN_LENGTH))):
- if self.attempt_verify(share):
- break
-- if share.hash in self.heads:
-- bads.add(share.hash)
-+ bads.append(share.hash)
- else:
- if last is not None:
- desired.add((
-@@ -464,13 +463,16 @@ class OkayTracker(forest.Tracker):
- ))
- for bad in bads:
- assert bad not in self.verified.items
-- assert bad in self.heads
-+ #assert bad in self.heads
- bad_share = self.items[bad]
- if bad_share.peer_addr is not None:
- bad_peer_addresses.add(bad_share.peer_addr)
- if p2pool.DEBUG:
- print "BAD", bad
-- self.remove(bad)
-+ try:
-+ self.remove(bad)
-+ except NotImplementedError:
-+ pass
-
- # try to get at least CHAIN_LENGTH height for each verified head, requesting parents if needed
- for head in list(self.verified.heads):
---
-1.8.5.2
-
diff --git a/debian/patches/0003-print-share-hashes-when-share-check-fails.patch b/debian/patches/0003-print-share-hashes-when-share-check-fails.patch
deleted file mode 100644
index e0db967..0000000
--- a/debian/patches/0003-print-share-hashes-when-share-check-fails.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 8c30d486ead72c55906bbb230e78c2fbf75df4a5 Mon Sep 17 00:00:00 2001
-From: Forrest Voight <forrest at forre.st>
-Date: Mon, 20 Jan 2014 02:54:47 -0500
-Subject: [PATCH 3/4] print share hashes when share check fails
-
----
- p2pool/data.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/p2pool/data.py b/p2pool/data.py
-index 0e62a0f..7c44878 100644
---- a/p2pool/data.py
-+++ b/p2pool/data.py
-@@ -430,7 +430,7 @@ class OkayTracker(forest.Tracker):
- try:
- share.check(self)
- except:
-- log.err(None, 'Share check failed:')
-+ log.err(None, 'Share check failed: %064x -> %064x' % (share.hash, share.previous_hash))
- return False
- else:
- self.verified.add(share)
---
-1.8.5.2
-
diff --git a/debian/patches/0004-fixed-possible-crash-introduced-by-prior-commit.patch b/debian/patches/0004-fixed-possible-crash-introduced-by-prior-commit.patch
deleted file mode 100644
index 34c83b9..0000000
--- a/debian/patches/0004-fixed-possible-crash-introduced-by-prior-commit.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 39767a2c7da3b22efc8d90623dcda12b6ab4f419 Mon Sep 17 00:00:00 2001
-From: Forrest Voight <forrest at forre.st>
-Date: Mon, 20 Jan 2014 02:58:25 -0500
-Subject: [PATCH 4/4] fixed possible crash introduced by prior commit
-
----
- p2pool/data.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/p2pool/data.py b/p2pool/data.py
-index 7c44878..e8fe347 100644
---- a/p2pool/data.py
-+++ b/p2pool/data.py
-@@ -430,7 +430,7 @@ class OkayTracker(forest.Tracker):
- try:
- share.check(self)
- except:
-- log.err(None, 'Share check failed: %064x -> %064x' % (share.hash, share.previous_hash))
-+ log.err(None, 'Share check failed: %064x -> %064x' % (share.hash, share.previous_hash if share.previous_hash is not None else 0))
- return False
- else:
- self.verified.add(share)
---
-1.8.5.2
-
diff --git a/debian/patches/debian.patch b/debian/patches/debian.patch
index d03fd9f..8782a0c 100644
--- a/debian/patches/debian.patch
+++ b/debian/patches/debian.patch
@@ -1,22 +1,22 @@
-Last-Update: 2013-12-26
+Last-Update: 2015-07-04
Forwarded: not-needed
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Description: Debianisation
--- a/p2pool/web.py
+++ b/p2pool/web.py
-@@ -442,7 +442,7 @@
+@@ -458,7 +458,7 @@
def _(new_work):
hd.datastreams['getwork_latency'].add_datum(time.time(), new_work['latency'])
new_root.putChild('graph_data', WebInterface(lambda source, view: hd.datastreams[source].dataviews[view].get_data(time.time())))
-- web_root.putChild('static', static.File(os.path.join(os.path.dirname(sys.argv[0]), 'web-static')))
-+ web_root.putChild('static', static.File(os.path.join(os.path.dirname(sys.argv[0]), '/usr/share/p2pool/web-static')))
+- web_root.putChild('static', static.File(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), 'web-static')))
++ web_root.putChild('static', static.File(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), '/usr/share/p2pool/web-static')))
return web_root
--- a/p2pool/main.py
+++ b/p2pool/main.py
-@@ -453,9 +453,9 @@
+@@ -539,9 +539,9 @@
net_name = args.net_name + ('_testnet' if args.testnet else '')
net = networks.nets[net_name]
diff --git a/debian/patches/series b/debian/patches/series
index dfd5d3a..3893360 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1 @@
debian.patch
-0001-ban-peers-that-send-shares-that-fail-to-validate.patch
-0002-deal-with-inefficiencient-behaviour-when-chain-is-fo.patch
-0003-print-share-hashes-when-share-check-fails.patch
-0004-fixed-possible-crash-introduced-by-prior-commit.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/p2pool.git
More information about the Pkg-bitcoin-commits
mailing list