GNU bug report logs - #34170
bitcoin-core bundles leveldb

Previous Next

Package: guix;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Tue, 22 Jan 2019 21:57:01 UTC

Severity: normal

To reply to this bug, email your comments to 34170 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Tue, 22 Jan 2019 21:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 22 Jan 2019 21:57:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: <bug-guix <at> gnu.org>
Subject: bitcoin-core bundles leveldb
Date: Tue, 22 Jan 2019 13:31:24 +0100
[Message part 1 (text/plain, inline)]

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Fri, 03 Dec 2021 10:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 34170 <at> debbugs.gnu.org, contact <at> carldong.me
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Fri, 03 Dec 2021 11:29:35 +0100
Hi,

This old bug#34170 [1] provides only the ’Subject’ as elements.
The package bitcore-core still provides ’leveldb’:

--8<---------------cut here---------------start------------->8---
$ tar xf $(guix build -S bitcoin-core)
$ ls -1 bitcoin-0.21.2/src/leveldb
AUTHORS
benchmarks
cmake
CMakeLists.txt
CONTRIBUTING.md
db
doc
helpers
include
issues
LICENSE
NEWS
port
README.md
table
TODO
util
--8<---------------cut here---------------end--------------->8---

and I am not sure to get what is the issue.  Some explanations?

1: <http://issues.guix.gnu.org/issue/34170>


Cheers,
simon




Reply sent to zimoun <zimon.toutoune <at> gmail.com>:
You have taken responsibility. (Tue, 04 Jan 2022 23:31:02 GMT) Full text and rfc822 format available.

Notification sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
bug acknowledged by developer. (Tue, 04 Jan 2022 23:31:02 GMT) Full text and rfc822 format available.

Message #13 received at 34170-done <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 34170-done <at> debbugs.gnu.org, contact <at> carldong.me
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Wed, 05 Jan 2022 00:29:05 +0100
Hi,

On Fri, 03 Dec 2021 at 11:29, zimoun <zimon.toutoune <at> gmail.com> wrote:

> This old bug#34170 [1] provides only the ’Subject’ as elements.
> The package bitcore-core still provides ’leveldb’:
>
> $ tar xf $(guix build -S bitcoin-core)
> $ ls -1 bitcoin-0.21.2/src/leveldb
> AUTHORS
> benchmarks
> cmake
> CMakeLists.txt
> CONTRIBUTING.md
> db
> doc
> helpers
> include
> issues
> LICENSE
> NEWS
> port
> README.md
> table
> TODO
> util
>
> and I am not sure to get what is the issue.  Some explanations?
>
> 1: <http://issues.guix.gnu.org/issue/34170>

I am closing.  Feel free to reopen if I miss something.


Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Wed, 05 Jan 2022 09:40:02 GMT) Full text and rfc822 format available.

Message #16 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: zimoun <zimon.toutoune <at> gmail.com>, Danny Milosavljevic
 <dannym <at> scratchpost.org>
Cc: 34170 <at> debbugs.gnu.org, contact <at> carldong.me
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Wed, 05 Jan 2022 10:39:19 +0100
[Message part 1 (text/plain, inline)]
zimoun schreef op vr 03-12-2021 om 11:29 [+0100]:
> Hi,
> 
> This old bug#34170 [1] provides only the ’Subject’ as elements.
> The package bitcore-core still provides ’leveldb’:
> 
> [...]
> 
> and I am not sure to get what is the issue.  Some explanations?

The issue is that bitcoin-core bundles leveldb (which you have shown
is still the case), even though leveldb is packaged in Guix. See, e.g.
‘(guix)Snippets versus Phases’ and the following from ‘(guix)Submitting
Patches’:

  7. Make sure the package does not use bundled copies of software
     already available as separate packages.

     Sometimes, packages include copies of the source code of their
     dependencies as a convenience for users.  However, as a
     distribution, we want to make sure that such packages end up using
     the copy we already have in the distribution, if there is one.
     This improves resource usage (the dependency is built and stored
     only once), and allows the distribution to make transverse changes
     such as applying security updates for a given software package in a
     single place and have them affect the whole system—something that
     bundled copies prevent.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 05 Jan 2022 09:41:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Wed, 05 Jan 2022 09:56:01 GMT) Full text and rfc822 format available.

Message #21 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 34170 <at> debbugs.gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>,
 contact <at> carldong.me
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Wed, 05 Jan 2022 10:45:19 +0100
Hi Maxime,

