ldoge / LDOGE

LITEDOGE - Proof of Stake: 2.0 Proof, of work: Scrypt
https://litedogeofficial.org
MIT License
40 stars 21 forks source link

OpenSSL1.1.1 and Boost 1.70+ #27

Closed nerdcorenet closed 3 years ago

nerdcorenet commented 3 years ago

OS: Ubuntu 20.04 CPU: amd64 OpenSSL: 1.1.1f Boost: 1.71

I checked out tags/3.5.0.0 received the following error during make -f makefile.unix:

LDOGE/src$ make -f makefile.unix
g++ -c -O2  -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -I/mnt/mirror/src/git/vashshawn/LDOGE/src -I/mnt/mirror/src/git/vashshawn/LDOGE/src/obj -DUSE_UPNP=0 -DENABLE_WALLET -I/mnt/mirror/src/git/vashshawn/LDOGE/src/leveldb/include -I/mnt/mirror/src/git/vashshawn/LDOGE/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -fPIE -D_FORTIFY_SOURCE=2  -MMD -MF obj/alert.d -o obj/alert.o alert.cpp
In file included from chainparams.h:9,
                 from alert.cpp:7:
bignum.h:57:24: error: invalid use of incomplete type ‘BIGNUM’ {aka ‘struct bignum_st’}
   57 | class CBigNum : public BIGNUM
      |                        ^~~~~~
In file included from /usr/include/openssl/crypto.h:25,
                 from allocators.h:16,
                 from serialize.h:24,
                 from alert.h:9,
                 from alert.cpp:5:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM’ {aka ‘struct bignum_st’}
   80 | typedef struct bignum_st BIGNUM;
      |                ^~~~~~~~~
In file included from chainparams.h:9,
                 from alert.cpp:7:
bignum.h: In constructor ‘CBigNum::CBigNum()’:
bignum.h:62:9: error: ‘BN_init’ was not declared in this scope
   62 |         BN_init(this);
      |         ^~~~~~~
bignum.h: In copy constructor ‘CBigNum::CBigNum(const CBigNum&)’:
bignum.h:67:9: error: ‘BN_init’ was not declared in this scope
   67 |         BN_init(this);
      |         ^~~~~~~
bignum.h:68:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM*’ {aka ‘bignum_st*’}
   68 |         if (!BN_copy(this, &b))
      |                              ^
      |                              |
      |                              CBigNum*
In file included from bignum.h:13,
                 from chainparams.h:9,
                 from alert.cpp:7:
/usr/include/openssl/bn.h:219:25: note:   initializing argument 1 of ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
  219 | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
      |                 ~~~~~~~~^
In file included from chainparams.h:9,
                 from alert.cpp:7:

This seems to require an update from OpenSSL 1.0.2 to 1.1.1 which reached EOL at the end of 2019. This commit from CureCoin seems useful: https://github.com/cygnusxi/CurecoinSource/commit/6b93af07005b90e4f6c5785c60c10c36fa52a333

I started to apply those changes but I'm not sure what to do about this:

rpcclient.cpp: In function ‘json_spirit::Object CallRPC(const string&, const Array&)’:
rpcclient.cpp:44:58: error: no matching function for call to ‘boost::asio::ssl::context::context(boost::asio::io_service&, boost::asio::ssl::context_base::method)’
   44 |     ssl::context context(io_service, ssl::context::sslv23);
      |                                                          ^
In file included from /usr/include/boost/asio/ssl/context.hpp:757,
                 from /usr/include/boost/asio/ssl.hpp:18,
                 from rpcprotocol.h:18,
                 from rpcclient.cpp:9:
/usr/include/boost/asio/ssl/impl/context.ipp:371:1: note: candidate: ‘boost::asio::ssl::context::context(boost::asio::ssl::context&&)’
  371 | context::context(context&& other)
      | ^~~~~~~
/usr/include/boost/asio/ssl/impl/context.ipp:371:1: note:   candidate expects 1 argument, 2 provided
/usr/include/boost/asio/ssl/impl/context.ipp:63:1: note: candidate: ‘boost::asio::ssl::context::context(boost::asio::ssl::context_base::method)’
   63 | context::context(context::method m)
      | ^~~~~~~
/usr/include/boost/asio/ssl/impl/context.ipp:63:1: note:   candidate expects 1 argument, 2 provided

I'm not sure what to do with https://github.com/nerdcorenet/LDOGE/blob/ssl%2Bboost/src/rpcclient.cpp#L44

For reference, the Boost 1.70 doc for ssl::context::context is here

ftab commented 3 years ago

May have to refactor the code a little bit to match the different interfaces.

https://github.com/cygnusxi/CurecoinSource/blob/6b93af07005b90e4f6c5785c60c10c36fa52a333/src/curecoinrpc.cpp#L758

nerdcorenet commented 3 years ago

commit 84bdccbfc2b17a598e424316fd32066a9724fcf2 resolves some of these issues though I cannot guarantee the resolution is correct or sane. ;)

Getting the following issues when trying to launch litedoged:

$ ./litedoged -datadir=/mnt/chains/litedogetest -testnet
Error: Error initializing wallet database environment /mnt/chains/litedogetest/testnet!
$ cat /mnt/chains/litedogetest/testnet/debug.log
LiteDoge version v3.5.0.0LiteDoge (2021-01-09 22:56:31 -0500)
Using OpenSSL version OpenSSL 1.1.1f  31 Mar 2020
Using BerkeleyDB version Berkeley DB 5.3.28: (September  9, 2013)
Startup time: 03/13/21 17:51:40
Default data directory /home/mike/.litedoge
Used data directory /mnt/chains/litedogetest/testnet
init message: Verifying database integrity...
dbenv.open LogDir=/mnt/chains/litedogetest/testnet/database ErrorFile=/mnt/chains/litedogetest/testnet/db.log
ERROR: CDB() : error Invalid argument (22) opening database environment
Moved old /mnt/chains/litedogetest/testnet/database to /mnt/chains/litedogetest/testnet/database.1615657900.bak. Retrying.
dbenv.open LogDir=/mnt/chains/litedogetest/testnet/database ErrorFile=/mnt/chains/litedogetest/testnet/db.log
ERROR: CDB() : error Invalid argument (22) opening database environment
: Error initializing wallet database environment /mnt/chains/litedogetest/testnet!
Shutdown : In progress...
StopNode()
Shutdown : done