Skip to content

Commit 9466638

Browse files
committed
DGB v8.22 merge with BTC v26.2 Fixes Part 20
1 parent ac2236f commit 9466638

105 files changed

Lines changed: 49 additions & 8955 deletions

File tree

Some content is hidden

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

src/bench/mempool_eviction.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<<<<<<< HEAD
21
// Copyright (c) 2011-2020 The Bitcoin Core developers
3-
// Copyright (c) 2014-2020 The DigiByte Core developers
4-
=======
52
// Copyright (c) 2011-2022 The DigiByte Core developers
6-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
73
// Distributed under the MIT software license, see the accompanying
84
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
95

@@ -23,11 +19,7 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po
2319
unsigned int sigOpCost = 4;
2420
LockPoints lp;
2521
pool.addUnchecked(CTxMemPoolEntry(
26-
<<<<<<< HEAD
27-
tx, nFee, nTime, nHeight,
28-
=======
2922
tx, nFee, nTime, nHeight, sequence,
30-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
3123
spendsCoinbase, sigOpCost, lp));
3224
}
3325

@@ -119,11 +111,7 @@ static void MempoolEviction(benchmark::Bench& bench)
119111
tx7.vout[1].scriptPubKey = CScript() << OP_7 << OP_EQUAL;
120112
tx7.vout[1].nValue = 10 * COIN;
121113

122-
<<<<<<< HEAD
123-
CTxMemPool pool;
124-
=======
125114
CTxMemPool& pool = *Assert(testing_setup->m_node.mempool);
126-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
127115
LOCK2(cs_main, pool.cs);
128116
// Create transaction references outside the "hot loop"
129117
const CTransactionRef tx1_r{MakeTransactionRef(tx1)};
@@ -147,8 +135,4 @@ static void MempoolEviction(benchmark::Bench& bench)
147135
});
148136
}
149137

150-
<<<<<<< HEAD
151-
BENCHMARK(MempoolEviction);
152-
=======
153138
BENCHMARK(MempoolEviction, benchmark::PriorityLevel::HIGH);
154-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion

src/bench/prevector.cpp

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<<<<<<< HEAD
21
// Copyright (c) 2015-2020 The Bitcoin Core developers
3-
// Copyright (c) 2015-2020 The DigiByte Core developers
4-
=======
52
// Copyright (c) 2015-2022 The DigiByte Core developers
6-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
73
// Distributed under the MIT software license, see the accompanying
84
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
95

@@ -15,13 +11,8 @@
1511
#include <bench/bench.h>
1612

1713
struct nontrivial_t {
18-
<<<<<<< HEAD
19-
int x;
20-
nontrivial_t() :x(-1) {}
21-
=======
2214
int x{-1};
2315
nontrivial_t() = default;
24-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
2516
SERIALIZE_METHODS(nontrivial_t, obj) { READWRITE(obj.x); }
2617
};
2718
static_assert(!std::is_trivially_default_constructible<nontrivial_t>::value,
@@ -44,35 +35,6 @@ static void PrevectorDestructor(benchmark::Bench& bench)
4435

4536
template <typename T>
4637
static void PrevectorClear(benchmark::Bench& bench)
47-
<<<<<<< HEAD
48-
{
49-
prevector<28, T> t0;
50-
prevector<28, T> t1;
51-
bench.batch(2).run([&] {
52-
t0.resize(28);
53-
t0.clear();
54-
t1.resize(29);
55-
t1.clear();
56-
});
57-
}
58-
59-
template <typename T>
60-
static void PrevectorResize(benchmark::Bench& bench)
61-
{
62-
prevector<28, T> t0;
63-
prevector<28, T> t1;
64-
bench.batch(4).run([&] {
65-
t0.resize(28);
66-
t0.resize(0);
67-
t1.resize(29);
68-
t1.resize(0);
69-
});
70-
}
71-
72-
template <typename T>
73-
static void PrevectorDeserialize(benchmark::Bench& bench)
74-
=======
75-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
7638
{
7739
prevector<28, T> t0;
7840
prevector<28, T> t1;
@@ -119,20 +81,6 @@ static void PrevectorDeserialize(benchmark::Bench& bench)
11981
});
12082
}
12183

