bitcoin/src
Ava Chow 55cf34a5c3
Merge bitcoin/bitcoin#30047: refactor: Model the bech32 charlimit as an Enum
7f3f6c6dc8 refactor: replace hardcoded numbers (Lőrinc)
5676aec1e1 refactor: Model the bech32 charlimit as an Enum (josibake)

Pull request description:

  Broken out from #28122

  ---

  Bech32(m) was defined with a 90 character limit so that certain guarantees for error detection could be made for segwit addresses (see https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#checksum-design).

  However, there is nothing about the encoding scheme itself that requires a limit of 90 and in practice bech32(m) is being used without the 90 char limit (e.g. lightning invoices, silent payments). Further, increasing the character limit doesn't do away with error detection, it simply changes the guarantee.

  The primary motivation for this change is for being able to parse BIP352 v0 silent payment addresses (see 622c7a98b9), which require up to 118 characters. In addition to BIP352, modeling the character limit as an enum allows us to easily support new address types that use bech32m and specify their own character limit.

ACKs for top commit:
  paplorinc:
    re-ACK 7f3f6c6dc8
  achow101:
    ACK 7f3f6c6dc8
  theuni:
    utACK 7f3f6c6dc8

Tree-SHA512: 9c793d657448c1f795093b9f7d4d6dfa431598f48d54e1c899a69fb2f43aeb68b40ca2ff08864eefeeb6627d4171877234b5df0056ff2a2b84415bc3558bd280
2024-06-04 20:32:25 -04:00
..
bench Merge bitcoin/bitcoin#28366: Fix waste calculation in SelectionResult 2024-06-04 18:37:18 -04:00
common Merge bitcoin/bitcoin#27064: system: use %LOCALAPPDATA% as default datadir on windows 2024-05-23 12:11:55 -04:00
compat netbase: refactor CreateSock() to accept sa_family_t 2024-03-01 13:13:07 -05:00
config
consensus Include version.h in fewer places 2023-11-16 11:36:22 +10:00
crc32c Update crc32c subtree to latest upstream master 2024-02-27 18:28:19 +00:00
crypto crypto: disable asan for sha256_sse4 with clang and -O0 2024-05-15 13:50:25 +00:00
index index: race fix, lock cs_main while 'm_synced' is subject to change 2024-04-17 17:24:05 -03:00
init build: remove --enable-threadlocal 2024-05-21 10:29:51 +01:00
interfaces wallet: return and display signer error 2024-04-16 17:47:43 +02:00
ipc multiprocess: Add type conversion code for UniValue types 2023-11-28 12:35:50 -05:00
kernel assumeutxo: Add network magic ctor param to SnapshotMetadata 2024-05-24 18:44:02 +02:00
leveldb Update leveldb-subtree subtree to latest upstream 2022-09-29 16:43:30 +01:00
logging Use steady clock for logging timer 2023-01-31 18:48:50 +01:00
minisketch Update minisketch subtree to latest master 2024-04-12 14:27:45 +02:00
node assumeutxo: Add network magic ctor param to SnapshotMetadata 2024-05-24 18:44:02 +02:00
policy Merge bitcoin/bitcoin#29873: policy: restrict all TRUC (v3) transactions to 10kvB 2024-05-23 11:54:18 -04:00
primitives Merge bitcoin/bitcoin#28929: serialization: Support for multiple parameters 2024-05-15 15:09:56 -04:00
qt Merge bitcoin/bitcoin#30049: build, test, doc: Temporarily remove Android-related stuff 2024-05-30 09:25:42 +01:00
rpc Merge bitcoin/bitcoin#29997: rpc: Remove index-based Arg accessor 2024-06-04 20:11:59 -04:00
script miniscript: make operator_mst consteval 2024-05-03 11:38:14 -04:00
secp256k1 Update libsecp256k1 subtree to latest master 2024-05-16 10:35:52 +08:00
support scripted-diff: Fix bitcoin_config_h includes 2024-02-13 20:10:44 +00:00
test Merge bitcoin/bitcoin#29997: rpc: Remove index-based Arg accessor 2024-06-04 20:11:59 -04:00
univalue test: Fix failing univalue float test 2024-04-16 16:35:12 +02:00
util build: remove --enable-threadlocal 2024-05-21 10:29:51 +01:00
wallet Merge bitcoin/bitcoin#29997: rpc: Remove index-based Arg accessor 2024-06-04 20:11:59 -04:00
zmq rpc: avoid copying into UniValue 2024-05-20 16:48:19 +00:00
.bear-tidy-config tidy: modernize-use-emplace 2023-10-12 11:27:19 +02:00
.clang-format refactor: Print verbose serialize compiler error messages 2023-12-15 15:20:54 +01:00
.clang-tidy clang-tidy: Add bugprone-move-forwarding-reference check 2024-05-30 11:33:59 +01:00
addrdb.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
addrdb.h Use serialization parameters for CAddress serialization 2023-09-05 10:13:25 +02:00
addresstype.cpp Add PubKeyDestination for P2PK scripts 2023-09-12 12:14:31 -04:00
addresstype.h bugfix: Mark CNoDestination and PubKeyDestination constructor explicit 2023-10-25 22:46:55 +02:00
addrman.cpp Merge bitcoin/bitcoin#28929: serialization: Support for multiple parameters 2024-05-15 15:09:56 -04:00
addrman.h doc, test: Test and explain service flag handling 2024-01-15 16:19:53 -05:00
addrman_impl.h Remove timedata 2024-04-10 17:01:27 +02:00
arith_uint256.cpp refactor: Remove unused and fragile string interface from arith_uint256 2023-11-21 17:37:25 +01:00
arith_uint256.h refactor: Remove unused and fragile string interface from arith_uint256 2023-11-21 17:37:25 +01:00
attributes.h Introduce platform-agnostic ALWAYS_INLINE macro 2023-05-04 20:57:51 +01:00
banman.cpp Merge bitcoin/bitcoin#24097: Replace RecursiveMutex m_cs_banned with Mutex, and rename it 2023-11-02 14:09:27 -04:00
banman.h Merge bitcoin/bitcoin#24097: Replace RecursiveMutex m_cs_banned with Mutex, and rename it 2023-11-02 14:09:27 -04:00
base58.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
base58.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bech32.cpp refactor: replace hardcoded numbers 2024-05-21 09:14:55 +02:00
bech32.h refactor: Model the bech32 charlimit as an Enum 2024-05-13 12:07:47 +02:00
bip324.cpp net: merge V2Transport constructors, move key gen 2023-09-10 16:11:52 -04:00
bip324.h net: merge V2Transport constructors, move key gen 2023-09-10 16:11:52 -04:00
bitcoin-chainstate.cpp kernel: De-globalize fReindex 2024-05-16 11:28:46 +02:00
bitcoin-cli-res.rc
bitcoin-cli.cpp rpc: avoid copying into UniValue 2024-05-20 16:48:19 +00:00
bitcoin-tx-res.rc
bitcoin-tx.cpp tools: Use ECC_Context helper in bitcoin-tx and bitcoin-wallet tools 2024-05-09 15:56:06 +02:00
bitcoin-util-res.rc
bitcoin-util.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
bitcoin-wallet-res.rc
bitcoin-wallet.cpp Merge bitcoin/bitcoin#26606: wallet: Implement independent BDB parser 2024-05-21 10:05:09 +01:00
bitcoind-res.rc
bitcoind.cpp kernel: Remove key module from kernel library 2024-05-09 15:56:08 +02:00
blockencodings.cpp refactor: Simplify extra_txn to be a vec of CTransactionRef instead of a vec of pair<Wtxid, CTransactionRef> 2024-04-06 19:17:20 +01:00
blockencodings.h refactor: Simplify extra_txn to be a vec of CTransactionRef instead of a vec of pair<Wtxid, CTransactionRef> 2024-04-06 19:17:20 +01:00
blockfilter.cpp refactor: SpanReader without nVersion 2023-11-28 12:42:07 +01:00
blockfilter.h Remove unused includes from blockfilter.h 2023-08-17 18:28:15 +02:00
chain.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
chain.h assumeutxo: Remove BLOCK_ASSUMED_VALID flag 2024-03-18 11:28:40 -05:00
chainparams.cpp test: Throw error when -signetchallenge is non-hex 2023-05-25 19:24:05 +02:00
chainparams.h test: Throw error when -signetchallenge is non-hex 2023-05-25 19:24:05 +02:00
chainparamsbase.cpp refactor: Use ChainType enum exhaustively 2023-05-10 10:39:58 +02:00
chainparamsbase.h refactor: Use ChainType enum exhaustively 2023-05-10 10:39:58 +02:00
chainparamsseeds.h seeds: Update testnet seeds 2024-03-04 19:53:30 -05:00
checkqueue.h refactor: Make CCheckQueue non-copyable and non-movable explicitly 2023-10-03 10:52:17 +01:00
clientversion.cpp refactor: simplify FormatSubVersion using strprintf/Join 2024-05-13 23:31:46 +02:00
clientversion.h scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
coins.cpp Use Txid in COutpoint 2023-11-21 13:15:44 +00:00
coins.h Merge bitcoin/bitcoin#28922: Use Txid in COutpoint 2023-11-24 14:41:58 +00:00
compressor.cpp Clean up things that include script/standard.h 2023-08-14 17:38:27 -04:00
compressor.h
core_io.h Remove deprecated -rpcserialversion 2023-12-11 18:22:13 +01:00
core_memusage.h
core_read.cpp rpc: Reword SighashFromStr error message 2024-04-15 10:01:15 +02:00
core_write.cpp rpc: avoid copying into UniValue 2024-05-20 16:48:19 +00:00
cuckoocache.h doc: fix some typos 2024-03-26 16:51:46 +00:00
dbwrapper.cpp dbwrapper: Use DataStream for batch operations 2023-09-12 12:07:39 +02:00
dbwrapper.h dbwrapper: Use DataStream for batch operations 2023-09-12 12:07:39 +02:00
deploymentinfo.cpp Decouple RegTestChainParams from ArgsManager 2023-03-15 16:42:42 +01:00
deploymentinfo.h Decouple RegTestChainParams from ArgsManager 2023-03-15 16:42:42 +01:00
deploymentstatus.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
deploymentstatus.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
dummywallet.cpp wallet, test: Be able to always swap BDB endianness 2024-05-16 15:03:13 -04:00
external_signer.cpp external_signer: replace boost::process with cpp-subprocess 2024-03-27 14:16:37 +00:00
external_signer.h refactor: Move system from util to common library 2023-05-20 12:08:13 +02:00
flatfile.cpp scripted-diff: Replace error() with LogError() 2024-03-11 13:49:37 +01:00
flatfile.h Merge bitcoin/bitcoin#27254: refactor: Extract util/fs from util/system 2023-04-03 14:41:22 +01:00
hash.cpp crypto, hash: replace custom rotl32 with std::rotl 2024-01-05 17:12:38 +01:00
hash.h Include version.h in fewer places 2023-11-16 11:36:22 +10:00
headerssync.cpp refactor: Fix timedata includes 2024-02-01 13:52:05 +01:00
headerssync.h [headerssync] Make m_commit_offset protected 2022-12-12 21:06:04 +00:00
httprpc.cpp rpc: JSON-RPC 2.0 should not respond to "notifications" 2024-05-14 11:28:43 -04:00
httprpc.h
httpserver.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
httpserver.h refactor: Remove call to ShutdownRequested from HTTPRequest 2023-12-04 15:39:15 -04:00
i2p.cpp Merge bitcoin/bitcoin#27375: net: support unix domain sockets for -proxy and -onion 2024-03-13 06:53:07 -04:00
i2p.h i2p: construct Session with Proxy instead of CService 2024-03-01 14:47:29 -05:00
indirectmap.h
init.cpp kernel: De-globalize fReindex 2024-05-16 11:28:46 +02:00
init.h Get rid of shutdown.cpp/shutdown.h, use SignalInterrupt directly 2023-12-04 15:39:15 -04:00
key.cpp Refactor: Remove ECC_Start and ECC_Stop from key header 2024-05-09 15:56:10 +02:00
key.h Refactor: Remove ECC_Start and ECC_Stop from key header 2024-05-09 15:56:10 +02:00
key_io.cpp refactor: Allow std::span construction from CKey 2024-01-16 15:29:18 +01:00
key_io.h Clean up things that include script/standard.h 2023-08-14 17:38:27 -04:00
logging.cpp logging: remove unused BCLog::UTIL 2024-02-11 15:25:07 +01:00
logging.h Merge bitcoin/bitcoin#29419: log: deduplicate category names and improve logging.cpp 2024-04-02 10:47:05 -04:00
Makefile.am Merge bitcoin/bitcoin#26606: wallet: Implement independent BDB parser 2024-05-21 10:05:09 +01:00
Makefile.bench.include bench: basic block filter index initial sync 2024-03-12 09:30:42 -03:00
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.minisketch.include build: remove minisketch clz check 2024-04-12 14:28:34 +02:00
Makefile.qt.include build, test, doc: Temporarily remove Android-related stuff 2024-05-06 11:29:14 +01:00
Makefile.qt_locale.include qt: 27.0 translations update 2024-03-04 10:02:26 +00:00
Makefile.qttest.include build: extract $(BOOST_CPPFLAGS) from $(BITCOIN_INCLUDES) 2022-09-13 17:15:17 +01:00
Makefile.test.include build: Fix building fuzz binary on on SunOS / illumos 2024-06-02 19:51:22 +01:00
Makefile.test_fuzz.include fuzz: move MockedDescriptorConverter to fuzz/util 2023-11-20 15:57:50 -03:00
Makefile.test_util.include Merge bitcoin/bitcoin#27425: test: move remaining rand code from util/setup_common to util/random 2023-07-19 10:26:11 +01:00
Makefile.univalue.include
mapport.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
mapport.h Remove configure-time setting of DEFAULT_UPNP 2023-01-28 15:24:13 +00:00
memusage.h add std::list to memusage 2023-09-13 11:37:45 +01:00
merkleblock.cpp [clang-tidy] Enable the misc-no-recursion check 2024-04-07 14:04:45 +01:00
merkleblock.h refactor: Use Txid in CMerkleBlock 2023-11-28 17:49:41 +01:00
net.cpp Merge bitcoin/bitcoin#29421: net: make the list of known message types a compile time constant 2024-05-21 13:59:33 -04:00
net.h Merge bitcoin/bitcoin#29984: net: Replace ifname check with IFF_LOOPBACK in Discover 2024-05-07 10:28:58 +08:00
net_permissions.cpp Accept "in" and "out" flags to -whitelist to allow whitelisting manual connections 2024-02-28 10:05:56 -03:00
net_permissions.h Accept "in" and "out" flags to -whitelist to allow whitelisting manual connections 2024-02-28 10:05:56 -03:00
net_processing.cpp Merge bitcoin/bitcoin#30000: p2p: index TxOrphanage by wtxid, allow entries with same txid 2024-05-15 09:56:17 -04:00
net_processing.h [net processing] Move IgnoresIncomingTxs to PeerManagerInfo 2024-04-10 17:01:27 +02:00
net_types.cpp rpc: avoid copying into UniValue 2024-05-20 16:48:19 +00:00
net_types.h
netaddress.cpp netbase: refactor CreateSock() to accept sa_family_t 2024-03-01 13:13:07 -05:00
netaddress.h Merge bitcoin/bitcoin#28929: serialization: Support for multiple parameters 2024-05-15 15:09:56 -04:00
netbase.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
netbase.h net: split ConnectToSocket() from ConnectDirectly() for unix sockets 2024-03-01 14:47:28 -05:00
netgroup.cpp Merge bitcoin/bitcoin#27581: net: Continuous ASMap health check 2023-12-06 11:22:42 -05:00
netgroup.h net: Add continuous ASMap health check logging 2023-12-02 22:03:08 +01:00
netmessagemaker.h refactor: NetMsg::Make() without nVersion 2023-11-20 14:02:27 +01:00
noui.cpp node: Use log levels in noui_ThreadSafeMessageBox 2024-03-21 16:41:16 +01:00
noui.h
outputtype.cpp Replace remaining "520" magic numbers with MAX_SCRIPT_ELEMENT_SIZE 2024-05-02 13:16:40 -06:00
outputtype.h Move CTxDestination to its own file 2023-08-14 17:38:27 -04:00
pow.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
pow.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
prevector.h refactor: Mark prevector iterator with std::contiguous_iterator_tag 2024-01-18 19:29:34 +01:00
protocol.cpp protocol: make message types constexpr 2024-02-28 18:03:23 +01:00
protocol.h Merge bitcoin/bitcoin#29421: net: make the list of known message types a compile time constant 2024-05-21 13:59:33 -04:00
psbt.cpp Remove unused version.h include 2023-11-30 11:28:19 +01:00
psbt.h refactor: SpanReader without nVersion 2023-11-28 12:42:07 +01:00
pubkey.cpp crypto: add NUMS_H const 2024-05-14 10:24:31 +02:00
pubkey.h crypto: add NUMS_H const 2024-05-14 10:24:31 +02:00
random.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
random.h crypto: replace CountBits with std::bit_width 2024-02-26 16:13:12 +00:00
randomenv.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
randomenv.h
rest.cpp rpc: avoid copying into UniValue 2024-05-20 16:48:19 +00:00
rest.h
reverse_iterator.h doc: remove usages of C++11 2023-01-12 13:42:44 +00:00
scheduler.cpp scripted-diff: Rename SingleThreadedSchedulerClient to SerialTaskRunner 2024-02-15 14:43:14 +01:00
scheduler.h kernel: Remove dependency on CScheduler 2024-02-16 17:12:52 +01:00
serialize.h Merge bitcoin/bitcoin#28929: serialization: Support for multiple parameters 2024-05-15 15:09:56 -04:00
signet.cpp refactor: SpanReader without nVersion 2023-11-28 12:42:07 +01:00
signet.h
span.h Allow int8_t optimized vector serialization 2023-12-22 09:58:19 +01:00
streams.cpp Add AutoFile::seek and tell 2024-04-01 14:37:24 -04:00
streams.h Add AutoFile::seek and tell 2024-04-01 14:37:24 -04:00
sync.cpp util: avoid using thread_local variable that has a destructor 2024-05-16 18:16:46 +02:00
sync.h Merge bitcoin/bitcoin#27116: doc: clarify that LOCK() internally checks whether the mutex is held 2023-10-26 15:02:13 -04:00
threadsafety.h
tinyformat.h clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
torcontrol.cpp Merge bitcoin/bitcoin#28318: logging: Simplify API for level based logging 2024-01-10 14:11:32 -05:00
torcontrol.h doc, refactor: Changing -torcontrol help to specify that a default port is used 2023-08-17 23:58:47 -05:00
txdb.cpp Merge bitcoin/bitcoin#28195: blockstorage: Drop legacy -txindex check 2023-09-05 11:37:35 +01:00
txdb.h move-only: Move CBlockTreeDB to node/blockstorage 2023-08-01 15:27:33 +02:00
txmempool.cpp refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition 2024-05-06 20:34:10 +00:00
txmempool.h refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition 2024-05-06 20:34:10 +00:00
txorphanage.cpp scripted-diff: Replace nNextSweep with m_next_sweep 2024-05-29 09:02:07 -07:00
txorphanage.h scripted-diff: Replace nNextSweep with m_next_sweep 2024-05-29 09:02:07 -07:00
txrequest.cpp refactor: modernize-use-default-member-init for bit-fields (C++20) 2023-12-07 11:06:01 +01:00
txrequest.h
uint256.cpp refactor: modernize the implementation of uint256.* 2022-12-10 14:34:44 -06:00
uint256.h Merge bitcoin/bitcoin#27927: util: Allow std::byte and char Span serialization 2023-06-28 15:12:12 -04:00
undo.h Include version.h in fewer places 2023-11-16 11:36:22 +10:00
validation.cpp Merge bitcoin/bitcoin#30167: doc, rpc: Release notes and follow-ups for #29612 2024-06-03 10:29:14 +01:00
validation.h assumeutxo: Add documentation on dumptxoutset serialization format 2024-05-21 13:38:09 +02:00
validationinterface.cpp kernel: Remove dependency on CScheduler 2024-02-16 17:12:52 +01:00
validationinterface.h kernel: Remove dependency on CScheduler 2024-02-16 17:12:52 +01:00
versionbits.cpp refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
versionbits.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
walletinitinterface.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
warnings.cpp Merge bitcoin/bitcoin#29494: build: Assume HAVE_CONFIG_H, Add IWYU pragma keep to bitcoin-config.h includes 2024-05-07 14:14:03 -04:00
warnings.h rpc: return warnings as an array instead of just a single one 2024-05-01 14:44:57 +01:00