Skip to content

Commit

Permalink
feat: split MONERO and WOWNERO prefixed functions
Browse files Browse the repository at this point in the history
So basically: when we open the .so file, we define some
symbols, and it appears that if we load something else,
with the same symbols, under the same thread we cause
some funky behaviour - like calling function a wownero
function MONERO_Wallet_address() resulting in a monero
address being generated.
Needless to say, this is undesired, and a blocker for
cypherstack/stack_wallet#818

I'm afraid that this may not solve all of our issues (but
will solve some significant roadblocks), because of the
"genesis block" issue, as output of
nm -gDC release/wownero/x86_64-linux-gnu_libwallet2_api_c.so | grep genesis
indicate that these functions may share *something* in
common across both WOW and XMR libraries.
In a case in which this fix won't be sufficient, I think that
the way forward would be to close the dynamic libraries,
but before we do that I want to check if maybe there is
a change to run multiple wallets at once.
  • Loading branch information
MrCyjaneK committed Mar 31, 2024
1 parent b034340 commit b72d2df
Show file tree
Hide file tree
Showing 14 changed files with 2,642 additions and 28 deletions.
16 changes: 2 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
boost_*
libexpat
libiconv-*
libsodium*
libzmq*
openssl-*
polyseed*
unbound*
utf8proc*
zlib*

perl-*

prefix
release/
build/
10 changes: 5 additions & 5 deletions build_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ set -e
repo=$1
if [[ "x$repo" == "x" ]];
then
echo "Usage: $0 monero/wownero"
echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)"
exit 1
fi

if [[ "x$repo" != "xwownero" && "x$repo" != "xmonero" ]];
then
echo "Usage: $0 monero/wownero"
echo "Usage: $0 monero/wownero $(gcc -dumpmachine) -j$(nproc)"
echo "Invalid target given, only monero and wownero are supported targets"
fi

Expand Down Expand Up @@ -165,7 +165,7 @@ then
${HOST_ABI}-ranlib $PWD/$repo/contrib/depends/${HOST_ABI}/lib/libpolyseed.a
fi

pushd libbridge
pushd ${repo}_libwallet2_api_c
rm -rf build/${HOST_ABI} || true
mkdir -p build/${HOST_ABI} -p
cd build/${HOST_ABI}
Expand All @@ -189,8 +189,8 @@ pushd release/$repo
else
APPENDIX="${APPENDIX}so"
fi
xz -e ../../libbridge/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}
mv ../../libbridge/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz
xz -e ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}
mv ../../${repo}_libwallet2_api_c/build/${HOST_ABI}/libwallet2_api_c.${APPENDIX}.xz ${HOST_ABI}_libwallet2_api_c.${APPENDIX}.xz
# Extra libraries
if [[ "$HOST_ABI" == "x86_64-w64-mingw32" || "$HOST_ABI" == "i686-w64-mingw32" ]];
then
Expand Down
1 change: 0 additions & 1 deletion libbridge/.dockerignore

This file was deleted.

1 change: 0 additions & 1 deletion libbridge/.gitignore

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
#include "helpers.hpp"
#include <cstring>
#include <thread>

#ifdef FLAVOR_MONERO
#include "../../../../monero/src/wallet/api/wallet2_api.h"
#endif

#ifdef FLAVOR_WOWNERO
#include "../../../../wownero/src/wallet/api/wallet2_api.h"
#endif


#ifdef __cplusplus
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions wownero_libwallet2_api_c/CMakeLists.txt
1 change: 1 addition & 0 deletions wownero_libwallet2_api_c/src/main/cpp/helpers.cpp
1 change: 1 addition & 0 deletions wownero_libwallet2_api_c/src/main/cpp/helpers.hpp
1,651 changes: 1,651 additions & 0 deletions wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp

Large diffs are not rendered by default.

Loading

0 comments on commit b72d2df

Please sign in to comment.