122-
<<<<<<< HEAD
123-
#define PREVECTOR_TEST(name) \
124-
static void Prevector##name##Nontrivial(benchmark::Bench& bench) \
125-
{ \
126-
Prevector##name<nontrivial_t>(bench); \
127-
} \
128-
BENCHMARK(Prevector##name##Nontrivial); \
129-
static void Prevector##name##Trivial(benchmark::Bench& bench) \
130-
{ \
131-
Prevector##name<trivial_t>(bench); \
132-
} \
133-
BENCHMARK(Prevector##name##Trivial);
134-
135-
=======
13684
template <typename T>
13785
static void PrevectorFillVectorDirect(benchmark::Bench& bench)
13886
{
@@ -168,14 +116,9 @@ static void PrevectorFillVectorIndirect(benchmark::Bench& bench)
168116
Prevector##name<trivial_t>(bench); \
169117
} \
170118
BENCHMARK(Prevector##name##Trivial, benchmark::PriorityLevel::HIGH);
171-
172-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
173119
PREVECTOR_TEST(Clear)
174120
PREVECTOR_TEST(Destructor)
175121
PREVECTOR_TEST(Resize)
176122
PREVECTOR_TEST(Deserialize)
177-
<<<<<<< HEAD
178-
=======
179123
PREVECTOR_TEST(FillVectorDirect)
180124
PREVECTOR_TEST(FillVectorIndirect)
181-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion

src/bench/rollingbloom.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<<<<<<< HEAD
21
// Copyright (c) 2016-2020 The Bitcoin Core developers
3-
// Copyright (c) 2016-2020 The DigiByte Core developers
4-
=======
52
// Copyright (c) 2016-2022 The DigiByte Core developers
6-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
73
// Distributed under the MIT software license, see the accompanying
84
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
95

@@ -12,11 +8,7 @@
128
#include <common/bloom.h>
139
#include <crypto/common.h>
1410

15-
<<<<<<< HEAD
16-
=======
1711
#include <vector>
18-
19-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
2012
static void RollingBloom(benchmark::Bench& bench)
2113
{
2214
CRollingBloomFilter filter(120000, 0.000001);
@@ -27,14 +19,7 @@ static void RollingBloom(benchmark::Bench& bench)
2719
WriteLE32(data.data(), count);
2820
filter.insert(data);
2921

30-
<<<<<<< HEAD
31-
data[0] = count >> 24;
32-
data[1] = count >> 16;
33-
data[2] = count >> 8;
34-
data[3] = count;
35-
=======
3622
WriteBE32(data.data(), count);
37-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
3823
filter.contains(data);
3924
});
4025
}
@@ -47,10 +32,5 @@ static void RollingBloomReset(benchmark::Bench& bench)
4732
});
4833
}
4934

50-
<<<<<<< HEAD
51-
BENCHMARK(RollingBloom);
52-
BENCHMARK(RollingBloomReset);
53-
=======
5435
BENCHMARK(RollingBloom, benchmark::PriorityLevel::HIGH);
5536
BENCHMARK(RollingBloomReset, benchmark::PriorityLevel::HIGH);
56-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion

src/bench/verify_script.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
<<<<<<< HEAD
21
// Copyright (c) 2016-2020 The Bitcoin Core developers
3-
// Copyright (c) 2016-2020 The DigiByte Core developers
4-
=======
52
// Copyright (c) 2016-2022 The DigiByte Core developers
6-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
73
// Distributed under the MIT software license, see the accompanying
84
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
95

@@ -13,11 +9,7 @@
139
#include <script/digibyteconsensus.h>
1410
#endif
1511
#include <script/script.h>
16-
<<<<<<< HEAD
17-
#include <script/standard.h>
18-
=======
1912
#include <script/interpreter.h>
20-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
2113
#include <streams.h>
2214
#include <test/util/transaction_utils.h>
2315

@@ -27,16 +19,9 @@
2719
// modified to measure performance of other types of scripts.
2820
static void VerifyScriptBench(benchmark::Bench& bench)
2921
{
30-
<<<<<<< HEAD
31-
const ECCVerifyHandle verify_handle;
32-
ECC_Start();
33-
34-
const int flags = SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH;
35-
=======
3622
ECC_Start();
3723

3824
const uint32_t flags{SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH};
39-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion
4025
const int witnessversion = 0;
4126

4227
// Key pair.
@@ -111,10 +96,5 @@ static void VerifyNestedIfScript(benchmark::Bench& bench)
11196
});
11297
}
11398

114-
<<<<<<< HEAD
115-
BENCHMARK(VerifyScriptBench);
116-
BENCHMARK(VerifyNestedIfScript);
117-
=======
11899
BENCHMARK(VerifyScriptBench, benchmark::PriorityLevel::HIGH);
119100
BENCHMARK(VerifyNestedIfScript, benchmark::PriorityLevel::HIGH);
120-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion

src/common/bloom.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<<<<<<< HEAD:src/bloom.cpp
2-
// Copyright (c) 2012-2020 The Bitcoin Core developers
3-
// Copyright (c) 2014-2020 The DigiByte Core developers
4-
=======
51
// Copyright (c) 2012-2022 The DigiByte Core developers
6-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.cpp
72
// Distributed under the MIT software license, see the accompanying
83
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
94

@@ -24,15 +19,8 @@
2419
#include <limits>
2520
#include <vector>
2621

27-
<<<<<<< HEAD:src/bloom.cpp
28-
#include <algorithm>
29-
30-
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
31-
#define LN2 0.6931471805599453094172321214581765680755001343602552
32-
=======
3322
static constexpr double LN2SQUARED = 0.4804530139182014246671025263266649717305529515945455;
3423
static constexpr double LN2 = 0.6931471805599453094172321214581765680755001343602552;
35-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.cpp
3624

