Skip to content

Commit f650f65

Browse files
312e438 Merge bitcoin#25976: QA: rpc_blockchain: Test output of getblock verbosity 0, False, and True (MacroFake) aba4757 Merge bitcoin#26079: Revert "doc: note that brew installed qt is not supported" (fanquake) cd31ec6 Merge bitcoin#25809: build: add test_bitcoin.exe to win installer, don't install entire docs/ dir (fanquake) f90a43f Merge bitcoin#25699: scripted-diff: Replace NullUniValue with UniValue::VNULL (fanquake) 3f34f20 Merge bitcoin#25691: RPC: Document "asm" and "hex" fields for scripts & fix getblock help (MacroFake) d60848b partial Merge bitcoin#25331: Add HashWriter without ser-type and ser-version and use it where possible (fanquake) a412dae Merge bitcoin#25638: refactor: Use chainman() helper consistently in ChainImpl (MacroFake) 3a7297c Merge bitcoin#25285: Add AutoFile without ser-type and ser-version and use it where possible (fanquake) 47e5043 Merge bitcoin#25445: test: Return new_utxo from create_self_transfer in MiniWallet (MacroFake) 928ead8 Merge bitcoin#25298: doc: Fix command in "OpenBSD Build Guide" (MacroFake) Pull request description: ## What was done? Regular backports from Bitcoin Core v24 Backport bitcoin#25331 is partial due to several missing usages of CHashWritter in non-existing yet taproot code. Though, it's time to do it, because most of backports prior to 25331 is done and it helps to reduce conflicts for further backports that may use HashWritter instead. ## How Has This Been Tested? Run unit & functional tests ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK 312e438 kwvg: utACK 312e438 Tree-SHA512: 1c8b5d8eb66903c38da1b905a79e4c7fd271b2150ab02c8010955af8e2c377cd44c7a1dc8c2602b5853d7c28c4d31f10dbe5126e2e9b83a915bfaa88c196d6c4
2 parents 9b51d22 + 312e438 commit f650f65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+290
-275
lines changed

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ endif
2222

2323
BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
2424
BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
25+
BITCOIN_TEST_BIN=$(top_builddir)/src/test/$(BITCOIN_TEST_NAME)$(EXEEXT)
2526
BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
2627
BITCOIN_TX_BIN=$(top_builddir)/src/$(BITCOIN_TX_NAME)$(EXEEXT)
2728
BITCOIN_WALLET_BIN=$(top_builddir)/src/$(BITCOIN_WALLET_TOOL_NAME)$(EXEEXT)
@@ -76,6 +77,7 @@ $(BITCOIN_WIN_INSTALLER): all-recursive
7677
$(MKDIR_P) $(top_builddir)/release
7778
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
7879
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
80+
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_TEST_BIN) $(top_builddir)/release
7981
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
8082
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_TX_BIN) $(top_builddir)/release
8183
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_WALLET_BIN) $(top_builddir)/release

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fi
3131

