diff --git a/src/chainparams.cpp b/src/chainparams.cpp index f17f45ce0..12bae6997 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -98,9 +98,6 @@ class CMainParams : public CChainParams { consensus.defaultAssumeValid = uint256S( "000000000000000003aadeae9dee37b8cb4838a866dae19b54854a0f039b03e0"); - // Date and time (GMT): Saturday, October 10, 2020 4:00:00 PM - consensus.blsActivationTime = 1602345600; - /** * The message start string is designed to be unlikely to occur in * normal data. The characters are rarely used upper ASCII, not valid as @@ -201,9 +198,7 @@ class CTestNetParams : public CChainParams { consensus.defaultAssumeValid = uint256S( "000000000000030bee568d677b6b99ee7d2d00b25d1fe95df5e73b484f00c322"); - // Date July 11, 2020, 4:00:00 pm GMT - //consensus.blsActivationTime = 1594483200; - consensus.blsActivationTime = 1595895427; + diskMagic[0] = 0x0d; diskMagic[1] = 0x08; diskMagic[2] = 0x13; @@ -281,9 +276,6 @@ class CRegTestParams : public CChainParams { // valid. consensus.defaultAssumeValid = uint256S("0x00"); - // TBD - consensus.blsActivationTime = 1999999999; - diskMagic[0] = 0xfa; diskMagic[1] = 0xbf; diskMagic[2] = 0xb5; diff --git a/src/combine_transactions.cpp b/src/combine_transactions.cpp index 1bfff704f..f0089356a 100644 --- a/src/combine_transactions.cpp +++ b/src/combine_transactions.cpp @@ -132,7 +132,6 @@ CMutableTransaction combine_transactions(const std::vector combined_sigs.push_back(uint8_t(sigHashType.getRawSigHashType())); cfinal << combined_sigs; - cfinal << OP_CHECKSIG; // do we need this?, check later // Push back vin now with new script vin.scriptSig = cfinal; diff --git a/src/consensus/activation.cpp b/src/consensus/activation.cpp index 1c39a129f..a6f03ad88 100644 --- a/src/consensus/activation.cpp +++ b/src/consensus/activation.cpp @@ -14,9 +14,5 @@ bool IsBLSEnabled(const Config &config, const CBlockIndex *pindexPrev) { if (pindexPrev == nullptr) { return false; } - - return pindexPrev->GetMedianTimePast() >= - gArgs.GetArg( - "-blsactivationtime", - config.GetChainParams().GetConsensus().blsActivationTime); + return true; } diff --git a/src/primitives/create_bls_transaction.cpp b/src/primitives/create_bls_transaction.cpp index e3b51c0c6..1e1690da9 100644 --- a/src/primitives/create_bls_transaction.cpp +++ b/src/primitives/create_bls_transaction.cpp @@ -102,8 +102,6 @@ auto CreatePrivateTxWithSig(const std::vector& keys, c << ToByteVector(pub); // Add random pubkeys to the last input c << aggSig; - c << OP_CHECKSIG; // since we have custom extraction not sure we actually - // need this, check later // Put Agg Sig + Random Public Keys into the vin of the last input of the // tx. diff --git a/src/script/standard.cpp b/src/script/standard.cpp index a84a7e7db..32fc509e3 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -123,7 +123,7 @@ bool IsValidBLSScriptSize(const CScript &script) { auto script_size = script.size(); //std::cout << "Script size = << " << script_size << "\n"; if (script_size > CPubKey::BLS_PUBLIC_KEY_SIZE+2) { - script_size -= (CPubKey::BLS_SIGNATURE_SIZE + 4); + script_size -= (CPubKey::BLS_SIGNATURE_SIZE + 3); return ((script_size % (CPubKey::BLS_PUBLIC_KEY_SIZE+1) == 0)); } else { return ((script.size() == CPubKey::BLS_PUBLIC_KEY_SIZE+1) || diff --git a/src/validation.cpp b/src/validation.cpp index c2ddbf562..4a73dab85 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -342,11 +342,6 @@ std::string FormatStateMessage(const CValidationState &state) { state.GetRejectCode()); } -static bool IsBLSEnabledForCurrentBlock(const Config &config) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { - AssertLockHeld(cs_main); - return IsBLSEnabled(config, chainActive.Tip()); -} - // Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool // were somehow broken and returning the wrong scriptPubKeys static bool CheckInputsFromMempoolAndCache( @@ -642,10 +637,8 @@ static bool AcceptToMemoryPoolWorker( // Set extraFlags as a set of flags that needs to be activated. uint32_t extraFlags = SCRIPT_VERIFY_NONE; - if (IsBLSEnabledForCurrentBlock(config)) { - extraFlags |= SCRIPT_ENABLE_BLS; - extraFlags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; - } + extraFlags |= SCRIPT_ENABLE_BLS; + extraFlags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; // Make sure whatever we need to activate is actually activated. const uint32_t scriptVerifyFlags = @@ -1622,18 +1615,14 @@ static uint32_t GetBlockScriptFlags(const Config &config, // transactions using the OP_CHECKDATASIG opcode and it's verify // alternative. We also start enforcing push only signatures and // clean stack. - if (IsBLSEnabled(config, pChainTip)) { - flags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; - flags |= SCRIPT_VERIFY_SIGPUSHONLY; - flags |= SCRIPT_VERIFY_CLEANSTACK; - } + flags |= SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; + flags |= SCRIPT_VERIFY_SIGPUSHONLY; + flags |= SCRIPT_VERIFY_CLEANSTACK; // If the Great Wall fork is enabled, we start accepting transactions // recovering coins sent to BLS addresses. We also stop accepting 65 byte signatures in // CHECKMULTISIG and its verify variant. - if (IsBLSEnabledForCurrentBlock(config)) { - flags |= SCRIPT_ENABLE_BLS; - } + flags |= SCRIPT_ENABLE_BLS; return flags; } diff --git a/src/wallet/bls_tx.cpp b/src/wallet/bls_tx.cpp index 23c46d2fd..fcf67c562 100644 --- a/src/wallet/bls_tx.cpp +++ b/src/wallet/bls_tx.cpp @@ -117,8 +117,6 @@ auto CreatePrivateTxWithSig(const CWallet *pwallet, c << ToByteVector(pub); // Add random pubkeys to the last input c << aggSig; - c << OP_CHECKSIG; // since we have custom extraction not sure we actually - // need this, check later // Put Agg Sig + Random Public Keys into the vin of the last input of the // tx.