On Wed, 05 Jan 2022 at 10:39, Maxime Devos <maximedevos <at> telenet.be> wrote:

>> The package bitcore-core still provides ’leveldb’:
>>
>> [...]
>>
>> and I am not sure to get what is the issue.  Some explanations?
>
> The issue is that bitcoin-core bundles leveldb (which you have shown
> is still the case), even though leveldb is packaged in Guix.

Thanks, I missed that ’leveldb’ is packaged in Guix.  Indeed, it should
preferably be used.

So reopen. :-)


Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Wed, 05 Jan 2022 17:41:02 GMT) Full text and rfc822 format available.

Message #24 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <contact <at> carldong.me>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 34170 <at> debbugs.gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>,
 Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Wed, 5 Jan 2022 12:40:48 -0500
[Message part 1 (text/plain, inline)]
Simon, Maxime, Danny,

Thanks for CCing me on this message! The rationale for bundling leveldb in Bitcoin Core goes a bit beyond convenience, it is several things:

1. The original reason for sub-treeing is that Bitcoin Core used to maintain its own version of leveldb with its own fixes here: https://github.com/bitcoin-core/leveldb-subtree <https://github.com/bitcoin-core/leveldb-subtree>, since then most of these fixes have been upstreamed as of: https://github.com/bitcoin/bitcoin/pull/17398 <https://github.com/bitcoin/bitcoin/pull/17398>
2. We also used to support using an external leveldb, however, it seems that it was fragile to rely on external projects to maintain ABI compatibility, see the quoted IRC bug report here: https://github.com/bitcoin/bitcoin/pull/23282 <https://github.com/bitcoin/bitcoin/pull/23282>. Reasonable minds may disagree on this point, especially coming from Guix where patching is convenient.

In addition to the above, Bitcoin Core experienced a hard fork in 2013 due to database incompatibilities, which has predisposed maintainers towards a more stringent approach with pinning dependencies and their configure/build-time flags. See: https://blog.bitmex.com/bitcoins-consensus-forks/#was-the-2013-incident-a-hardfork <https://blog.bitmex.com/bitcoins-consensus-forks/#was-the-2013-incident-a-hardfork>

Let me know if I can provide more context!

Cheers,
Carl Dong

> On Jan 5, 2022, at 4:45 AM, zimoun <zimon.toutoune <at> gmail.com> wrote:
> 
> Hi Maxime,
> 
> On Wed, 05 Jan 2022 at 10:39, Maxime Devos <maximedevos <at> telenet.be> wrote:
> 
>>> The package bitcore-core still provides ’leveldb’:
>>> 
>>> [...]
>>> 
>>> and I am not sure to get what is the issue.  Some explanations?
>> 
>> The issue is that bitcoin-core bundles leveldb (which you have shown
>> is still the case), even though leveldb is packaged in Guix.
> 
> Thanks, I missed that ’leveldb’ is packaged in Guix.  Indeed, it should
> preferably be used.
> 
> So reopen. :-)
> 
> 
> Cheers,
> simon

[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Wed, 05 Jan 2022 19:15:02 GMT) Full text and rfc822 format available.

Message #27 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Carl Dong <contact <at> carldong.me>, zimoun <zimon.toutoune <at> gmail.com>
Cc: 34170 <at> debbugs.gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Wed, 05 Jan 2022 19:13:57 +0000
[Message part 1 (text/plain, inline)]
Hi,

Carl Dong schreef op wo 05-01-2022 om 12:40 [-0500]:
> Simon, Maxime, Danny,
> 
> Thanks for CCing me on this message! The rationale for bundling
> leveldb in Bitcoin Core goes a bit beyond convenience, it is several
> things:
> 
> 1. The original reason for sub-treeing is that Bitcoin Core used to
> maintain its own version of leveldb with its own fixes
> here: https://github.com/bitcoin-core/leveldb-subtree, since then
> most of these fixes have been upstreamed as
> of: https://github.com/bitcoin/bitcoin/pull/17398

Seems reasonable to me, but the bitcoin project is upstreaming the
changes it made and most are already upstream, so I would prefer
to use upstream's leveldb.

> 2. We also used to support using an external leveldb, however, it
> seems that it was fragile to rely on external projects to maintain
> ABI compatibility, see the quoted IRC bug report
> here: https://github.com/bitcoin/bitcoin/pull/23282. Reasonable minds
> may disagree on this point, especially coming from Guix where
> patching is convenient.