3232
BITCOIN_DAEMON_NAME=dashd
3333
BITCOIN_GUI_NAME=dash-qt
34+
BITCOIN_TEST_NAME=test_dash
3435
BITCOIN_CLI_NAME=dash-cli
3536
BITCOIN_TX_NAME=dash-tx
3637
BITCOIN_WALLET_TOOL_NAME=dash-wallet
@@ -1932,6 +1933,7 @@ AC_SUBST(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION")
19321933
AC_SUBST(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL")
19331934
AC_SUBST(BITCOIN_DAEMON_NAME)
19341935
AC_SUBST(BITCOIN_GUI_NAME)
1936+
AC_SUBST(BITCOIN_TEST_NAME)
19351937
AC_SUBST(BITCOIN_CLI_NAME)
19361938
AC_SUBST(BITCOIN_TX_NAME)
19371939
AC_SUBST(BITCOIN_WALLET_TOOL_NAME)

doc/build-openbsd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ It is not necessary to build wallet functionality to run either `dashd` or `dash
3636
`sqlite3` is required to support [descriptor wallets](descriptors.md).
3737

3838
``` bash
39-
pkg_add install sqlite3
39+
pkg_add sqlite3
4040
```
4141

4242
###### Legacy Wallet Support

doc/build-osx.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@ Skip if you don't intend to use the GUI.
109109
brew install qt@5
110110
```
111111

112-
Ensure that the `qt@5` package is installed, not the `qt` package.
113-
If 'qt' is installed, the build process will fail.
114-
if installed, remove the `qt` package with the following command:
115-
116-
``` bash
117-
brew uninstall qt
118-
```
119-
120112
Note: Building with Qt binaries downloaded from the Qt website is not officially supported.
121113
See the notes in [#7714](https://github.com/dashpay/dash/issues/7714).
122114

share/setup.nsi.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ Section -Main SEC0000
8080
File @abs_top_builddir@/release/@BITCOIN_CLI_NAME@@EXEEXT@
8181
File @abs_top_builddir@/release/@BITCOIN_TX_NAME@@EXEEXT@
8282
File @abs_top_builddir@/release/@BITCOIN_WALLET_TOOL_NAME@@EXEEXT@
83-
SetOutPath $INSTDIR\doc
84-
File /r /x Makefile* @abs_top_srcdir@/doc\*.*
83+
File @abs_top_builddir@/release/@BITCOIN_TEST_NAME@@EXEEXT@
8584
SetOutPath $INSTDIR
8685
WriteRegStr HKCU "${REGKEY}\Components" Main 1
8786
SectionEnd
@@ -129,7 +128,6 @@ Section /o -un.Main UNSEC0000
129128
Delete /REBOOTOK $INSTDIR\COPYING.txt
130129
Delete /REBOOTOK $INSTDIR\readme.txt
131130
RMDir /r /REBOOTOK $INSTDIR\daemon
132-
RMDir /r /REBOOTOK $INSTDIR\doc
133131
DeleteRegValue HKCU "${REGKEY}\Components" Main
134132
SectionEnd
135133

src/crypto/muhash.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void Num3072::ToBytes(unsigned char (&out)[BYTE_SIZE]) {
298298
Num3072 MuHash3072::ToNum3072(Span<const unsigned char> in) {
299299
unsigned char tmp[Num3072::BYTE_SIZE];
300300

301-
uint256 hashed_in = (CHashWriter(SER_DISK, 0) << in).GetSHA256();
301+
uint256 hashed_in{(HashWriter{} << in).GetSHA256()};
302302
static_assert(sizeof(tmp) % ChaCha20Aligned::BLOCKLEN == 0);
303303
ChaCha20Aligned{MakeByteSpan(hashed_in)}.Keystream(MakeWritableByteSpan(tmp));
304304
Num3072 out{tmp};
@@ -319,7 +319,7 @@ void MuHash3072::Finalize(uint256& out) noexcept
319319
unsigned char data[Num3072::BYTE_SIZE];
320320
m_numerator.ToBytes(data);
321321

322-
out = (CHashWriter(SER_DISK, 0) << data).GetSHA256();
322+
out = (HashWriter{} << data).GetSHA256();
323323
}
324324

325325
MuHash3072& MuHash3072::operator*=(const MuHash3072& mul) noexcept

src/flat-database.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class CFlatDB
4949
uint256 hash = Hash(ssObj);
5050
ssObj << hash;
5151

52-
// open output file, and associate with CAutoFile
52+
// open output file, and associate with AutoFile
5353
FILE *file = fsbridge::fopen(pathDB, "wb");
54-
CAutoFile fileout(file, SER_DISK, CLIENT_VERSION);
54+
AutoFile fileout{file};
5555
if (fileout.IsNull()) {
5656
return error("%s: Failed to open file %s", __func__, fs::PathToString(pathDB));
5757
}
@@ -76,9 +76,9 @@ class CFlatDB
7676
//LOCK(objToLoad.cs);
7777

7878
const auto start{SteadyClock::now()};
79-
// open input file, and associate with CAutoFile
79+
// open input file, and associate with AutoFile
8080
FILE *file = fsbridge::fopen(pathDB, "rb");
81-
CAutoFile filein(file, SER_DISK, CLIENT_VERSION);
81+
AutoFile filein{file};
8282
if (filein.IsNull()) {
8383
// It is not actually error, maybe it's a first initialization of core.
8484
return ReadResult::FileError;

src/hash.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ uint256 SHA256Uint256(const uint256& input)
8282
return result;
8383
}
8484

85-
CHashWriter TaggedHash(const std::string& tag)
85+
HashWriter TaggedHash(const std::string& tag)
8686
{
87-
CHashWriter writer(SER_GETHASH, 0);
87+
HashWriter writer{};
8888
uint256 taghash;
8989
CSHA256().Write((const unsigned char*)tag.data(), tag.size()).Finalize(taghash.begin());
9090
writer << taghash << taghash;

src/hash.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ unsigned int MurmurHash3(unsigned int nHashSeed, Span<const unsigned char> vData
242242

243243
void BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]);
244244

245-
/** Return a CHashWriter primed for tagged hashes (as specified in BIP 340).
245+
/** Return a HashWriter primed for tagged hashes (as specified in BIP 340).
246246
*
247247
* The returned object will have SHA256(tag) written to it twice (= 64 bytes).
248248
* A tagged hash can be computed by feeding the message into this object, and
249-
* then calling CHashWriter::GetSHA256().
249+
* then calling HashWriter::GetSHA256().
250250
*/
251-
CHashWriter TaggedHash(const std::string& tag);
251+
HashWriter TaggedHash(const std::string& tag);
252252

253253
#endif // BITCOIN_HASH_H

src/index/blockfilterindex.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ bool BlockFilterIndex::CommitInternal(CDBBatch& batch)
167167
}
168168

169169
// Flush current filter file to disk.
170-
CAutoFile file(m_filter_fileseq->Open(pos), SER_DISK, CLIENT_VERSION);
170+
AutoFile file{m_filter_fileseq->Open(pos)};
171171
if (file.IsNull()) {
172172
return error("%s: Failed to open filter file %d", __func__, pos.nFile);
173173
}
@@ -181,7 +181,7 @@ bool BlockFilterIndex::CommitInternal(CDBBatch& batch)
181181

182182
bool BlockFilterIndex::ReadFilterFromDisk(const FlatFilePos& pos, const uint256& hash, BlockFilter& filter) const
183183
{
184-
CAutoFile filein(m_filter_fileseq->Open(pos, true), SER_DISK, CLIENT_VERSION);
184+
AutoFile filein{m_filter_fileseq->Open(pos, true)};
185185
if (filein.IsNull()) {
186186
return false;
187187
}
@@ -211,7 +211,7 @@ size_t BlockFilterIndex::WriteFilterToDisk(FlatFilePos& pos, const BlockFilter&
211211

212212
// If writing the filter would overflow the file, flush and move to the next one.
213213
if (pos.nPos + data_size > MAX_FLTR_FILE_SIZE) {
214-
CAutoFile last_file(m_filter_fileseq->Open(pos), SER_DISK, CLIENT_VERSION);
214+
AutoFile last_file{m_filter_fileseq->Open(pos)};
215215
if (last_file.IsNull()) {
216216
LogPrintf("%s: Failed to open filter file %d\n", __func__, pos.nFile);
217217
return 0;
@@ -237,7 +237,7 @@ size_t BlockFilterIndex::WriteFilterToDisk(FlatFilePos& pos, const BlockFilter&
237237
return 0;
238238
}
239239

240-
CAutoFile fileout(m_filter_fileseq->Open(pos), SER_DISK, CLIENT_VERSION);
240+
AutoFile fileout{m_filter_fileseq->Open(pos)};
241241
if (fileout.IsNull()) {
242242
LogPrintf("%s: Failed to open filter file %d\n", __func__, pos.nFile);
243243
return 0;

0 commit comments

Comments
 (0)