Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max coinbase out sigops to CoinbaseOutputDataSize #45

Open
wants to merge 46 commits into
base: sv2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9ac6189
net: reduce CAddress usage to CService or CNetAddr
vasild Aug 23, 2024
57c5c55
net: split CConnman::BindListenPort() off CConnman
vasild Aug 23, 2024
e47f01a
style: modernize the style of SockMan::BindListenPort()
vasild Sep 17, 2024
56ff56a
net: split CConnman::AcceptConnection() off CConnman
vasild Aug 26, 2024
1b634d0
style: modernize the style of SockMan::AcceptConnection()
vasild Sep 17, 2024
9221377
net: move the generation of ids for new nodes from CConnman to SockMan
vasild Aug 27, 2024
ff09700
net: move CConnman-specific parts away from ThreadI2PAcceptIncoming()
vasild Aug 27, 2024
a4045d4
net: move I2P-accept-incoming code from CConnman to SockMan
vasild Aug 27, 2024
4799a73
net: index nodes in CConnman by id
vasild Sep 20, 2024
e16799c
net: isolate P2P specifics from GenerateWaitSockets()
vasild Sep 21, 2024
d7c3247
net: isolate P2P specifics from SocketHandlerConnected() and ThreadSo…
vasild Sep 21, 2024
c8a08dc
net: isolate all remaining P2P specifics from SocketHandlerConnected()
vasild Sep 22, 2024
c71f511
net: split CConnman::ConnectNode()
vasild Sep 23, 2024
e74514d
net: tweak EventNewConnectionAccepted()
vasild Sep 24, 2024
14052f6
net: move sockets from CNode to SockMan
vasild Sep 23, 2024
2b01037
net: move-only: improve encapsulation of SockMan
vasild Sep 23, 2024
f2be271
Add sv2 log category for Stratum v2
Sjors Nov 30, 2023
965578c
build: libbitcoin_sv2 scaffold
Sjors Sep 13, 2024
b143e96
Add sv2 noise protocol
Sjors Sep 19, 2024
9296c67
Add sv2 message CoinbaseOutputDataSize
Sjors Sep 19, 2024
cd419dd
Move CNetMessage and Transport headers to common
Sjors Sep 20, 2024
e5a28ad
Convert between Sv2NetMsg and CSerializedNetMsg
Sjors Jun 21, 2024
6cc950d
Introduce Sv2Transport
Sjors Sep 20, 2024
830a90f
Merge remote-tracking branch 'vasild/sockman' into 2024/06/sv2_connec…
Sjors Nov 22, 2024
855ad1f
Merge remote-tracking branch 'vasild/DynSock' into 2024/06/sv2_connec…
Sjors Nov 22, 2024
799ffc0
Add sv2 SETUP_CONNECTION messages
Sjors Jul 15, 2024
559e7a0
Add strings for Sv2MsgType
Sjors Jul 1, 2024
296ba97
Add Sv2Connman
Sjors Nov 15, 2024
a6ae422
Set notifications m_tip_block in LoadChainTip()
Sjors Nov 22, 2024
2602766
Make m_tip_block an std::optional
Sjors Nov 21, 2024
bfd3283
test: use Mining interface in miner_tests
Sjors Nov 13, 2024
070c975
Add waitNext() to BlockTemplate interface
Sjors Nov 21, 2024
f13fd19
Stratum v2 template provider scaffold
Sjors Nov 15, 2024
7ebbd82
Chainparams: add default sv2 port
Sjors Nov 29, 2023
1e490f0
Add remaining sv2 messages for TemplateProvider
Sjors Jun 24, 2024
c06be1c
Sv2: construct and submit block templates
Sjors Nov 22, 2024
6ac3e10
Handle REQUEST_TRANSACTION_DATA
Sjors Jul 2, 2024
f1b5e07
Handle SUBMIT_SOLUTION
Sjors Jul 2, 2024
7099dba
Incrementally update sv2 block template
Sjors Sep 30, 2024
eab8ff7
CKey: add Serialize and Unserialize
Sjors Feb 1, 2024
fd26e38
Persist static key for Template Provider
Sjors Jan 11, 2024
0933344
Start Template Provider with -sv2
Sjors Jul 17, 2024
db306a6
doc: explain Stratum v2 design, testing and usage
Sjors Dec 28, 2023
04d76c7
Rename CoinbaseOutputDataSize
Sjors Dec 16, 2024
b1802e0
Add coinbase_output_max_sigops
Sjors Dec 16, 2024
36169ce
Fall back to 400 sigops if field is missing
Sjors Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ if(WITH_MULTIPROCESS)
)
endif()