3725
CBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweakIn, unsigned char nFlagsIn) :
3826
/**
@@ -52,11 +40,7 @@ CBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, c
5240
{
5341
}
5442

55-
<<<<<<< HEAD:src/bloom.cpp
56-
inline unsigned int CBloomFilter::Hash(unsigned int nHashNum, const std::vector<unsigned char>& vDataToHash) const
57-
=======
5843
inline unsigned int CBloomFilter::Hash(unsigned int nHashNum, Span<const unsigned char> vDataToHash) const
59-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.cpp
6044
{
6145
// 0xFBA4C795 chosen as it guarantees a reasonable bit difference between nHashNum values.
6246
return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash) % (vData.size() * 8);
@@ -83,15 +67,6 @@ void CBloomFilter::insert(const COutPoint& outpoint)
8367

8468
bool CBloomFilter::contains(Span<const unsigned char> vKey) const
8569
{
86-
<<<<<<< HEAD:src/bloom.cpp
87-
std::vector<unsigned char> data(hash.begin(), hash.end());
88-
insert(data);
89-
}
90-
91-
bool CBloomFilter::contains(const std::vector<unsigned char>& vKey) const
92-
{
93-
=======
94-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.cpp
9570
if (vData.empty()) // Avoid divide-by-zero (CVE-2013-5700)
9671
return true;
9772
for (unsigned int i = 0; i < nHashFuncs; i++)
@@ -108,18 +83,7 @@ bool CBloomFilter::contains(const COutPoint& outpoint) const
10883
{
10984
DataStream stream{};
11085
stream << outpoint;
111-
<<<<<<< HEAD:src/bloom.cpp
112-
std::vector<unsigned char> data(stream.begin(), stream.end());
113-
return contains(data);
114-
}
115-
116-
bool CBloomFilter::contains(const uint256& hash) const
117-
{
118-
std::vector<unsigned char> data(hash.begin(), hash.end());
119-
return contains(data);
120-
=======
12186
return contains(MakeUCharSpan(stream));
122-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.cpp
12387
}
12488

12589
bool CBloomFilter::IsWithinSizeConstraints() const

src/common/bloom.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
<<<<<<< HEAD:src/bloom.h
2-
// Copyright (c) 2012-2020 The Bitcoin Core developers
3-
// Copyright (c) 2014-2020 The DigiByte Core developers
4-
// Distributed under the MIT software license, see the accompanying
5-
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
6-
7-
#ifndef DIGIBYTE_BLOOM_H
8-
#define DIGIBYTE_BLOOM_H
9-
=======
101
// Copyright (c) 2012-2021 The DigiByte Core developers
112
// Distributed under the MIT software license, see the accompanying
123
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
134

145
#ifndef DIGIBYTE_COMMON_BLOOM_H
156
#define DIGIBYTE_COMMON_BLOOM_H
16-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.h
177

188
#include <serialize.h>
199
#include <span.h>
@@ -59,11 +49,7 @@ class CBloomFilter
5949
unsigned int nTweak;
6050
unsigned char nFlags;
6151

62-
<<<<<<< HEAD:src/bloom.h
63-
unsigned int Hash(unsigned int nHashNum, const std::vector<unsigned char>& vDataToHash) const;
64-
=======
6552
unsigned int Hash(unsigned int nHashNum, Span<const unsigned char> vDataToHash) const;
66-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.h
6753

6854
public:
6955
/**
@@ -80,19 +66,11 @@ class CBloomFilter
8066

8167
SERIALIZE_METHODS(CBloomFilter, obj) { READWRITE(obj.vData, obj.nHashFuncs, obj.nTweak, obj.nFlags); }
8268

83-
<<<<<<< HEAD:src/bloom.h
84-
void insert(const std::vector<unsigned char>& vKey);
85-
=======
8669
void insert(Span<const unsigned char> vKey);
87-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.h
8870
void insert(const COutPoint& outpoint);
8971

9072
bool contains(Span<const unsigned char> vKey) const;
9173
bool contains(const COutPoint& outpoint) const;
92-
<<<<<<< HEAD:src/bloom.h
93-
bool contains(const uint256& hash) const;
94-
=======
95-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.h
9674

9775
//! True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS
9876
//! (catch a filter which was just deserialized which was too big)
@@ -146,8 +124,4 @@ class CRollingBloomFilter
146124
int nHashFuncs;
147125
};
148126

149-
<<<<<<< HEAD:src/bloom.h
150-
#endif // DIGIBYTE_BLOOM_H
151-
=======
152127
#endif // DIGIBYTE_COMMON_BLOOM_H
153-
>>>>>>> bitcoin-v26-2-converted/digibyte-v26.2-naming-conversion:src/common/bloom.h

0 commit comments

Comments
 (0)