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

@diego/v3 #1015

Merged
merged 26 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ddb821c
Adds possibility to use "*" to auto-select address in placeauctionbid…
Jouzo Nov 26, 2021
0535a08
Reduce complexity by throwing first if isNull
Jouzo Nov 26, 2021
b5bbba2
Remove dangling brace
Jouzo Nov 26, 2021
dd7cad4
Fix test assertion
Jouzo Nov 27, 2021
98ac64f
Remove print in tests
Jouzo Nov 29, 2021
0ac1119
Merge branch 'master' into feature/loan_autoselectaccount
prasannavl Dec 2, 2021
fee339b
Merge branch 'master' into feature/loan_autoselectaccount
prasannavl Dec 7, 2021
cce2ce6
Use nHeight as height field may be incorrect
Bushstar Dec 15, 2021
6ec84f9
Factor out usage of height field in block header
Bushstar Dec 15, 2021
0a33783
Factor out usage of height field in CBlockIndex
Bushstar Dec 15, 2021
27154e7
Merge branch 'master' into fix-incorrect-height
prasannavl Dec 22, 2021
8c68ce0
Merge pull request #987 from DeFiCh/fix-incorrect-height
prasannavl Dec 22, 2021
c83ad4d
Merge branch 'master' into feature/loan_autoselectaccount
prasannavl Dec 24, 2021
218a87c
Merge pull request #937 from DeFiCh/feature/loan_autoselectaccount
prasannavl Dec 24, 2021
2286182
Add start BTC height and record limit to spv_listanchors (#921)
Bushstar Dec 24, 2021
4801205
Rework mempool accounts view (#904)
bvbfan Dec 24, 2021
66c2869
Fix getmasternodeblocks depth filtering (#946)
dcorral Dec 24, 2021
0028c57
Enable composite swap for `testpoolswap` (#954)
mambisi Dec 26, 2021
bd788ba
Version 2.3.2 (#1000)
prasannavl Dec 27, 2021
0035a7e
Fix excess logging of composite swap (#1003)
prasannavl Dec 27, 2021
ef03ef4
Add support for test only composite swap without balance transfers (#…
prasannavl Dec 27, 2021
3e56d57
Add CalculateSwap testonly support
prasannavl Dec 27, 2021
0b63d4f
Adds FortCanningHillHeight (#1005)
dcorral Dec 29, 2021
6a0f659
Disable ICX - Version 2.4.0 (#1010)
Bushstar Jan 2, 2022
7f8b565
Add checkpoint (#1013)
Bushstar Jan 3, 2022
d612a20
Merge branch 'v3' into @diego/v3
dcorral Jan 3, 2022
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
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 3)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_MINOR, 4)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
2 changes: 1 addition & 1 deletion src/bench/checkblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state)
CValidationState validationState;
CheckContextState ctxState;

bool checked = CheckBlock(block, validationState, chainParams->GetConsensus(), ctxState, false);
bool checked = CheckBlock(block, validationState, chainParams->GetConsensus(), ctxState, false, 413567);
assert(checked);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bench/duplicate_inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void DuplicateInputs(benchmark::State& state)
while (state.KeepRunning()) {
CValidationState cvstate{};
CheckContextState ctxState;
assert(!CheckBlock(block, cvstate, chainparams.GetConsensus(), ctxState, false, false));
assert(!CheckBlock(block, cvstate, chainparams.GetConsensus(), ctxState, false, nHeight, false));
assert(cvstate.GetRejectReason() == "bad-txns-inputs-duplicate");
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/blockencodings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ bool PartiallyDownloadedBlock::IsTxAvailable(size_t index) const {
return txn_available[index] != nullptr;
}

ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing) {
ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing, const int height) {
assert(!header.IsNull());
uint256 hash = header.GetHash();
block = header;
Expand All @@ -200,7 +200,7 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
CValidationState state;
CheckContextState ctxState;

if (!CheckBlock(block, state, Params().GetConsensus(), ctxState, false)) {
if (!CheckBlock(block, state, Params().GetConsensus(), ctxState, false, height)) {
// TODO: We really want to just check merkle tree manually here,
// but that is expensive, and CheckBlock caches a block's
// "checked-status" (in the CBlock?). CBlock should be able to
Expand Down
2 changes: 1 addition & 1 deletion src/blockencodings.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class PartiallyDownloadedBlock {
// extra_txn is a list of extra transactions to look at, in <witness hash, reference> form
ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn);
bool IsTxAvailable(size_t index) const;
ReadStatus FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing);
ReadStatus FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing, const int height);
};

#endif // DEFI_BLOCKENCODINGS_H
14 changes: 7 additions & 7 deletions src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class CBlockIndex
uint32_t nBits;

// proof-of-stake specific fields
uint64_t height;
uint64_t deprecatedHeight;
uint64_t mintedBlocks;
uint256 stakeModifier; // hash modifier for proof-of-stake
std::vector<unsigned char> sig;
Expand Down Expand Up @@ -222,7 +222,7 @@ class CBlockIndex
nTime = 0;
nBits = 0;
stakeModifier = uint256{};
height = 0;
deprecatedHeight = 0;
mintedBlocks = 0;
sig = {};
minterKeyID = {};
Expand All @@ -241,7 +241,7 @@ class CBlockIndex
hashMerkleRoot = block.hashMerkleRoot;
nTime = block.nTime;
nBits = block.nBits;
height = block.height;
deprecatedHeight = block.deprecatedHeight;
mintedBlocks = block.mintedBlocks;
stakeModifier = block.stakeModifier;
sig = block.sig;
Expand Down Expand Up @@ -276,7 +276,7 @@ class CBlockIndex
block.nTime = nTime;
block.nBits = nBits;
block.stakeModifier = stakeModifier;
block.height = height;
block.deprecatedHeight = deprecatedHeight;
block.mintedBlocks = mintedBlocks;
block.sig = sig;
return block;
Expand Down Expand Up @@ -330,7 +330,7 @@ class CBlockIndex
std::sort(pbegin, pend);

// Only after FC and when we have a full set of times.
if (height >= Params().GetConsensus().FortCanningHeight && pend - pbegin == nMedianTimeSpan) {
if (nHeight >= Params().GetConsensus().FortCanningHeight && pend - pbegin == nMedianTimeSpan) {
// Take the median of the top five.
return pbegin[8];
}
Expand Down Expand Up @@ -424,7 +424,7 @@ class CDiskBlockIndex : public CBlockIndex
READWRITE(nTime);
READWRITE(nBits);
READWRITE(stakeModifier);
READWRITE(height);
READWRITE(deprecatedHeight);
READWRITE(mintedBlocks);
READWRITE(sig);
}
Expand All @@ -438,7 +438,7 @@ class CDiskBlockIndex : public CBlockIndex
block.nTime = nTime;
block.nBits = nBits;
block.stakeModifier = stakeModifier;
block.height = height;
block.deprecatedHeight = deprecatedHeight;
block.mintedBlocks = mintedBlocks;
block.sig = sig;

Expand Down
17 changes: 14 additions & 3 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, uint32_t nTime, uint3
genesis.nTime = nTime;
genesis.nBits = nBits;
genesis.nVersion = nVersion;
genesis.height = 0;
genesis.deprecatedHeight = 0;
genesis.stakeModifier = uint256S("0");
genesis.mintedBlocks = 0;
genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
Expand Down Expand Up @@ -128,6 +128,8 @@ class CMainParams : public CChainParams {
consensus.EunosPayaHeight = 1072000; // Aug 05, 2021.
consensus.FortCanningHeight = 1367000; // Nov 15, 2021.
consensus.FortCanningMuseumHeight = 1430640;
consensus.FortCanningParkHeight = 1503143;
consensus.FortCanningHillHeight = std::numeric_limits<int>::max();
consensus.GreatWorldHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
Expand Down Expand Up @@ -308,6 +310,7 @@ class CMainParams : public CChainParams {
{850000, uint256S("2d7d58ae18a74f73b9836a8fffd3f65ce409536e654a6c644ce735215238a004")},
{875000, uint256S("44d3b3ba8e920cef86b7ec096ab0a2e608d9fedc14a59611a76a5e40aa53145e")},
{895741, uint256S("61bc1d73c720990dde43a3fec1f703a222ec5c265e6d491efd60eeec1bdb6dc3")},
{1505965,uint256S("f7474c805de4f05673df2103bd5d8b8dea09b0d22f808ee957a9ceefc0720609")},
}
};

Expand Down Expand Up @@ -349,6 +352,8 @@ class CTestNetParams : public CChainParams {
consensus.EunosPayaHeight = 463300;
consensus.FortCanningHeight = 686200;
consensus.FortCanningMuseumHeight = 724000;
consensus.FortCanningParkHeight = std::numeric_limits<int>::max();
consensus.FortCanningHillHeight = std::numeric_limits<int>::max();
consensus.GreatWorldHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
Expand Down Expand Up @@ -532,6 +537,8 @@ class CDevNetParams : public CChainParams {
consensus.EunosPayaHeight = 300;
consensus.FortCanningHeight = std::numeric_limits<int>::max();
consensus.FortCanningMuseumHeight = std::numeric_limits<int>::max();
consensus.FortCanningParkHeight = std::numeric_limits<int>::max();
consensus.FortCanningHillHeight = std::numeric_limits<int>::max();
consensus.GreatWorldHeight = std::numeric_limits<int>::max();

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
Expand Down Expand Up @@ -707,6 +714,8 @@ class CRegTestParams : public CChainParams {
consensus.EunosPayaHeight = 10000000;
consensus.FortCanningHeight = 10000000;
consensus.FortCanningMuseumHeight = 10000000;
consensus.FortCanningParkHeight = 10000000;
consensus.FortCanningHillHeight = 10000000;
consensus.GreatWorldHeight = 10000000;

consensus.pos.diffLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
Expand Down Expand Up @@ -919,8 +928,10 @@ void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
consensus.EunosKampungHeight = static_cast<int>(eunosHeight.value());
}
UpdateHeightValidation("Eunos Paya", "-eunospayaheight", consensus.EunosPayaHeight);
UpdateHeightValidation("Fork canning", "-fortcanningheight", consensus.FortCanningHeight);
UpdateHeightValidation("Fork canning museum", "-fortcanningmuseumheight", consensus.FortCanningMuseumHeight);
UpdateHeightValidation("Fort canning", "-fortcanningheight", consensus.FortCanningHeight);
UpdateHeightValidation("Fort canning museum", "-fortcanningmuseumheight", consensus.FortCanningMuseumHeight);
UpdateHeightValidation("Fort canning park", "-fortcanningparkheight", consensus.FortCanningParkHeight);
UpdateHeightValidation("Fort canning hill", "-fortcanninghillheight", consensus.FortCanningHillHeight);
UpdateHeightValidation("Great World", "-greatworldheight", consensus.GreatWorldHeight);

if (!args.IsArgSet("-vbparams")) return;
Expand Down
2 changes: 2 additions & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ struct Params {
int EunosPayaHeight;
int FortCanningHeight;
int FortCanningMuseumHeight;
int FortCanningParkHeight;
int FortCanningHillHeight;
int GreatWorldHeight;

/** Foundation share after AMK, normalized to COIN = 100% */
Expand Down
2 changes: 2 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ void SetupServerArgs()
gArgs.AddArg("-eunospayaheight", "EunosPaya fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-fortcanningheight", "Fort Canning fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-fortcanningmuseumheight", "Fort Canning Museum fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-fortcanningparkheight", "Fort Canning Park fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-fortcanninghillheight", "Fort Canning Hill fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-greatworldheight", "Great World fork activation height (regtest only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
gArgs.AddArg("-jellyfish_regtest", "Configure the regtest network for jellyfish testing", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
#ifdef USE_UPNP
Expand Down
4 changes: 2 additions & 2 deletions src/masternodes/masternodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ void CCustomCSView::CalcAnchoringTeams(const uint256 & stakeModifier, const CBlo
std::map<arith_uint256, CKeyID, std::less<arith_uint256>> authMN;
std::map<arith_uint256, CKeyID, std::less<arith_uint256>> confirmMN;
ForEachMasternode([&] (uint256 const & id, CMasternode node) {
if(!node.IsActive(pindexNew->height))
if(!node.IsActive(pindexNew->nHeight))
return true;

// Not in our list of MNs from last week, skip.
Expand Down Expand Up @@ -820,7 +820,7 @@ void CCustomCSView::CalcAnchoringTeams(const uint256 & stakeModifier, const CBlo

{
LOCK(cs_main);
SetAnchorTeams(authTeam, confirmTeam, pindexNew->height);
SetAnchorTeams(authTeam, confirmTeam, pindexNew->nHeight);
}

// Debug logging
Expand Down
Loading