The quoted ABI incompatibility

    <Talkless> bitcoind fails to start with undefined symbol:
_ZTIN7leveldb6LoggerE in Debian Sid after leveldb upgraded from 1.22 to
1.23: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996486

doesn't apply in Guix, because guix uses RUNPATH and multiple library
versions can exist in the same store (in different directories in the
store).

> In addition to the above, Bitcoin Core experienced a hard fork in
> 2013 due to database incompatibilities, which has predisposed
> maintainers towards a more stringent approach with pinning
> dependencies and their configure/build-time flags.
> See: https://blog.bitmex.com/bitcoins-consensus-forks/#was-the-2013-
> incident-a-hardfork

I doubt that Guix has sufficient Bitcoin Core users to cause
a hard fork, but yes, this is an understandable reason to bundle
things.  But any such problem seems easy to resolve (at the guix side):
we could simply temporarily switch to an older version of leveldb.

If desired, it would also be possible to do something in-between
unbundling and using bitcoin's leveldb: define a 'leveldb/bitcoin'
variant of the 'leveldb' package (using package/inherit or (package
(inherit ...) ...)), add it as input to the 'bitcoin' package and tell
and/or patch bitcoin's buid scripts to use that leveldb.

As source code, use an appropriate commit from
<https://github.com/bitcoin-core/leveldb-subtree> (and add a comment
to the definition of bitcoin-core to keep leveldb/bitcoin in-sync).

A benefit of this approach (if done properly, with (origin (inherit
...) ...) such that patches of 'leveldb' are inherited) above the
status quo, is that is that if for some reason 'leveldb' is patched in
Guix, then 'leveldb/bitcoin' receives the patch as well. Another
benefit is that the dependency 'googletest' and 'benchmark' of leveldb
would remain unbundled.

Greetings,
Maxime.

[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Fri, 07 Jan 2022 00:18:01 GMT) Full text and rfc822 format available.

Message #30 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <contact <at> carldong.me>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 34170 <at> debbugs.gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>,
 zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Thu, 6 Jan 2022 19:17:13 -0500
[Message part 1 (text/plain, inline)]
> If desired, it would also be possible to do something in-between
> unbundling and using bitcoin's leveldb: define a 'leveldb/bitcoin'
> variant of the 'leveldb' package (using package/inherit or (package
> (inherit ...) ...)), add it as input to the 'bitcoin' package and tell
> and/or patch bitcoin's buid scripts to use that leveldb.
Yes I think that would be a splendid idea! With regards to patching bitcoin’s builds scripts, Bitcoin Knots follows Bitcoin Core closely, but has a bunch of patches which allow for using system libs, so that might be good to reference: https://github.com/bitcoin/bitcoin/compare/master...bitcoinknots:21.x-syslibs <https://github.com/bitcoin/bitcoin/compare/master...bitcoinknots:21.x-syslibs>

> As source code, use an appropriate commit from
> <https://github.com/bitcoin-core/leveldb-subtree> (and add a comment
> to the definition of bitcoin-core to keep leveldb/bitcoin in-sync).

FYI, according to https://github.com/bitcoin/bitcoin/pull/17398 <https://github.com/bitcoin/bitcoin/pull/17398>, we are currently using the upstream LevelDB commit 0c40829872a9f00f38e11dc370ff8adb3e19f25b

Cheers,
Carl Dong


