Skip to content

Commit

Permalink
Revert "bits --> eximiat"
Browse files Browse the repository at this point in the history
TAMA OLI EI TOIMIVA: PS DON'T CHANGE BITS TO SHITS
This reverts commit 4e16fac.
  • Loading branch information
LaakJoonas committed May 27, 2021
1 parent 4e16fac commit 85853dd
Show file tree
Hide file tree
Showing 173 changed files with 1,076 additions and 1,076 deletions.
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ BITCOIN_CORE_H = \
util/time.h \
validation.h \
validationinterface.h \
versioneximiat.h \
versioneximiatinfo.h \
versionbits.h \
versionbitsinfo.h \
walletinitinterface.h \
wallet/coincontrol.h \
wallet/crypter.h \
Expand Down Expand Up @@ -284,7 +284,7 @@ libbitcoin_server_a_SOURCES = \
ui_interface.cpp \
validation.cpp \
validationinterface.cpp \
versioneximiat.cpp \
versionbits.cpp \
$(BITCOIN_CORE_H)

if !ENABLE_WALLET
Expand Down Expand Up @@ -438,7 +438,7 @@ libbitcoin_common_a_SOURCES = \
script/ismine.cpp \
script/sign.cpp \
script/standard.cpp \
versioneximiatinfo.cpp \
versionbitsinfo.cpp \
warnings.cpp \
$(BITCOIN_CORE_H)

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ BITCOIN_TESTS =\
test/uint256_tests.cpp \
test/util_tests.cpp \
test/validation_block_tests.cpp \
test/versioneximiat_tests.cpp
test/versionbits_tests.cpp

