-
Notifications
You must be signed in to change notification settings - Fork 213
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
Make error handling of relic errors thread-safe #46
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Compile relic with MULTI=PTHREAD to enable thread-local contexts 2. Use core_set_thread_initializer to register an initializer for the thread-local context. Whenever core_get() is called now, the context will be initialized automatically for the current thread (if not already initialized). 3. Remove BLS::Clean. Was never called and is also not useful anymore due each thread having its own context now. 4. Remove AssertInitialized and all calls to it. This is not needed anymore as initialization happens automatically now. 5. Add simple test case to assert that each thread has it's own context
codablock
added a commit
to codablock/dash
that referenced
this pull request
Nov 1, 2018
Brings in: 1. Chia-Network/bls-signatures#41 2. Chia-Network/bls-signatures#46 3. A few commits from https://github.com/codablock/bls-signatures are now merged into upstream. This removes the need for manual initialization of the BLS library. This is now done internally and in a thread-safe way. Also switch to using tags instead of raw commit hashes. Makes testing easier and also removes the risk of Github deleting commits due to cleanup jobs.
codablock
added a commit
to codablock/dash
that referenced
this pull request
Nov 1, 2018
Brings in: 1. Chia-Network/bls-signatures#41 2. Chia-Network/bls-signatures#46 3. A few commits from https://github.com/codablock/bls-signatures are now merged into upstream. This removes the need for manual initialization of the BLS library. This is now done internally and in a thread-safe way. Also switch to using tags instead of raw commit hashes. Makes testing easier and also removes the risk of Github deleting commits due to cleanup jobs.
UdjinM6
pushed a commit
to dashpay/dash
that referenced
this pull request
Nov 1, 2018
Brings in: 1. Chia-Network/bls-signatures#41 2. Chia-Network/bls-signatures#46 3. A few commits from https://github.com/codablock/bls-signatures are now merged into upstream. This removes the need for manual initialization of the BLS library. This is now done internally and in a thread-safe way. Also switch to using tags instead of raw commit hashes. Makes testing easier and also removes the risk of Github deleting commits due to cleanup jobs.
mariano54
approved these changes
Nov 1, 2018
psolstice
pushed a commit
to firoorg/firo
that referenced
this pull request
Jan 6, 2020
Brings in: 1. Chia-Network/bls-signatures#41 2. Chia-Network/bls-signatures#46 3. A few commits from https://github.com/codablock/bls-signatures are now merged into upstream. This removes the need for manual initialization of the BLS library. This is now done internally and in a thread-safe way. Also switch to using tags instead of raw commit hashes. Makes testing easier and also removes the risk of Github deleting commits due to cleanup jobs.
camenlx
added a commit
to zocteam/zeroonecoin
that referenced
this pull request
Aug 2, 2020
* Remove global fDIP0003ActiveAtTip and fix wrong use of VersionBitsState in auto IX (#2380) * Remove global fDIP0003ActiveAtTip flag and always use VersionBitsState fDIP0003ActiveAtTip was used much more often when introduced but turned out to be not very useful in most places. Always use VersionBitsState now. * Fix wrong use of VersionBitsState auto IX * Make sure isAutoLockBip9Active flag is reset in case of chain reorgs * Fix prepare_masternodes/create_masternodes in DashTestFramework (#2382) Specify masternodeblsprivkey which is required in masternode mode now. This should fix IS test failures which occur because of `Warning: You should specify a masternodeblsprivkey in the configuration. Please see documentation for help.` init error (there are other issues, so auto-IS test are still going to fail). * Implement mt_pooled_secure_allocator and use it for BLS secure allocation (#2375) * Add pooled_secure_allocator and mt_pooled_secure_allocator * Use mt_pooled_secure_allocator for BLS secure allocation The old solution relied on thread-local-storage and was thus not compatible to libc6 2.11 (which is the minimum supported version we use). Also, the old solution turned out to be erroneous. It would have crashed or memory leaked when ownership of CBLSPrivateKey would be handled over to another thread. * Add new header files to Makefile.am * Fix copyright headers of new files * Bail out early from secure deallocation * Clean up global BLS keys when shutting down * Rewrite handling of too long depends builds in .travis.yml (#2385) The old solution was unnecessarily complicated and resulted in failed tests to be shown as successful (the exit code was ignored). * Support "fast" mode when calling sync_masternodes (#2383) This will call "mnsync next" multiple times to force finishing of mnsync. Also reduce sleep time to 200ms. * Implement RemoveAskFor to indicate that we're not interested in an item anymore (#2384) * Implement RemoveAskFor to indicate that we're not interested in an item anymore When an INV item is received from the first node, the item is requested immediately. If the same item is received from another node, an entry is added to mapAskFor which marks the item for re-requesting in case the first node did not respond. When the item is received from the first node, the item was previously never removed from mapAskFor. Only the later getdata loop in SendMessages would then gradually remove items from the map. This is quite delayed however as the entries in mapAskFor have a timeout value. RemoveAskFor allows to remove all entries from mapAskFor and setAskFor when we are not interested in the item anymore (e.g. because we received it already). * Call RemoveAskFor whenever we receive a message * Only pass hash instead of CInv object to RemoveAskFor * Don't revert to INV based block announcements when the previous block is the devnet genesis block (#2388) Assume that the other node already has the previous block if it matches the devnet genesis block. * Prepare DIP3 for testnet and reuse DIP3 deployment for autoix deployment (#2389) * Add BIP9 parameters for DIP3 deployment on testnet * Remove autoix BIP9 deployment and reuse DIP3 deployment * Add BIP9CheckMasternodesUpgraded to chain params This controls if miners should check for upgraded masternodes first before adding BIP9 bits to the block version. This only makes sense in network where masternodes are up and running before BIP9 activation, which is not necessarely the case in regtest and devnet. Also refactor ComputeBlockVersion to use fCheckMasternodesUpgraded instead of the inverse fAssumeMasternodeIsUpgraded. It is set to false by default and only set to true in CreateNewBlock. * Check for upgraded masternodes for DIP3 activation (only mainnet and testnet) * Bump PROTOCOL_VERSION and DMN_PROTO_VERSION We probably have nodes with 70211 already running on testnet. * Bump version to 0.13.0 (#2386) * Fix crash when deterministic MN list is empty and keep paying superblocks in this case (#2387) * Don't crash when spork15 is enabled but no MNs have been registered * Don't bail out when no masternode payee is found We should pay superblocks even if no masternode payee is found. * Add missing newline to LogPrint call * Handle review comments * Add merkle tree and coinbase transaction to the `protx diff` rpc command (#2392) * PrivateSend spending txes should have "outgoing" icon on overview screen (#2396) * Relay txes through MN network faster than through regular nodes (#2397) * Half the delay for relaying txes to Masternode outbound peers comparing to regular ones * No delay for relaying txes if our node is a Masternode * Force fvisibility=hidden when compiling on macos (#2398) This should remove tons of warnings about mismatching visibility * Do not ignore patches in depends (#2399) * Ensure correct order of destruction for BLS secure allocator (#2401) Uses the same trick as LockedPoolManager::Instance() * Undefine DOUBLE after include Chia BLS headers (#2400) These cause compilation errors on some platforms. Observed this when I tried to cross compile win32 locally on a Debian Stretch machine. * Properly escape $ in Jenkinsfile.gitian (#2404) * Sign ProRegTx collaterals with a string message instead of payload hash, split `protx register` into `prepare`/`submit` (#2395) * RPC: Add help details for the bls RPC (#2403) * RPC: Add help details for the bls RPC * RPC: Refactor to match gobject RPC behavior * RPC: Use command instead of strCommand for consistency within file * RPC: BLS help cleanup * RCP: Remove leading underscore on bls_help * A couple of fixes for init steps (#2405) * fLiteMode should be set via GetBoolArg before first usage Also move related stuff to be closer to each other * Cleanup Dash-specific init steps * Move deterministicMNManager creation slightly higher for consistensy * A couple of fixes for shutdown sequence (#2406) * Do not run scheduled DoMaintenance if shutdown was requested * Don't dump cache files if the load sequence was interrupted * Stop privatesend and release keys before wallet flush * fix typo * Trivial: Protx operator reward clarification (#2407) Add decimal places to clarify: 1. Non-integers are valid (e.g. 3.25) 2. Granularity - anything beyond x.xx is rounded (e.g. 3.259 -> 3.26) This is due to DIP3 allowing values 0-10000 for operator reward (1/10000 = 0.01%) * Fix p2p-instantsend.py test (#2408) * Update Chia bls-signature to latest version (#2409) Brings in: 1. Chia-Network/bls-signatures#41 2. Chia-Network/bls-signatures#46 3. A few commits from https://github.com/codablock/bls-signatures are now merged into upstream. This removes the need for manual initialization of the BLS library. This is now done internally and in a thread-safe way. Also switch to using tags instead of raw commit hashes. Makes testing easier and also removes the risk of Github deleting commits due to cleanup jobs. * Trivial: Correct protx diff RPC help (#2410) * Drop custom PS logic for guessing fees etc. from SelectCoins (#2371) * drop most of custom PS logic from SelectCoins and inject it into regular flow (i.e. SelectCoinsMinConf) * different priority for different denoms * move CompareByPriority higher * update comment Co-Authored-By: UdjinM6 <[email protected]> * Explicitly specify which branch of Wine to install (#2411) Specifying only `wine` results in this message under Ubuntu Bionic: Package wine is a virtual package provided by: wine-stable 3.0-1ubuntu1 wine-development 3.6-1 You should explicitly select one to install. Compilation * Allow collaterals for non-DIP3 MNs which were created after DIP3/BIP9 activation (#2412) * Remove reference to now removed "protocolVersion" * Allow to use non-DIP3 collaterals after DIP3 activation This removes a rule which only made sense when we assumed all collaterals would remain in DIP3 ProRegTx transactions after DIP3 activation. As we allow to refer external collaterals now, this rule should vanish as well. * Sleep in case block time is ahead of real time See comment. This was not a problem before as we had enough time passed between the last block that caused this and the start-alias call. Now we added another start-alias call which is directly after we generated many blocks. * Fix auto-IS tests (#2414) * no `-debug` by default (it's too heavy) * drop useless `sync_masternodes` calls and add a couple where they could be actually usefull * change autoix-mempool.py test logic: 1. use separate nodes to send test txes 2. sync nodes while filling the mempool * Unify help display logic for various "complex" rpc commands (#2415) * Unify help display logic for various "complex" rpc commands * add [[ noreturn ]] attribute and drop dummy returns * Clang format PrivateSend files (#2373) * bump PS copyright (#2417) * Clang evo folder and activemasternode.* (#2418) * clang + manual formatting * clang activemasternode.* * bump copyright * weirdness correction * Translations 201811 (#2249) * update en source * remove pt_BR it's no longer present on Transifex * Update existing translations NOTE: there are some mismatches in zh_CN dash_zh_CN.ts: Mismatch between 'Start &all' and '启动全部(%A)' dash_zh_CN.ts: Mismatch between 'Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.' and '打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。' dash_zh_CN.ts: Mismatch between 'Too many %f denominations, removing.' and '太多面额化资金,正在移除。' dash_zh_CN.ts: Mismatch between 'Initialization sanity check failed. %s is shutting down.' and '初始化完整性检查失败。% 即将关闭。' * Add ar, ko, th NOTE: there are 2 mismatches in ar dash_ar.ts: Mismatch between '(of %1 GB needed)' and '(على 1% جيغابايت محتاجة)' dash_ar.ts: Mismatch between 'Output debugging information (default: %u, supplying <category> is optional)' and 'معلومات تصحيح الخرج <category>ا(ختياري)' * update bg, it, ja, ko, nl, pl, th * fix ru * add tr * fix * Add 5th denom, drop deprecated logic and bump min PS version (#2318) * Bump PS - add 5th denom (0.001) - always allow OP_RETURN in PS collaterals - collateral amount is always 1/10 of the smallest denom - bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70211 * drop backward compatibility in dsa/dsq serialization * Use GetSmallestDenomination() in GetCollateralAmount() * bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70212 * RPC: protx help corrections (#2422) * RPC - Correct protx register_prepare help example Use collateral hash and index instead of address * RPC - Change protx register help ECDSA address to BLS operator key * RPC - protx register_prepare help correction Should direct to protx register help, not protx register_fund * RPC - protx help typo * Fix sub-command help for masternode, gobject and protx rpcs (#2425) Fixes #2424 * [Formatting] masternodelist.* clang+manual format (#2426) * format * clang suggested changes to be reverted * Revert "clang suggested changes to be reverted" This reverts commit 2c1e7744be1a2f6dd07772f222c656b2ebaa7718. * Update hardcoded seeds (#2429) * Update seeds for mainnet * Update seeds for testnet * Fix ps collateral/denom creation tx category confusion (#2430) * fix ps collateral/denom creation tx confusion * clarify the logic of detecting PrivateSendMakeCollaterals/PrivateSendCreateDenominations category * Update defaultAssumeValid, nMinimumChainWork and checkpoints (#2428) * Update defaultAssumeValid and nMinimumChainWork for mainnet * Update defaultAssumeValid and nMinimumChainWork for testnet * Add checkpoint for mainnet * Add checkpoint for testnet * Allow reusing of external collaterals in DIP3 (#2427) * Allow to reuse collaterals and addresses in ProRegTx This also requires to move out the duplication check from CheckService to the 2 individual ProTx check methods. * Implement replacement logic for reused collaterals * Add tests for new replacement logic * Parallel ASN resolve and allow passing of input file names to makeseeds.py (#2432) * Resolve ASNs in parallel * Allow passing of filename to makeseeds.py * Add a column for IS lock status on Transactions tab (#2433) * Drop colorizing for IS * Add IS column * Add IS filter * Show BIP9 progress in getblockchaininfo (#2435) * Implement VersionBitsCountBlocksInWindow This gives the count of blocks that voted for the given BIP9 deployment * Add additional information to BIP9 softforks returned by getblockchaininfo * make sure progress doesn't exceed 1 * Add coinbase_payload to getblocktemplate help (#2437) * Fix protx/bls rpc help (#2438) * Use proTxHash instead of outpoint when calculating masternode scores (#2440) * Track confirmedHash of masternodes * Also include confirmedHash in DIP4 * Implement CalculateQuorum and CalculateScores in CDeterministicMNList * Use new ProRegTx based scoring function in GetMasternodeScores * Update test vectors for simplifiedmns_merkleroots tests * Restart MNs in DIP3 tests even if collateral has not moved (#2441) These need to be restarted even in this case as keys are cycled when upgrade_mn_protx is called. This resulted in invalid IX votes but was not noticed because only 2 MNs were affected (still 8 of 10 votes succesful) * Make error messages re payload a bit more specific * Log mempool payload errors instead of crashing via assert * no cs_main in specialtxes * Be more specific about tx version in conditions We don't want to set rules for version 4+ txes atm. * More checks for tx type * Revert #2441 and retry fixing (#2444) * Revert "Restart MNs in DIP3 tests even if collateral has not moved (#2441)" This reverts commit 153afb9. * Reuse old legacy MN key when upgrading to protx * Remove restriction that forced use of same addresses for payout and collateral * Allow P2SH for payout scripts * Move internal collateral check to the else branch of the external collateral check * Also forbid reusing collateral key for owner/voting keys We previously only checked for the payee key. * GetMasternodeInfo with payee argument should do nothing when DIP3 is active Also change ComputeBlockVersion to directly use mnList.GetMNPayee() * Do not use keyIDCollateralAddress anymore when spork15 is active * Fix check for number of params to protx_update_service (#2443) * Pass "-parallel=3" to reduce load on Travis nodes while testing * Make sure protx_update_registrar adds enough funds for the fees FundSpecialTx must take the size of signature into account. * Test P2SH/multisig payee addresses in DIP3 tests * Fix test_fail_create_protx in DIP3 tests This slipped through in a previous pull request and makes tests fail. * Allow to specify how log to sleep between attempts in wait_until * Use ForEachMN and GetMN in BuildDiff instead of directly accessing mnMap * Implement BuildSimplifiedDiff in CDeterministicMNList And use it instead of BuildDiff in DIP4 * Allow P2SH/multisig addresses for operator rewards There is no reason left to stick with the P2PKH limitation * Apply suggestions from code review Co-Authored-By: codablock <[email protected]> * Sleep longer between attempts in sync_blocks * Remove few leftovers of `-instantsenddepth` * Update manpages * Install libxkbcommon0 in gitian-linux.yml This fixes an issue reported by users on Ubuntu 18.04 LTS. They got the following error message when starting dash-qt: xkbcommon: ERROR: failed to add default include path auto Qt: Failed to create XKB context! Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, add ':' as separator to provide several search paths and/or make sure that XKB configuration data directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ . Dash-qt starts then, but does not accept any input from the keyboard. The reason is that qt tries to find the xkb config root in the configure phase, but fails to find it. To make this detection work, libxkbcommon has to be installed on the host system, even though it is then never used. * Implement tab for DIP3 MN list (#2454) * Implement tab for DIP3 MN list * Update src/qt/masternodelist.cpp Co-Authored-By: codablock <[email protected]> * Change "x.xx% to UNSPECIFIED" to "x.xx% but not claimed" for opeartor reward * Updating translations for de, es, fi, nl, pt, sk, zh_CN, zh_TW (#2451) * Updating de, es, fi, nl, pt, sk, zh_CN, zh_TW Known issues: dash_zh_CN.ts: Mismatch between 'Start &all' and '启动全部(%A)' dash_zh_CN.ts: Mismatch between 'Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.' and '打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。' dash_zh_CN.ts: Mismatch between 'Too many %f denominations, removing.' and '太多面额化资金,正在移除。' dash_zh_CN.ts: Mismatch between 'Initialization sanity check failed. %s is shutting down.' and '初始化完整性检查失败。% 即将 * Fix issues in zh_CN * Add platform dependent include_directories in CMakeLists.txt (#2455) This gives much better auto-completion and code analysis in CLion. Also add src/qt/forms to include path. * Let ccache compress the cache by itself instead of compressing ccache.tar (#2456) The cache can become quite large and uncompressing/recompressing it is slow. Better to let ccache handle compression as it will then only perform it on files which are actually used. * Corrections to incorrect syntax in RPC help (#2466) * Fix incorrect inline help for "protx update_registrar" Initial ProRegTx does not define a field named "collateralAddress". It is not necessary to use the collateral address to receive payout, any Dash address can be defined here. * Fix incorrect syntax for "protx revoke" inline help "operatorKey" is required here * Do not hold cs_main while emitting messages in WalletModel::prepareTransaction (#2463) * Do not hold cs_main while emitting messages Fixes potential deadlock: ``` POTENTIAL DEADLOCK DETECTED Previous lock order was: (1) cs_deqsessions privatesend-client.cpp:966 (2) cs_main privatesend-client.cpp:816 Current lock order is: (2) cs_main qt/walletmodel.cpp:299 wallet->cs_wallet qt/walletmodel.cpp:299 (1) cs_deqsessions privatesend-client.cpp:350 ``` * Keep CWalletTx* newTx in inner scope * trivail, clarifies help text for protx register (#2462) * fix protx register rpc help (#2461) * Implement context menu and extra info on double-click for DIP3 masternode list (#2459) * Implement context menu and extra info on double-click for DIP3 masternode list Menu items: - "Copy ProTx hash" - "Copy Collateral hash" On double click: Show simple message box with the json representation of the DMN. * Fix review comments * Use ParseFixedPoint instead of ParseDoubleV in "protx register" commands (#2458) * Few trivial fixes for DIP2/DIP3 (#2474) * Fix wrong index for argument to protx_update_service when error is thrown * Unify and fix variable name in TxToJSON The UniValue variable name for TRANSACTION_COINBASE was wrong and is fixed now. Also changed names for all other special TXs to unify names. This should avoid such errors in the future when new "else if" branches are copy/pasted. * Use "proRegTx" instead of "proTx" as key TRANSACTION_PROVIDER_REGISTER payloads * Forbid version=0 in special TXs (#2473) * Base dsq/dstx thresholold on total number of up to date masternodes (#2465) Mixing on a newer version with small number of upgraded masternodes causes mixing txes to "stuck" - old nodes refuse to relay dstxes from new ones because they come from the same masternodes too often. Basing threshold on the total number of up to date masternodes and not only on a newer (enabled) ones should solve this. This however will cause mixing to fail if there are not enough masternodes on the needed protocol version (i.e. at least GetMinMasternodePaymentsProto()) but it's better to stop mixing than having funds kind of spent yet not confirmed for a long time. * Add univalue test for real numbers (#2460) * Properly initialize confirmedHash in CSimplifiedMNListEntry (#2479) * Properly initialize confirmedHash in CSimplifiedMNListEntry * Add consensus params for temporary hard-fork on testnet This hard-fork is required on testnet as we have to fix a few consensus bugs in DIP3/DIP4. It will also be required to introduce LLMQ commitments to testnet. * Add temporary fork-logic for testnet, which sets confirmedHash to null ...before fork activation. Otherwise we'd invalidate all DIP3 blocks on testnet. * Bump nTemporaryTestnetForkHeight to 273000 * Fix filtering of the lock votes for SPV nodes. (#2468) * check request is not empty to use it for filtering * Filter vote INVs by tx hash * fix lock requests filtering * Apply suggestions from code review Co-Authored-By: gladcow <[email protected]> * Update PS help text for the new denom (#2471) * Fix make deploy error on macos (#2475) * Implement and enforce DIP6 commitments (#2477) * Add LLMQ parameters to consensus params * Add DIP6 quorum commitment special TX * Implement CQuorumBlockProcessor which validates and handles commitments * Add quorum commitments to new blocks * Propagate QFCOMMITMENT messages to all nodes * Allow special transactions in blocks which have no inputs/outputs But only for TRANSACTION_QUORUM_COMMITMENT for now. * Add quorum commitments to self-crafted blocks in DIP3 tests * Add simple fork logic for current testnet This should avoid a fork on the current testnet. It only applies to the current chain which activated DIP3 at height 264000 and block 00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f. When we revert the chain to retest the DIP3 deployment, this fork logic can be removed again. * Use quorumVvecHash instead of quorumHash to make null commitments unique Implementation of dashpay/dips#31 * Re-add quorum commitments after pruning mempool selected blocks * Refactor CQuorumBlockProcessor::ProcessBlock to have less nested if/else statements Also add BEGIN/END markers for temporary code. * Add comments/documentation to LLMQParams * Move code which determines if a commitment is required into IsCommitmentRequired This should make the code easier to read and also removes some duplication. The also changes the error types that are possible from 3 to 2 now. Instead of having "bad-qc-already-mined" and "bad-qc-not-mining-phase", there is only "bad-qc-not-allowed" now. * Use new parameter from consensus parames for the temporary fork * Remove an unused function from governance object collateral code (#2480) * [GUI] Realign tx filter widgets (#2485) Also hide watch-only filter when no watch-only addresses are used (corresponding column already has this kind of behaviour). * Include masternodeProTxHash in CTxLockVote (#2484) * Introduce proTxHash to CActiveMasternodeInfo * Include masternodeProTxHash in CTxLockVote * Also restart MNs which didn't have the collateral moved, but do it later (#2483) * Bump masternodeman cache version (#2467) * Add IS parameter for gobject prepare (#2452) * Add IS parameter for gobject prepare * Update if statement Co-Authored-By: PastaPastaPasta <[email protected]> * Update src/rpc/governance.cpp Co-Authored-By: PastaPastaPasta <[email protected]> * Update src/rpc/governance.cpp Co-Authored-By: PastaPastaPasta <[email protected]> * use aqua gui theme (#2472) * Implement PoSe based on information from LLMQ commitments (#2478) Members which are not in the validMembers bitsets are now PoSe punished. The maximum PoSe score is dynamic and mostly identical to the number of registered MNs. Added PoSe scores for failures are then a percentage of the maximum score, so that we can better control how often failures are allowed per payment cycle. For LLMQ failures, this is 66% to allow approximately 2 failures per payment cycle. * Fix CreateDenominated failure for addresses with huge amount of inputs (#2486) * Allow specifing max number of outpoints to be returned per address in SelectCoinsGroupedByAddresses Fixes CreateDenominated failure for addresses with huge amount of inputs * Apply suggested fixes * Fix dsq/dsa conditions (#2487) * Apply new dsq rules in StartNewQueue and DSACCEPT * Apply similar logic to vecMasternodesUsed * Add extra check for DSACCEPT * Add 0 entry to vTxSigOps when adding quorum commitments (#2489) This fixes a crash observed on Travis. The same crash is likely to happen outside of Travis as well later. * Should check dsq queue regardless of the mixing state (#2491) * Fix recent changes in DSA conditions (#2494) * pr2487 bugfix * push reject msg * Sync blocks before creating TXs (#2496) * Do not sort resulting vector in SelectCoinsGroupedByAddresses (#2493) Apply specific sort in each case separately instead (when needed). * Bump nTemporaryTestnetForkHeight to 274000 (#2498) * Perform less instant send tests in DIP3 tests (#2499) These take quite some time on Travis. * Try to fix a few sporadic instant send failures in DIP3 tests (#2500) * Sleep in wait_for_instant_lock when TX is not known yet We'll otherwise stress the CPU quite a lot, which might in turn result in instant send timeouts. * Wait for all nodes to have the instant send lock Otherwise individual nodes might end up not being able to catch up, especially when it's the last iteration and we generate 6 blocks after it. * Use getrawtransaction in wait_for_instant_lock instead of gettransaction gettransaction fails if the TX is not owned by the wallet * Give instant send tests more time after DIP3 activation Signature verification changes to BLS when DIP3 gets activated, which is much more resource hungry. Give instant send tests more time after DIP3 activation until we do proper batched verification of instant send signatures. * Disconnect peers with version < 70212 after DIP3 activation via BIP9 (#2497) * Disconnect peers with version < 70212 after DIP3 activation via BIP9 * Send REJECT and log when diconnecting peers after DIP3 activation * Implement CDummyDKG and CDummyCommitment until we have the real DKG merged (#2492) * Add SPORK_17_QUORUM_DKG_ENABLED spork * Implement CDummyDKG and CDummyCommitment until we have the real DKG merged This is only used on testnet/devnet/regtest and will NEVER be used on mainnet. It is NOT SECURE AT ALL! See comment in quorums_dummydkg.h for more details. * Test simple PoSe in DIP3 tests * Generate 2 instead of 4 blocks per iteration in PoSe tests 4 was based on old chainparams where I used larger phases. * Only sleep when necessary in PoSe tests * Fix typo in comment * Give PoSe tests more time and sync after fast-forward * Trivial: protx fund_register RPC help corrections (#2502) * Revert "Apply similar logic to vecMasternodesUsed" (#2503) This reverts commit ebb120005292bc077d6dd7c4ce8adbe25167bf16. * Put height into mined commitments and use it instead of the special handling of quorumVvecHash (#2501) * Allow to skip sig verification for CFinalCommitment::Verify * Add CFinalCommitmentTxPayload and CheckLLMQCommitment and use it As described in dashpay/dips#31 (see discussion). * Properly ban nodes for invalid commitments * Add quorumModifierHash to instant send lock vote (#2505) * Let GetMasternodeRank also return the block hash at the given height * Add outpointConfirmedBlock to CTxLockVote and verify it * Match order of parameters with member order * Rename outpointConfirmedBlock to quorumModifierHash * Add overload of GetMasternodeRank that does not return the block hash * Fix crashes in "protx" RPCs when wallet is disabled (#2509) * Fix check for nTemporaryTestnetForkDIP3Height (#2508) This caused a crash when performing a full-sync. * Use "registered" as default for "protx list" (#2513) "wallet" was confusing too many users as it shows an empty list if the local wallet does not own any keys for any MN. * Deserialize CFinalCommitmentTxPayload instead of CFinalCommitment in TxToJSON (#2510) * Deserialize CFinalCommitmentTxPayload instead of CFinalCommitment in TxToJSON * Implement ToJson for CFinalCommitmentTxPayload and use it in TxToJSON Otherwise the nVersion and nHeight members of it are not shown. * Still support "protx list" and "protx diff" when wallet is disabled at compile time (#2511) * Don't fully remove protx commands when ENABLE_WALLET is not set * Check for wallet support at run-time for protx commands * Only show subcommands that require the wallet when ENABLE_WALLET is set * Add and use CheckWalletOwnsKey which is able to check wallet support at runtime * Properly handle disabled wallets in "protx list" This now also handles the case where ENABLE_WALLET is not defined. * Drop comment that doesn't fully apply anymore * Clear votes which were created before spork15 activation and use operator key for non-funding votes (#2512) * Clear votes which were created before spork15 activation * Reject incoming votes which were created pre-DIP3 * Only use voting keys for VOTE_SIGNAL_FUNDING The other vote signals are meant to be emitted by sentinel and must thus be signed with the operator key. * Simplify GetMinVoteTime * Review suggestions/fixes * Add missing mutex in CGovernanceObject::RemoveOldVotes * Print the state object when ProcessSpecialTxsInBlock fails in ConnectBlock (#2516) Currently, when any DIP2/3/6 validation fails, there is no error message printed that shows what exactly went wrong. * Punish nodes which keep requesting and then rejecting blocks (#2518) * Move deserialization of REJECT message fields out of if(fDebug) * Ban nodes which keep requesting and then rejecting blocks * Don't read/deserialize reject hash twice * Only use ban score of 1 * Use a verbosity instead of two verbose parameters (#2506) * Allow consuming specific UTXO in gobject prepare command (#2482) * Implement optional CoinControl for gobject prepare * Removes duplicate `);` from merge error Co-Authored-By: PastaPastaPasta <[email protected]> * Fix equality check allowing more relevant help output * Pass COutPoint as const reference Co-Authored-By: PastaPastaPasta <[email protected]> * Remove unnecessary SetNull call Co-Authored-By: PastaPastaPasta <[email protected]> * Specify proposal fee Co-Authored-By: PastaPastaPasta <[email protected]> * Fix GUI warnings in debug.log (#2521) Specifically: ``` GUI: QMetaObject::connectSlotsByName: No matching signal for on_extraInfoDIP3_doubleClicked() GUI: QMetaObject::connectSlotsByName: No matching signal for on_copyProTxHash_clicked() GUI: QMetaObject::connectSlotsByName: No matching signal for on_copyCollateralOutpoint_clicked() ``` * Call ProcessTick every second, handle tick cooldown inside (#2522) * Bail out from GetBlockTxOuts in case nBlockHeight is above tip+1 (#2523) In the future, we should make sure that this method is only called for the currently mined block or for old blocks, but never for non-existing blocks further in the future. * Drop pre-DIP3 votes from current votes per MN per object (#2524) * Avoid printing DIP3/DIP4 related logs twice (#2525) All logging that happens in BuildNewListFromBlock is currently printed twice. This is because BuildNewListFromBlock is called while processing the block and also while calculating the DIP4 MN list commitment. This commit adds the debugLogs to this method to allow omitting logs while called from the DIP4 code. * Fix multiple issues with governance voting after spork15 activation (#2526) * Check resulting signature for validity when signing with BLS operator keys * Support specifying proTxHash when using "gobject vote-alias" The "alias-name" is now interpreted as proTxHash when deterministic MN lists are active. The classical "alias" as found in masternode.conf has no meaning after spork15 activation. * Don't use masternode.conf list in gobject_vote_many when spork15 is active Keys don't match anymore so we should only rely on the deterministic list and the local wallet's keys. * Check for pwalletMain not being null in gobject_vote_many * Allow to use vote-conf for non-proposal votes when spork15 is active This fixes sentinel not being able to create triggers on testnet. * Fix error message * Fix no-wallet compilation and check for pwalletMain at runtime * Don't respond with getdata for legacy inv types when spork15 is active (#2528) Avoid unnecessary traffic from non-upgraded nodes. * Also stop asking other peers for a TX when ProcessTxLockRequest fails (#2529) This is moving up the RemoveAskFor call above the ProcessTxLockRequest call. If ProcessTxLockRequest fails, we should not re-request the same TX/IX from other nodes as it will continue to fail. * Add dummy/hidden column to carry the proTxHash per MN list entry... (#2530) ...and use this in GetSelectedDIP3MN. This fixes copy/paste issues with MNs that don't have a valid address (PoSe banned). * Fix wrong total MN count in UI and "masternode count" RPC (#2527) * Use CountMasternodes() in ClientModel::getMasternodeCountString * Use CountMasternodes() for total count in masternode_count * Fix CountMasternodes() to give correct number of masternodes with spork15 enabled Also change CountEnabled to not call CountMasternodes anymore but instead have its own implementation which uses GetValidMNsCount instead of GetAllMNsCount * Apply review suggestions * Allow filtering by proTxHash on DIP3 MN tab (#2532) * Fix spork propagation while in IBD and fix spork integration tests (#2533) * Fix spork syncing issue in sporks tests dashpay/dash#2522 caused an issue with sporks syncing in tests. The introduced time check in CMasternodeSync::ProcessTick causes masternode sync to never start when mocktime is enabled, so this commit disables mocktime for sporks.py. Disabling mocktime however leads to fInitialDownload never becoming false in CMasternodeSync::UpdatedBlockTip, so mnsync is never started. To fix this, the tests now create a block before connecting the last node. This however doesn't work because node1 will ignore the "getheaders" request from node2 as it has not finished mnsync yet...so we also have to force finish mnsync for node1. * Also respond with getdata for announced sporks while in IBD There was never a good reason to ignore spork announcements while in IBD. At the same time, this poses the risk of missing out on sporks while in IBD. This also fixes an issue in sporks testing, as nodes did not request for announced sporks. * Use wait_to_sync instead of custom loop * Allow skipping of MN payments with zero duffs (#2534) * Allow skipping of MN payments with zero duffs In case a MNO uses an operator reward of 100%, the normal reward will be 0 duffs. It doesn't make sense to enforce these payments. This will cause a fork when miners start to mine with the new version, but only for nodes that didn't upgrade. * Apply suggestions from code review Co-Authored-By: codablock <[email protected]> * Use correct time field when removing pre-DIP3 votes (#2535) nTime is not the timestamp from the vote object. nCreationTime is the correct field to use. This fixes continues deletion of votes. * zocify base58 comment base58 ZOC-MAINNET 80 (0x50) PUBLIC - Z 10 (0x0A) SCRIPT - 198 (0xC6) SECRET - base58 ZOC-TESTNET 112 (0x70) PUBLIC - n 20 (0x14) SCRIPT - 240 (0xF0) SECRET - --- base58 DASH-MAINNET 76 (0x4C) PUBLIC - X 16 (0x10) SCRIPT - 204 (0xCC) SECRET - base58 DASH-TESTNET 140 (0x8C) PUBLIC - y 19 (0x13) SCRIPT - 8 OR 9 239 (0xEF) SECRET - 9 OR c * Serialize the block header in CBlockHeader::GetHash() (#2531) * Serialize the block header in CBlockHeader::GetHash() * Switch from CDataStream to CVectorWriter Co-Authored-By: solardiz <[email protected]> * Remove ProTxs from mempool that refer to a ProRegTx for which the collateral was spent (#2539) * Track TXs in mempool which refer to an existing ProTx * When a block is added, remove TXs that refer to ProTxs with spent collaterals * Initalize evoDb and deterministicMNManager in BasicTestingSetup instead of TestingSetup. Now that the mempool uses deterministicMNManager, we need to initialize it for all tests that might use the mempool. * Watch for changes in operator key and disable local MN (#2541) * Introduce dummy (ping-like) contributions for the dummy DKG (#2542) * Implement creation and propagation of dummy contributions These act as a ping which is broadcast a few blocks before the dummy commitments are created. They are meant to determine online/offline members. * Use information about received dummy contributions to determine validMembers * Fix PoSe tests * Fix dummy DKG phase progress in PoSe tests and give tests more time Mine one block at a time until we reach the mining phase. * Reintroduce BLSInit to correctly set secure alloctor callbacks (#2543) dashpay/dash#2409 removed the need to call the Init method of the Chia BLS library, but we also accidently removed the initialization of the secure allocator. * Refactor CQuorumBlockProcessor and CDeterministicMNManager (#2536) * Refactor CDeterministicMNManager::ProcessBlock: pintexPrev -> pindex->pprev and/or adjust logic accordingly * Refactor CQuorumBlockProcessor::ProcessBlock: pintexPrev -> pindex->pprev and/or adjust logic accordingly * Drop unused * Don't delete/add values to the unique property map when it's null (#2538) * Don't delete/add values to the unique property map when it's null This happens when revoking operator keys, as the revoked MN will then have the address and operator keys set to the null representation. We shouldn't add the null value to the unique property map as otherwise future revokes crash in an assert. * Assert that no null values are passed to Add/DeleteUniqueProperty * Check for null values before calling Add/DeleteUniqueProperty * Apply suggestions from code review Co-Authored-By: codablock <[email protected]> * Add user generated default constructors to BLS primitives Fixes build issues on Mac: In file included from evo/deterministicmns.cpp:5: ./evo/deterministicmns.h:375:24: error: default initialization of an object of const type 'const CBLSPublicKey' without a user-provided default constructor static const T nullValue; ^ * Track operator key changes in mempool and handle conflicts (#2540) * Track ProTx operator key changes in mempool * Remove ProTx conflicts from mempool when ProUpRegTx or ProUpRevTx changed keys * Only allow one operator key change per MN in in mempool * Sort recipients in SendCoins dialog via BIP69 rule (#2546) * Correctly handle spent collaterals for MNs that were registered in the same block (#2553) * Move spent collateral handling to the bottom of BuildNewListFromBlock * Handle conflicts with spent collaterals in mempool * Bail out from update methods in MasternodeList when shutdown is requested (#2551) * Further refactoring of CQuorumBlockProcessor (#2545) * Switch GetQuorumBlockHash from CBlockIndex* to nHeight * `pindexPrev -> pindex` for ProcessCommitment * Switch IsCommitmentRequired from CBlockIndex* to block height * Switch GetMinableCommitment/Tx from CBlockIndex* to block height * Add `AssertLockHeld(cs_main);` Co-Authored-By: UdjinM6 <[email protected]> * Ensure EvoDB consistency for quorum commitments by storing the best block hash (#2537) * Ensure EvoDB consistency by storing the best block hash This approach is similar to the one used for chainstate currently. Ensures that: - nodes that upgraded after DIP3 has all the data processed correctly (they will crash and require reindex); - evodb/ is removed when blocks/ is removed (otherwise sync will fail due to duplicate records). * Implement CEvoDB::VerifyBestBlock/WriteBestBlock and call them from ConnectBlock/DisconnectBlock * Fix walletbackup.py * Match recipients with txouts by scriptPubKey in reassignAmounts() (#2548) * Match recipients with txouts by scriptPubKey in reassignAmounts() * Drop no longer used nChangePosRet from reassignAmounts() params * Revert "Sort recipients in SendCoins dialog via BIP69 rule (#2546)" (#2549) This reverts commit 18cd596. * Make sure that we can get inputType and fUseInstantSend regardless of the way recipients are sorted (#2550) * Make sure that we can get inputType and fUseInstantSend regardless of the way recipients are sorted * Move "for" loops outside of "if"s * Allow up to MASTERNODE_MAX_MIXING_TXES (5) DSTXes per MN in a row (#2552) * Remove temporary code which forked testnet at block 274000 * Bump nPowKGWHeight for testnet and cause a fork at height 4001 This will reset testnet so that we can start with a clean state. * Change CSV, DIP0001 and BIP147 deployments to start today * Change DIP0003 deployment to start today * Update nMinimumChainWork and defaultAssumeValid for block 4000 * Remove checkpoints above block 4000 * Bump nPowKGWHeight for testnet and cause a fork at height 4001 This will reset testnet so that we can start with a clean state. * Change CSV, DIP0001 and BIP147 deployments to start today * Update nMinimumChainWork and defaultAssumeValid for block 4000 * Remove checkpoints above block 4000 * Bump to 0.12.3.4 * Update release-notes.md and copy 0.12.3.3 release-notes * Don't check for nSuperblockStartHash on testnet * Don't check for nSuperblockStartHash on testnet * Remove temporary fork handling for emergency difficulty reduction on testnet As we reset testnet, we can also remove the special handling for old blocks. * Remove temporary fork handling for emergency difficulty reduction on testnet As we reset testnet, we can also remove the special handling for old blocks. * Bump PROTOCOL_VERSION and DMN_PROTO_VERSION to 70213 (#2557) * Bump PROTOCOL_VERSION and DMN_PROTO_VERSION to 70213 This will disconnect all nodes from the old testnet chain when DIP3 gets activated through BIP9. Also update comments where 70212/70213 was referenced. * Also bump MIN_PEER_PROTO_VERSION_DIP3 and MIN_PRIVATESEND_PEER_PROTO_VERSION * Update testnet seeds to point to MNs that are on the new chain (#2558) * Unify "protx list" options (#2559) * Add missing masternodeblsprivkey help text (#2569) * Remove legacy MN list tabs on spork15 activation (#2567) * Remove legacy masternode tabs on DIP3 activation * Move setInvisible call for dip3NoteLabel up Otherwise it takes a minute until it's actually made invisible. * Bail out early from updateMyNodeList when spork15 is active Otherwise we risk accessing destroyed Qt objects. * Show correct operator payee address in DIP3 MN list GUI (#2563) * Show correct operator payee address in DIP3 MN list GUI * Rename dest to operatorDest * Force FlushStateToDisk on ConnectTip/DisconnectTip while not in IBD (#2560) * Fix optional revocation reason parameter for "protx revoke" and a few help strings (#2568) * Fix optional revocation reason parameter for "protx revoke" * Fix "protx revoke" help message * Remove obsolete help text about masternode operator keys and wallets * Remove proposal/funding votes from MNs that changed the voting key (#2570) * Rename onlyOwnerAllowed boolean variables to onlyVotingKeyAllowed This was misleading. * Remove invalid proposal votes when MN voting keys change * Add ownerAddr and votingAddr to CDeterministicMNState::ToJson (#2571) * Load sporks before checking blockchain (#2573) * Backport network checks missing in CActiveDeterministicMasternodeManager::Init() (#2572) * Backport network checks missing in CActiveDeterministicMasternodeManager::Init() * Drop mainnnet/non-mainnet port verification part moved to 2576 * Enforce correct port on mainnet for DIP3 MNs (#2576) * Fix IsBlockPayeeValid (#2577) - should skip while not synced regardless of spork15 state - add missing logprintf * Do not accept sporks with nTimeSigned way too far into the future (#2578) * Add an option to use specific address as a source of funds in protx rpc commands (otherwise use payoutAddress/operatorPayoutAddress) (#2581) * Add an option to use specific address as a source of funds in protx rpc commands * fix typo "must" * Always use payoutAddress (or operatorPayoutAddress) as a default if no fundAddress was specified * make sure we actually selected some inputs * fundAddress -> feeSourceAddress * Align help text with new logic * fix protx_update_service * fix protx_revoke * Add fRequireAllInputs to CCoinControl and use it in FundSpecialTx This avoids adding all inputs even though they are not needed. * Allow to specify empty operator payout address and simplify fee code in update_service DIP3 tests were failing to call "protx update_service" as it did not accept an empty "operatorPayoutAddress". This also simplifies handling of the feeSourceAddr. * Specify source for funds and fees in DIP3 tests * Merge v0.12.3.4 commits into develop (#2582) * Bump to 0.12.3.3 * Fix crash bug with duplicate inputs within a transaction Introduced by #9049 * Remove redundant parameter fCheckDuplicateInputs from CheckTransaction * Release notes 0.12.3.3 * Bump nPowKGWHeight for testnet and cause a fork at height 4001 This will reset testnet so that we can start with a clean state. * Change CSV, DIP0001 and BIP147 deployments to start today * Update nMinimumChainWork and defaultAssumeValid for block 4000 * Remove checkpoints above block 4000 * Bump to 0.12.3.4 * Update release-notes.md and copy 0.12.3.3 release-notes * Don't check for nSuperblockStartHash on testnet * Remove temporary fork handling for emergency difficulty reduction on testnet As we reset testnet, we can also remove the special handling for old blocks. * Add BIP9 deployment for DIP3 on mainnet (#2585) * Release notes 0.13.0.0 draft (#2583) * Release notes 0.13.0.0 * Mention privatesendmultisession=1 requirement for fast mixing * Update release-notes.md * Update release-notes.md * small fix * add 2585 * Gracefully shutdown on evodb inconsistency instead of crashing (#2611) (#2620) * Backport 2618 to v0.13.0.x (#2619) Add owner and voting addresses to rpc output, unify it across different methods. Also fix keyid option in `masternode list` rpc. * [0.13.0.x] Translations201901 (#2592) * fix source files * make translate: en strings * ru * fi * vi * pl * bg, de, it, ko, nl, sk, tr, zh_CN * es, th * ar dash_ar.ts: Mismatch between 'Are you sure you want to start masternode %1?' and 'هل أنت متأكد أنك تريد بدء ماسترنود 1%؟' dash_ar.ts: Mismatch between 'Output debugging information (default: %u, supplying <category> is optional)' and 'معلومات تصحيح الخرج <category>ا(ختياري)' * ar, es, pt, tr dash_ar.ts: Mismatch between 'Are you sure you want to start masternode %1?' and 'هل أنت متأكد أنك تريد بدء ماسترنود 1%؟' dash_ar.ts: Mismatch between 'Output debugging information (default: %u, supplying <category> is optional)' and 'معلومات تصحيح الخرج * fi * fr, zh_TW * ja * Remove support for "0" as an alternative to "" when the default is requested (#2622) (#2624) * Remove support for "0" as an alternative to "" when the default is requested * Update src/rpc/rpcevo.cpp Co-Authored-By: codablock <[email protected]> * Update immer to c89819df92191d6969a6a22c88c72943b8e25016 (#2626) * Set CLIENT_VERSION_IS_RELEASE to true (#2591) * Update 0.13.0.0 release notes (#2621) * Update 0.13.0.0 release notes * Apply suggestions from code review Co-Authored-By: UdjinM6 <[email protected]> * add latest commits * [0.13.0.x] Add notes about changes in mining (#2628) * Add `Mining` section to `Notable changes`, mention P2SH and `script` in `getblocktemplate` * Also mention `coinbase_payload` * Update current copyright year 2018 --> 2019 * Add social media buttons * Add social media button variables * version zuffs ipv6 * badplayer fees,max10k InstaSend,use sentinel * qt clientmodel.cpp:89 remove; * qt clientmodel.cpp:87 tr string * sporks 15 and 16 * sporks 15 Params * compile1error * compile2error * re-ord sporks * SPORK_11_MNSIG_TOTAL * reSPORKs,mnlist * public:FindNode * re-sporks,4 rc build w26 * fixed-seeds * implemented social media icons * add qt res at Makefile.qt.include * icon pixel * disabled gitian caching to fix builds * v1301-2020 v01301-2020 * v01301-2020 * v01301-2020 - v0.13.0.1-31062w31 * v01301-2020 - v0.13.0.1-31062w31 Co-authored-by: Alexander Block <[email protected]> Co-authored-by: UdjinM6 <[email protected]> Co-authored-by: Anton Suprunchuk <[email protected]> Co-authored-by: thephez <[email protected]> Co-authored-by: UdjinM6 <[email protected]> Co-authored-by: strophy <[email protected]> Co-authored-by: PastaPastaPasta <[email protected]> Co-authored-by: InhumanPerfection <[email protected]> Co-authored-by: gladcow <[email protected]> Co-authored-by: -k <[email protected]> Co-authored-by: Salisbury <[email protected]> Co-authored-by: Solar Designer <[email protected]> Co-authored-by: Kitty <[email protected]> Co-authored-by: Owen <[email protected]>
xdustinface
referenced
this pull request
in xdustinface/bls-signatures
Oct 29, 2020
* Support initialization callback for thread-local contexts in relic * Make the library thread safe 1. Compile relic with MULTI=PTHREAD to enable thread-local contexts 2. Use core_set_thread_initializer to register an initializer for the thread-local context. Whenever core_get() is called now, the context will be initialized automatically for the current thread (if not already initialized). 3. Remove BLS::Clean. Was never called and is also not useful anymore due each thread having its own context now. 4. Remove AssertInitialized and all calls to it. This is not needed anymore as initialization happens automatically now. 5. Add simple test case to assert that each thread has it's own context
xdustinface
added a commit
to xdustinface/bls-signatures
that referenced
this pull request
Oct 29, 2020
xdustinface
referenced
this pull request
in xdustinface/bls-signatures
Oct 29, 2020
* Support initialization callback for thread-local contexts in relic * Make the library thread safe 1. Compile relic with MULTI=PTHREAD to enable thread-local contexts 2. Use core_set_thread_initializer to register an initializer for the thread-local context. Whenever core_get() is called now, the context will be initialized automatically for the current thread (if not already initialized). 3. Remove BLS::Clean. Was never called and is also not useful anymore due each thread having its own context now. 4. Remove AssertInitialized and all calls to it. This is not needed anymore as initialization happens automatically now. 5. Add simple test case to assert that each thread has it's own context
PastaPastaPasta
referenced
this pull request
in dashpay/bls-signatures
Nov 17, 2020
* Support initialization callback for thread-local contexts in relic * Make the library thread safe 1. Compile relic with MULTI=PTHREAD to enable thread-local contexts 2. Use core_set_thread_initializer to register an initializer for the thread-local context. Whenever core_get() is called now, the context will be initialized automatically for the current thread (if not already initialized). 3. Remove BLS::Clean. Was never called and is also not useful anymore due each thread having its own context now. 4. Remove AssertInitialized and all calls to it. This is not needed anymore as initialization happens automatically now. 5. Add simple test case to assert that each thread has it's own context
UdjinM6
pushed a commit
to UdjinM6/bls-signatures
that referenced
this pull request
Nov 30, 2022
…Chia-Network#46) * build: move sole reference to FetchContent to python-bindings * dashbls: avoid macro conflict by renaming conflicting variable * build: add barebones alternative build system support (GNU Autotools) * build: add support for some definition-based build switches * build: add support for gmp detection and backend * ci: add support for building with GNU Autotools * ci: temporarily drop rdrnd support for autotools builds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See individual commits.