> On Jan 5, 2022, at 2:13 PM, Maxime Devos <maximedevos <at> telenet.be> wrote:
> 
> Hi,
> 
> Carl Dong schreef op wo 05-01-2022 om 12:40 [-0500]:
>> Simon, Maxime, Danny,
>> 
>> Thanks for CCing me on this message! The rationale for bundling
>> leveldb in Bitcoin Core goes a bit beyond convenience, it is several
>> things:
>> 
>> 1. The original reason for sub-treeing is that Bitcoin Core used to
>> maintain its own version of leveldb with its own fixes
>> here: https://github.com/bitcoin-core/leveldb-subtree, since then
>> most of these fixes have been upstreamed as
>> of: https://github.com/bitcoin/bitcoin/pull/17398
> 
> Seems reasonable to me, but the bitcoin project is upstreaming the
> changes it made and most are already upstream, so I would prefer
> to use upstream's leveldb.
> 
>> 2. We also used to support using an external leveldb, however, it
>> seems that it was fragile to rely on external projects to maintain
>> ABI compatibility, see the quoted IRC bug report
>> here: https://github.com/bitcoin/bitcoin/pull/23282. Reasonable minds
>> may disagree on this point, especially coming from Guix where
>> patching is convenient.
> 
> The quoted ABI incompatibility
> 
>    <Talkless> bitcoind fails to start with undefined symbol:
> _ZTIN7leveldb6LoggerE in Debian Sid after leveldb upgraded from 1.22 to
> 1.23: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996486
> 
> doesn't apply in Guix, because guix uses RUNPATH and multiple library
> versions can exist in the same store (in different directories in the
> store).
> 
>> In addition to the above, Bitcoin Core experienced a hard fork in
>> 2013 due to database incompatibilities, which has predisposed
>> maintainers towards a more stringent approach with pinning
>> dependencies and their configure/build-time flags.
>> See: https://blog.bitmex.com/bitcoins-consensus-forks/#was-the-2013-
>> incident-a-hardfork
> 
> I doubt that Guix has sufficient Bitcoin Core users to cause
> a hard fork, but yes, this is an understandable reason to bundle
> things.  But any such problem seems easy to resolve (at the guix side):
> we could simply temporarily switch to an older version of leveldb.
> 
> If desired, it would also be possible to do something in-between
> unbundling and using bitcoin's leveldb: define a 'leveldb/bitcoin'
> variant of the 'leveldb' package (using package/inherit or (package
> (inherit ...) ...)), add it as input to the 'bitcoin' package and tell
> and/or patch bitcoin's buid scripts to use that leveldb.
> 
> As source code, use an appropriate commit from
> <https://github.com/bitcoin-core/leveldb-subtree> (and add a comment
> to the definition of bitcoin-core to keep leveldb/bitcoin in-sync).
> 
> A benefit of this approach (if done properly, with (origin (inherit
> ...) ...) such that patches of 'leveldb' are inherited) above the
> status quo, is that is that if for some reason 'leveldb' is patched in
> Guix, then 'leveldb/bitcoin' receives the patch as well. Another
> benefit is that the dependency 'googletest' and 'benchmark' of leveldb
> would remain unbundled.
> 
> Greetings,
> Maxime.
> 

[Message part 2 (text/html, inline)]
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#34170; Package guix. (Wed, 13 Jul 2022 15:11:01 GMT) Full text and rfc822 format available.

Message #33 received at 34170 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Carl Dong <contact <at> carldong.me>
Cc: 34170 <at> debbugs.gnu.org, Danny Milosavljevic <dannym <at> scratchpost.org>,
 Maxime Devos <maximedevos <at> telenet.be>, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#34170: bitcoin-core bundles leveldb
Date: Wed, 13 Jul 2022 11:10:42 -0400
Hi Carl,

Carl Dong <contact <at> carldong.me> writes:

>> If desired, it would also be possible to do something in-between
>> unbundling and using bitcoin's leveldb: define a 'leveldb/bitcoin'
>> variant of the 'leveldb' package (using package/inherit or (package
>> (inherit ...) ...)), add it as input to the 'bitcoin' package and tell
>> and/or patch bitcoin's buid scripts to use that leveldb.
> Yes I think that would be a splendid idea! With regards to patching
> bitcoin’s builds scripts, Bitcoin Knots follows Bitcoin Core closely,
> but has a bunch of patches which allow for using system libs, so that
> might be good to reference:
> https://github.com/bitcoin/bitcoin/compare/master...bitcoinknots:21.x-syslibs
> <https://github.com/bitcoin/bitcoin/compare/master...bitcoinknots:21.x-syslibs>
>
>> As source code, use an appropriate commit from
>> <https://github.com/bitcoin-core/leveldb-subtree> (and add a comment
>> to the definition of bitcoin-core to keep leveldb/bitcoin in-sync).
>
> FYI, according to https://github.com/bitcoin/bitcoin/pull/17398
> <https://github.com/bitcoin/bitcoin/pull/17398>, we are currently
> using the upstream LevelDB commit
> 0c40829872a9f00f38e11dc370ff8adb3e19f25b

Would you like to give the idea discussed above a try and send a patch?
That'd bring closure to this old issue :-).

Thanks,

Maxim




This bug report was last modified 2 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.