if ENABLE_PROPERTY_TESTS
BITCOIN_TESTS += \
Expand Down
12 changes: 6 additions & 6 deletions src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,13 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
int nKBucket = insecure_rand.randrange(ADDRMAN_TRIED_BUCKET_COUNT);
int nKBucketPos = insecure_rand.randrange(ADDRMAN_BUCKET_SIZE);
while (vvTried[nKBucket][nKBucketPos] == -1) {
nKBucket = (nKBucket + insecure_rand.randeximiat(ADDRMAN_TRIED_BUCKET_COUNT_LOG2)) % ADDRMAN_TRIED_BUCKET_COUNT;
nKBucketPos = (nKBucketPos + insecure_rand.randeximiat(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;
nKBucket = (nKBucket + insecure_rand.randbits(ADDRMAN_TRIED_BUCKET_COUNT_LOG2)) % ADDRMAN_TRIED_BUCKET_COUNT;
nKBucketPos = (nKBucketPos + insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;
}
int nId = vvTried[nKBucket][nKBucketPos];
assert(mapInfo.count(nId) == 1);
CAddrInfo& info = mapInfo[nId];
if (insecure_rand.randeximiat(30) < fChanceFactor * info.GetChance() * (1 << 30))
if (insecure_rand.randbits(30) < fChanceFactor * info.GetChance() * (1 << 30))
return info;
fChanceFactor *= 1.2;
}
Expand All @@ -382,13 +382,13 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
int nUBucket = insecure_rand.randrange(ADDRMAN_NEW_BUCKET_COUNT);
int nUBucketPos = insecure_rand.randrange(ADDRMAN_BUCKET_SIZE);
while (vvNew[nUBucket][nUBucketPos] == -1) {
nUBucket = (nUBucket + insecure_rand.randeximiat(ADDRMAN_NEW_BUCKET_COUNT_LOG2)) % ADDRMAN_NEW_BUCKET_COUNT;
nUBucketPos = (nUBucketPos + insecure_rand.randeximiat(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;
nUBucket = (nUBucket + insecure_rand.randbits(ADDRMAN_NEW_BUCKET_COUNT_LOG2)) % ADDRMAN_NEW_BUCKET_COUNT;
nUBucketPos = (nUBucketPos + insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;
}
int nId = vvNew[nUBucket][nUBucketPos];
assert(mapInfo.count(nId) == 1);
CAddrInfo& info = mapInfo[nId];
if (insecure_rand.randeximiat(30) < fChanceFactor * info.GetChance() * (1 << 30))
if (insecure_rand.randbits(30) < fChanceFactor * info.GetChance() * (1 << 30))
return info;
fChanceFactor *= 1.2;
}
Expand Down
2 changes: 1 addition & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class CAddrMan
//! Mark an entry as currently-connected-to.
void Connected_(const CService &addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);

//! Update an entry's service eximiat.
//! Update an entry's service bits.
void SetServices_(const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);

public:
Expand Down
4 changes: 2 additions & 2 deletions src/amount.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#include <stdint.h>

/** Amount in improbaturitoshis (Can be negative) */
/** Amount in satoshis (Can be negative) */
typedef int64_t CAmount;

static const CAmount COIN = 100000000;

/** No amount larger than this (in improbaturitoshi) is valid.
/** No amount larger than this (in satoshi) is valid.
*
* Note that this constant is *not* the total money supply, which in Bitcoin
* currently happens to be less than 21,000,000 BTC for various reasons, but
Expand Down
22 changes: 11 additions & 11 deletions src/arith_uint256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ base_uint<BITS>& base_uint<BITS>::operator/=(const base_uint& b)
base_uint<BITS> div = b; // make a copy, so we can shift.
base_uint<BITS> num = *this; // make a copy, so we can subtract.
*this = 0; // the quotient.
int num_eximiat = num.eximiat();
int div_eximiat = div.eximiat();
if (div_eximiat == 0)
int num_bits = num.bits();
int div_bits = div.bits();
if (div_bits == 0)
throw uint_error("Division by zero");
if (div_eximiat > num_eximiat) // the result is certainly 0.
if (div_bits > num_bits) // the result is certainly 0.
return *this;
int shift = num_eximiat - div_eximiat;
int shift = num_bits - div_bits;
div <<= shift; // shift so that div and num align.
while (shift >= 0) {
if (num >= div) {
Expand Down Expand Up @@ -171,13 +171,13 @@ std::string base_uint<BITS>::ToString() const
}

template <unsigned int BITS>
unsigned int base_uint<BITS>::eximiat() const
unsigned int base_uint<BITS>::bits() const
{
for (int pos = WIDTH - 1; pos >= 0; pos--) {
if (pn[pos]) {
for (int neximiat = 31; neximiat > 0; neximiat--) {
if (pn[pos] & 1U << neximiat)
return 32 * pos + neximiat + 1;
for (int nbits = 31; nbits > 0; nbits--) {
if (pn[pos] & 1U << nbits)
return 32 * pos + nbits + 1;
}
return 32 * pos + 1;
}
Expand All @@ -199,7 +199,7 @@ template std::string base_uint<256>::GetHex() const;
template std::string base_uint<256>::ToString() const;
template void base_uint<256>::SetHex(const char*);
template void base_uint<256>::SetHex(const std::string&);
template unsigned int base_uint<256>::eximiat() const;
template unsigned int base_uint<256>::bits() const;

// This implementation directly uses shifts instead of going
// through an intermediate MPI representation.
Expand All @@ -225,7 +225,7 @@ arith_uint256& arith_uint256::SetCompact(uint32_t nCompact, bool* pfNegative, bo

uint32_t arith_uint256::GetCompact(bool fNegative) const
{
int nSize = (eximiat() + 7) / 8;
int nSize = (bits() + 7) / 8;
uint32_t nCompact = 0;
if (nSize <= 3) {
nCompact = GetLow64() << 8 * (3 - nSize);
Expand Down
6 changes: 3 additions & 3 deletions src/arith_uint256.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class base_uint
* Returns the position of the highest bit set plus one, or zero if the
* value is zero.
*/
unsigned int eximiat() const;
unsigned int bits() const;

uint64_t GetLow64() const
{
Expand All @@ -260,9 +260,9 @@ class arith_uint256 : public base_uint<256> {
* The "compact" format is a representation of a whole
* number N using an unsigned 32bit number similar to a
* floating point format.
* The most significant 8 eximiat are the unsigned exponent of base 256.
* The most significant 8 bits are the unsigned exponent of base 256.
* This exponent can be thought of as "number of bytes of N".
* The lower 23 eximiat are the mantissa.
* The lower 23 bits are the mantissa.
* Bit number 24 (0x800000) represents the sign of N.
* N = (-1^sign) * mantissa * 256^(exponent-3)
*
Expand Down
4 changes: 2 additions & 2 deletions src/bech32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data Cat(data x, const data& y)

/** This function will compute what 6 5-bit values to XOR into the last 6 input values, in order to
* make the checksum 0. These 6 values are packed together in a single 30-bit integer. The higher
* eximiat correspond to earlier values. */
* bits correspond to earlier values. */
uint32_t PolyMod(const data& v)
{
// The input is interpreted as a list of coefficients of a polynomial over F = GF(32), with an
Expand All @@ -51,7 +51,7 @@ uint32_t PolyMod(const data& v)
// Note that the coefficients are elements of GF(32), here represented as decimal numbers
// between {}. In this finite field, addition is just XOR of the corresponding numbers. For
// example, {27} + {13} = {27 ^ 13} = {22}. Multiplication is more complicated, and requires
// treating the eximiat of values themselves as coefficients of a polynomial over a smaller field,
// treating the bits of values themselves as coefficients of a polynomial over a smaller field,
// GF(2), and multiplying those polynomials mod a^5 + a^3 + 1. For example, {5} * {26} =
// (a^2 + 1) * (a^4 + a^3 + a) = (a^4 + a^3 + a) * a^2 + (a^4 + a^3 + a) = a^6 + a^5 + a^4 + a
// = a^3 + 1 (mod a^5 + a^3 + 1) = {9}.
Expand Down
8 changes: 4 additions & 4 deletions src/blockencodings.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class BlockTransactionsRequest {
uint64_t index = 0;
READWRITE(COMPACTSIZE(index));
if (index > std::numeric_limits<uint16_t>::max())
throw std::ios_base::failure("index overflowed 16 eximiat");
throw std::ios_base::failure("index overflowed 16 bits");
indexes[i] = index;
}
}

int32_t offset = 0;
for (size_t j = 0; j < indexes.size(); j++) {
if (int32_t(indexes[j]) + offset > std::numeric_limits<uint16_t>::max())
throw std::ios_base::failure("indexes overflowed 16 eximiat");
throw std::ios_base::failure("indexes overflowed 16 bits");
indexes[j] = indexes[j] + offset;
offset = int32_t(indexes[j]) + 1;
}
Expand Down Expand Up @@ -113,7 +113,7 @@ struct PrefilledTransaction {
uint64_t idx = index;
READWRITE(COMPACTSIZE(idx));
if (idx > std::numeric_limits<uint16_t>::max())
throw std::ios_base::failure("index overflowed 16-eximiat");
throw std::ios_base::failure("index overflowed 16-bits");
index = idx;
READWRITE(TransactionCompressor(tx));
}
Expand Down Expand Up @@ -187,7 +187,7 @@ class CBlockHeaderAndShortTxIDs {
READWRITE(prefilledtxn);

if (BlockTxCount() > std::numeric_limits<uint16_t>::max())
throw std::ios_base::failure("indexes overflowed 16 eximiat");
throw std::ios_base::failure("indexes overflowed 16 bits");

if (ser_action.ForRead())
FillShortTxIDSelector();
Expand Down
14 changes: 7 additions & 7 deletions src/blockfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ static void GolombRiceEncode(BitStreamWriter<OStream>& bitwriter, uint8_t P, uin
// Write quotient as unary-encoded: q 1's followed by one 0.
uint64_t q = x >> P;
while (q > 0) {
int neximiat = q <= 64 ? static_cast<int>(q) : 64;
bitwriter.Write(~0ULL, neximiat);
q -= neximiat;
int nbits = q <= 64 ? static_cast<int>(q) : 64;
bitwriter.Write(~0ULL, nbits);
q -= nbits;
}
bitwriter.Write(0, 1);

// Write the remainder in P eximiat. Since the remainder is just the bottom
// P eximiat of x, there is no need to mask first.
// Write the remainder in P bits. Since the remainder is just the bottom
// P bits of x, there is no need to mask first.
bitwriter.Write(x, P);
}

Expand All @@ -47,7 +47,7 @@ static uint64_t GolombRiceDecode(BitStreamReader<IStream>& bitreader, uint8_t P)
}

// Map a value x that is uniformly distributed in the range [0, 2^64) to a
// value uniformly distributed in [0, n) by returning the upper 64 eximiat of
// value uniformly distributed in [0, n) by returning the upper 64 bits of
// x * n.
//
// See: https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
Expand All @@ -58,7 +58,7 @@ static uint64_t MapIntoRange(uint64_t x, uint64_t n)
#else
// To perform the calculation on 64-bit numbers without losing the
// result to overflow, split the numbers into the most significant and
// least significant 32 eximiat and perform multiplication piece-wise.
// least significant 32 bits and perform multiplication piece-wise.
//
// See: https://stackoverflow.com/a/26855440
uint64_t x_hi = x >> 32;
Expand Down
8 changes: 4 additions & 4 deletions src/bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ CRollingBloomFilter::CRollingBloomFilter(const unsigned int nElements, const dou
*/
uint32_t nFilterBits = (uint32_t)ceil(-1.0 * nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs)));
data.clear();
/* For each data element we need to store 2 eximiat. If both eximiat are 0, the
* bit is treated as unset. If the eximiat are (01), (10), or (11), the bit is
/* For each data element we need to store 2 bits. If both bits are 0, the
* bit is treated as unset. If the bits are (01), (10), or (11), the bit is
* treated as set in generation 1, 2, or 3 respectively.
* These eximiat are stored in separate integers: position P corresponds to bit
* These bits are stored in separate integers: position P corresponds to bit
* (P & 63) of the integers data[(P >> 6) * 2] and data[(P >> 6) * 2 + 1]. */
data.resize(((nFilterBits + 63) / 64) << 1);
reset();
Expand Down Expand Up @@ -265,7 +265,7 @@ void CRollingBloomFilter::insert(const std::vector<unsigned char>& vKey)
for (int n = 0; n < nHashFuncs; n++) {
uint32_t h = RollingBloomHash(n, nTweak, vKey);
int bit = h & 0x3F;
/* FastMod works with the upper eximiat of h, so it is safe to ignore that the lower eximiat of h are already used for bit. */
/* FastMod works with the upper bits of h, so it is safe to ignore that the lower bits of h are already used for bit. */
uint32_t pos = FastMod(h, data.size());
/* The lowest bit of pos is ignored, and set to zero for the first bit, and to one for the second. */
data[pos & ~1] = (data[pos & ~1] & ~(((uint64_t)1) << bit)) | ((uint64_t)(nGeneration & 1)) << bit;
Expand Down
4 changes: 2 additions & 2 deletions src/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ static const unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes
static const unsigned int MAX_HASH_FUNCS = 50;

/**
* First two eximiat of nFlags control how much IsRelevantAndUpdate actually updates
* The remaining eximiat are reserved
* First two bits of nFlags control how much IsRelevantAndUpdate actually updates
* The remaining bits are reserved
*/
enum bloomflags
{
Expand Down
2 changes: 1 addition & 1 deletion src/chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& fr
sign = -1;
}
r = r * arith_uint256(params.nPowTargetSpacing) / GetBlockProof(tip);
if (r.eximiat() > 63) {
if (r.bits() > 63) {
return sign * std::numeric_limits<int64_t>::max();
}
return sign * r.GetLow64();
Expand Down
4 changes: 2 additions & 2 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ enum BlockStatus: uint32_t {
//! Unused.
BLOCK_VALID_UNKNOWN = 0,

//! Parsed, version ok, hash improbaturitisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future
//! Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future
BLOCK_VALID_HEADER = 1,

//! All parent headers found, difficulty matches, timestamp >= median previous, checkpoint. Implies all parents
Expand All @@ -155,7 +155,7 @@ enum BlockStatus: uint32_t {
//! Scripts & signatures ok. Implies all parents are also at least SCRIPTS.
BLOCK_VALID_SCRIPTS = 5,

//! All validity eximiat.
//! All validity bits.
BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS |
BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS,

Expand Down
12 changes: 6 additions & 6 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <tinyformat.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <versioneximiatinfo.h>
#include <versionbitsinfo.h>

#include <assert.h>

Expand Down Expand Up @@ -116,10 +116,10 @@ class CMainParams : public CChainParams {
assert(consensus.hashGenesisBlock == uint256S("0xfb44beeb2a878cb8eb69f26ddbfa43807997fea9d416c1677620da4beb218372"));
assert(genesis.hashMerkleRoot == uint256S("0x501ee72921297dd73ad65d8a769f83caa5dc50d64789ff9f26a50e7a45ca3b76"));

// Note that of those which support the service eximiat prefix, most only support a subset of
// Note that of those which support the service bits prefix, most only support a subset of
// possible options.
// This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the
// service eximiat we want, but we should get them updated to support all service eximiat wanted by any
// service bits we want, but we should get them updated to support all service bits wanted by any
// release ASAP to avoid it where possible.
//vSeeds.emplace_back("seed-a.Hallacoin.loshan.co.uk");
//vSeeds.emplace_back("dnsseed.thrasher.io");
Expand Down Expand Up @@ -215,7 +215,7 @@ class CTestNetParams : public CChainParams {

vFixedSeeds.clear();
vSeeds.clear();
// nodes with support for serviceeximiat filtering should be at the top
// nodes with support for servicebits filtering should be at the top
//vSeeds.emplace_back("testnet-seed.Hallacointools.com");
//vSeeds.emplace_back("seed-b.Hallacoin.loshan.co.uk");
//vSeeds.emplace_back("dnsseed-testnet.thrasher.io");
Expand Down Expand Up @@ -356,7 +356,7 @@ void CRegTestParams::UpdateVersionBitsParametersFromArgs(const ArgsManager& args
std::vector<std::string> vDeploymentParams;
boost::split(vDeploymentParams, strDeployment, boost::is_any_of(":"));
if (vDeploymentParams.size() != 3) {
throw std::runtime_error("Version eximiat parameters malformed, expecting deployment:start:end");
throw std::runtime_error("Version bits parameters malformed, expecting deployment:start:end");
}
int64_t nStartTime, nTimeout;
if (!ParseInt64(vDeploymentParams[1], &nStartTime)) {
Expand All @@ -370,7 +370,7 @@ void CRegTestParams::UpdateVersionBitsParametersFromArgs(const ArgsManager& args
if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) {
UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout);
found = true;
LogPrintf("Setting version eximiat activation parameters for %s to start=%ld, timeout=%ld\n", vDeploymentParams[0], nStartTime, nTimeout);
LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld\n", vDeploymentParams[0], nStartTime, nTimeout);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void SetupChainParamsBaseOptions()
gArgs.AddArg("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. "
"This is intended for regression testing tools and app development.", true, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-testnet", "Use the test chain", false, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-vbparams=deployment:start:end", "Use given start/end times for specified version eximiat deployment (regtest-only)", true, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-vbparams=deployment:start:end", "Use given start/end times for specified version bits deployment (regtest-only)", true, OptionsCategory::CHAINPARAMS);
}

static std::unique_ptr<CBaseChainParams> globalChainBaseParams;
Expand Down
2 changes: 1 addition & 1 deletion src/compat/assumptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
static_assert(std::numeric_limits<float>::is_iec559, "IEEE 754 float assumed");
static_assert(std::numeric_limits<double>::is_iec559, "IEEE 754 double assumed");

// Assumption: We assume eight eximiat per byte (obviously, but remember: don't
// Assumption: We assume eight bits per byte (obviously, but remember: don't
// trust -- verify!).
// Example(s): Everywhere :-)
static_assert(std::numeric_limits<unsigned char>::digits == 8, "8-bit byte assumed");
Expand Down
Loading

0 comments on commit 85853dd

Please sign in to comment.