summaryrefslogtreecommitdiff
path: root/e6/930c99400f5296e4b7424f6b2e4c6754bf8ecb
blob: c3849bc9ffece732d9c94abdeac858bde9ec4a95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Return-Path: <antoniy@lbry.io>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id D3D2D11DD
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 30 Jan 2019 14:24:33 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com
	[209.85.167.180])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6A7A41FB
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 30 Jan 2019 14:24:33 +0000 (UTC)
Received: by mail-oi1-f180.google.com with SMTP id c206so19375952oib.0
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 30 Jan 2019 06:24:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lbry.io; s=google;
	h=mime-version:from:date:message-id:subject:to;
	bh=fkPi2Nj2XOw5OmUKaEpNb8bz/deR1QCI47XhxQ9MT4E=;
	b=CKxvOiSHF6uKMKZcfiQGCSIY8TOzNepzDoQkAn0BIc6wlHb4jteKFIkVgzIsIZKt+7
	3o2aHaFBHxUBp/mUT9J3rpxfgyhXasO7HKVEx8KbHAlWjZcPfhC8bQQjw5aIXi7BEbYK
	VVwrG0eSvo+F7CFoJpDVRardYBgepy/MWZn2G2Kel46FTmjIUU/inhUWLJSUC6jdnhzi
	r+jtb8TzsZucPE4nsb8AXU9NiRRQFUhELRDEJtdCOL7w0op6iX2M7Y/zuGOKAnF4OVWK
	xAJCIF/WRRwQkwZlLdjIBsv/bCbiYc817Nd71KrkawFUmcL3Akh5tf+125Ovj6q7ksh8
	Jqgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=fkPi2Nj2XOw5OmUKaEpNb8bz/deR1QCI47XhxQ9MT4E=;
	b=S9YW9jTRv2tUYwnzshhJQXp7QniZ++jeD42Xrffy+RUDjwrEpwwYTcdyFhlq5E9y3H
	eRgL2XwqWI/4tJGE6lW876urL+2KzaMiS/wEdrZzfr8vkCWysYZl8HDfzPqA2xwuBRYo
	gc8hVn0bcg1IdOVwgY9Kn+ZPHRGNNmS5fkmieZSwJgaGRNxytx3yPX2IM9igWWdDESGc
	8F0ZFCXRtX9cBq9ed0RddgCslq8mlbVpdYnr75EeSX7AK4YpxpzKBgEJxCxx+/C/k+cg
	HLo96kMGOOFWbtLVZz7KAH8oa8PKgEi3v/Xa3DQSOpxijOEbQuF48oX40vYr/8N0zFRa
	RP5w==
X-Gm-Message-State: AHQUAub8KGbwb85rTtlRQWmTYL5uQlcCO59rgvCtP+bChl2kUvWnWBo9
	trW3IAXwSwRfn5dUe9q9+FTD4eZrZEB6IJbJJe4LFIBewxjbuA==
X-Google-Smtp-Source: ALg8bN5aVahQV0M3D6AYq+PW6rNxkt9cCyFd2Gtz2dRvBrDGwlyB6o4n+h0XK9iyuWRFd3hhs+Rs4pdghcJ4MfWipvE=
X-Received: by 2002:aca:c649:: with SMTP id w70mr12625660oif.186.1548858272461;
	Wed, 30 Jan 2019 06:24:32 -0800 (PST)
MIME-Version: 1.0
From: Antoniy Shumanov <antoniy@lbry.io>
Date: Wed, 30 Jan 2019 16:24:21 +0200
Message-ID: <CAAdU4QpePWKmDZL65Agyd9CTWHooAy8wDtgu0TF8kFZvDZ_-JQ@mail.gmail.com>
To: bitcoin-dev@lists.linuxfoundation.org
Content-Type: multipart/alternative; boundary="0000000000002348bb0580adab83"
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Wed, 30 Jan 2019 14:52:42 +0000
Subject: [bitcoin-dev] Contribution
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Wed, 30 Jan 2019 14:24:34 -0000

--0000000000002348bb0580adab83
Content-Type: text/plain; charset="UTF-8"

Hi, bitcoin devs. I'm working at lbry.io and we stay closely to your core,
i want to discuss what you think about a contribution like:
base_blob and/or base_uint to be derived from std::array to be enabled move
semantics, as well on uint160, uint256, COutPoint.
Another approach that bother me is acquiring / releasing recursive mutex in
a loop, snippet from minig.cpp
while (nHeight < nHeightEnd && !ShutdownRequested())
{
    std::unique_ptr<CBlockTemplate>

pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript));
    CBlock *pblock = &pblocktemplate->block;
    {
        LOCK(cs_main); // <--------- acquiring
        IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce);
    } // <-------- release
    std::shared_ptr<const CBlock> shared_pblock =
    std::make_shared<const CBlock>(*pblock);
    if (!ProcessNewBlock(Params(), shared_pblock, true, nullptr)) // <----
acquiring / release again inside
}
Doing it in a loop makes things to be slow down even more, what's idea
behind?
Also consider using of atomic global variable rather than acquiring mutex
again, no?
Did you interested in contribution in these approaches?

Regards
Antoniy Shumanov

--0000000000002348bb0580adab83
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>Hi, bitcoin devs. I&#39;m working at=
 <a href=3D"http://lbry.io">lbry.io</a> and we stay closely to your core,</=
div><div>i want to discuss what you think about a contribution like:</div><=
div>base_blob and/or base_uint to be derived from std::array to be enabled =
move</div><div>semantics, as well on uint160, uint256, COutPoint.</div><div=
>Another approach that bother me is acquiring / releasing recursive mutex i=
n a loop, snippet from minig.cpp</div><div>while (nHeight &lt; nHeightEnd &=
amp;&amp; !ShutdownRequested())</div><div>{</div><div>=C2=A0 =C2=A0 std::un=
ique_ptr&lt;CBlockTemplate&gt;</div><div>=C2=A0 =C2=A0 pblocktemplate(Block=
Assembler(Params()).CreateNewBlock(coinbaseScript-&gt;reserveScript));<br><=
/div><div>=C2=A0 =C2=A0 CBlock *pblock =3D &amp;pblocktemplate-&gt;block;</=
div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 LOCK(cs_main=
); // &lt;--------- acquiring</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 Increme=
ntExtraNonce(pblock, chainActive.Tip(), nExtraNonce);</div><div>=C2=A0 =C2=
=A0 } // &lt;-------- release</div><div>=C2=A0 =C2=A0 std::shared_ptr&lt;co=
nst CBlock&gt; shared_pblock =3D</div><div>=C2=A0 =C2=A0 std::make_shared&l=
t;const CBlock&gt;(*pblock);</div><div>=C2=A0 =C2=A0 if (!ProcessNewBlock(P=
arams(), shared_pblock, true, nullptr)) // &lt;---- acquiring / release aga=
in inside</div><div>}</div><div>Doing it in a loop makes things to be slow =
down even more, what&#39;s idea behind?</div><div>Also consider using of at=
omic global variable rather than acquiring mutex again, no?</div><div>Did y=
ou interested in contribution in these approaches?</div><div><br></div><div=
>Regards</div><div>Antoniy Shumanov</div></div></div>

--0000000000002348bb0580adab83--