Files
thehub/libs/utils/CMakeLists.txt
tomFlowee 562eba5b64 Make outscript usage shallow
The new SIGHASH_UTXO has a possible attack vector where prepared huge
outputs are used and required to be hashed for the signing preimage.
At most you can force the full node to prepare 20GB of (utxo) data
_prior_ to creation of the preimage. Which is a big issue when it comes
to memory usage of the node.
What this change does is we ensure that the class used for this data is
a ConstBuf as given to us from the utxo. Which are just pointers and not
full data, the data is memory mapped.
So we ensure shallow copies to avoid actually requiring the data to be
in memory until the point where it is used. And it can get swapped out
immediately after.

This ensures we are immune to the SIGHASH_UTXO attack vector.
2026-05-12 15:46:48 +02:00

139 lines
3.7 KiB
CMake

# This file is part of the Flowee project
# Copyright (C) 2018-2021 Tom Zander <tom@flowee.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
include_directories(${LIBUTILS_INCLUDES} ${CMAKE_BINARY_DIR}/include)
add_library(flowee_utils STATIC
amount.cpp
arith_uint256.cpp
base58.cpp
bloom.cpp
cashaddr.cpp
chainparamsbase.cpp
clientversion.cpp
compat/glibc_sanity.cpp
compat/glibcxx_sanity.cpp
compat/strnlen.cpp
hash.cpp
HDMasterKey.cpp
HDMasterPubkey.cpp
LogChannels.cpp
Logger.cpp
Message.cpp
merkle.cpp
merkleblock.cpp
PartialMerkleTree.cpp
prevector.cpp
random.cpp
StringUtils.cpp
script/interpreter.cpp
script/script_error.cpp
streaming/BindingMessageParser.cpp
streaming/BufferPool.cpp
streaming/BufferPools.cpp
streaming/ConstBuffer.cpp
streaming/MessageBuilder.cpp
streaming/MessageParser.cpp
streaming/P2PBuilder.cpp
streaming/P2PParser.cpp
streaming/ProtoParser.cpp
streaming/ProtoBuilder.cpp
streaming/StreamingUtils.cpp
support/cleanse.cpp
support/lockedpool.cpp
sync.cpp
TransactionBuilder.cpp
primitives/MutableBlock.cpp
primitives/Block.cpp
primitives/BlockHeader.cpp
primitives/Tx.cpp
primitives/PrivateKey.cpp
primitives/PublicKey.cpp
primitives/PublicKeyUtils.cpp
primitives/script.cpp
primitives/transaction.cpp
uint256.cpp
utilmoneystr.cpp
utilstrencodings.cpp
utiltime.cpp
WorkerThreads.cpp
WaitUntilFinishedHelper.cpp
)
# allow usage in dlls
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
target_link_libraries(flowee_utils secp256k1 flowee_interfaces flowee_crypto)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libflowee_utils.a DESTINATION lib)
install(FILES
arith_uint256.h
base58.h
bloom.h
cashaddr.h
compat.h
hash.h
HDMasterKey.h
HDMasterPubkey.h
Logger.h
LogChannel.h
merkle.h
Message.h
PartialMerkleTree.h
prevector.h
random.h
serialize.h
StringUtils.h
Streaming.h
tinyformat.h
TransactionBuilder.h
uint256.h
WorkerThreads.h
DESTINATION include/flowee/utils/)
install(FILES
streaming/BindingMessageParser.h
streaming/BufferPool.h
streaming/BufferPools.h
streaming/ConstBuffer.h
streaming/MessageBuilder.h
streaming/MessageParser.h
streaming/P2PParser.h
streaming/P2PBuilder.h
streaming/ProtoBuilder.h
streaming/ProtoParser.h
streaming/StreamingUtils.h
DESTINATION include/flowee/utils/streaming)
install(FILES
#primitives/MutableBlock.h
#primitives/Block.h
#primitives/BlockHeader.h
primitives/Tx.h
primitives/PrivateKey.h
primitives/PublicKey.h
primitives/PublicKeyUtils.h
primitives/script.h
#primitives/transaction.h
DESTINATION include/flowee/utils/primitives)
install(FILES
script/interpreter.h
script/script_error.h
DESTINATION include/flowee/utils/script)
install(FILES support/allocators/secure.h DESTINATION include/flowee/utils/support/allocators)
install(FILES support/lockedpool.h support/cleanse.h DESTINATION include/flowee/utils/support)