option(WITH_SV2 "Enable Stratum v2 functionality." ON)

cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF)
if(BUILD_GUI)
set(qt_components Core Gui Widgets LinguistTools)
Expand Down Expand Up @@ -610,6 +612,7 @@ message(" ZeroMQ .............................. ${WITH_ZMQ}")
message(" USDT tracing ........................ ${WITH_USDT}")
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
message(" DBus (GUI, Linux only) .............. ${WITH_DBUS}")
message(" Stratum v2 .......................... ${WITH_SV2}")
message("Tests:")
message(" test_bitcoin ........................ ${BUILD_TESTS}")
message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")
Expand Down
1 change: 1 addition & 0 deletions doc/design/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. |
| *libbitcoin_wallet_tool* | Lower-level wallet functionality used by *bitcoin-wallet* executable. |
| *libbitcoin_zmq* | [ZeroMQ](../zmq.md) functionality used by *bitcoind* and *bitcoin-qt* executables. |
| *libbitcoin_sv2* | Stratum v2 functionality (usage TBD) |

## Conventions

Expand Down
379 changes: 379 additions & 0 deletions doc/stratum-v2.md

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ add_subdirectory(util)
if(WITH_MULTIPROCESS)
add_subdirectory(ipc)
endif()
if(WITH_SV2)
add_subdirectory(sv2)
endif()

#=============================
# secp256k1 subtree
Expand Down Expand Up @@ -120,13 +123,15 @@ add_library(bitcoin_common STATIC EXCLUDE_FROM_ALL
common/run_command.cpp
common/settings.cpp
common/signmessage.cpp
common/sockman.cpp
common/system.cpp
common/url.cpp
compressor.cpp
core_read.cpp
core_write.cpp
deploymentinfo.cpp
external_signer.cpp
i2p.cpp
init/common.cpp
kernel/chainparams.cpp
key.cpp
Expand Down Expand Up @@ -205,7 +210,6 @@ add_library(bitcoin_node STATIC EXCLUDE_FROM_ALL
headerssync.cpp
httprpc.cpp
httpserver.cpp
i2p.cpp
index/base.cpp
index/blockfilterindex.cpp
index/coinstatsindex.cpp
Expand Down Expand Up @@ -300,8 +304,15 @@ target_link_libraries(bitcoin_node
libevent::extra
$<TARGET_NAME_IF_EXISTS:libevent::pthreads>
$<TARGET_NAME_IF_EXISTS:USDT::headers>
$<TARGET_NAME_IF_EXISTS:bitcoin_sv2>
)

if(WITH_SV2)
target_compile_definitions(bitcoin_node
PUBLIC
WITH_SV2=1
)
endif()

# Bitcoin Core bitcoind.
if(BUILD_DAEMON)
Expand Down
10 changes: 5 additions & 5 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain)
{
switch (chain) {
case ChainType::MAIN:
return std::make_unique<CBaseChainParams>("", 8332, 8334);
return std::make_unique<CBaseChainParams>("", 8332, 8334, 8336);
case ChainType::TESTNET:
return std::make_unique<CBaseChainParams>("testnet3", 18332, 18334);
return std::make_unique<CBaseChainParams>("testnet3", 18332, 18334, 18336);
case ChainType::TESTNET4:
return std::make_unique<CBaseChainParams>("testnet4", 48332, 48334);
return std::make_unique<CBaseChainParams>("testnet4", 48332, 48334, 48336);
case ChainType::SIGNET:
return std::make_unique<CBaseChainParams>("signet", 38332, 38334);
return std::make_unique<CBaseChainParams>("signet", 38332, 38334, 38336);
case ChainType::REGTEST:
return std::make_unique<CBaseChainParams>("regtest", 18443, 18445);
return std::make_unique<CBaseChainParams>("regtest", 18443, 18445, 18447);
}
assert(false);
}
Expand Down
6 changes: 4 additions & 2 deletions src/chainparamsbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ class CBaseChainParams
const std::string& DataDir() const { return strDataDir; }
uint16_t RPCPort() const { return m_rpc_port; }
uint16_t OnionServiceTargetPort() const { return m_onion_service_target_port; }
uint16_t Sv2Port() const { return m_sv2_port; }

CBaseChainParams() = delete;
CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
: m_rpc_port(rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t onion_service_target_port, uint16_t sv2_port)
: m_rpc_port(rpc_port), m_onion_service_target_port(onion_service_target_port), m_sv2_port{sv2_port}, strDataDir(data_dir) {}

private:
const uint16_t m_rpc_port;
const uint16_t m_onion_service_target_port;
const uint16_t m_sv2_port;
std::string strDataDir;
};

Expand Down
Loading
Loading