Commit Graph

16756 Commits

Author SHA1 Message Date
Konstantin Akimov
b2ad5302ce
refactor: simplify comparator in rpc/governance 2023-12-21 23:04:44 -06:00
Konstantin Akimov
4083fff0b2
refactor: drop circular dependency governance/object <-> governance/validators 2023-12-21 23:04:43 -06:00
Konstantin Akimov
2bb6361dc0
cleanup: removed unused definitions from governance/object.h 2023-12-21 23:04:43 -06:00
Konstantin Akimov
7e13727738
refactor: drop circular dependency validationinterface <-> governance/object 2023-12-21 23:04:43 -06:00
Konstantin Akimov
4de30f4b61
refactor: a default constructor for Governance::Object 2023-12-21 23:04:42 -06:00
Konstantin Akimov
64a153d634
refactor: untie governance/object and wallet implementation 2023-12-21 23:04:40 -06:00
Konstantin Akimov
42e65f4541 chore: remaining TODO goes to other PRs 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c3c9ccf261 refactor: drop global variable fDIP0001ActiveAtTip - partial implementation
Impossible to drop it completelly right now because:
 - net doesn't know any details about chain - can't check status of fork
 - the functional test feature_maxuploadtarget.py assume block size 1Mb
 - DIP0001 can't be activated from regtest early block2 because big txes are
 not allowed after DIP0001

refactor: drop global variable fDIP0001ActiveAtTip - attempt 2
2023-12-21 23:02:31 -06:00
Konstantin Akimov
1b3237d147 fix: remove unused cs_main lock from src/miner.cpp - it's not used by EHF logic anymore 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f57859f777 refactor: drop llmq_versionbitscache in favor of g_versionbitscache
Note: g_versionbitscache is reset in UnloadBlockIndex()
2023-12-21 23:02:31 -06:00
Konstantin Akimov
917089d542 refactor: drop public llmq::utils::IsV20Active method 2023-12-21 23:02:31 -06:00
Konstantin Akimov
bc0f0bf852 chore: removed TODO for TESTNET_LLMQ_25_67_ACTIVATION_HEIGHT so far as have no idea why it is not matching with v19 activation 2023-12-21 23:02:31 -06:00
Konstantin Akimov
70fa626381 refactor: drop dependency validation on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
db4379348c refactor: drop dependency miner on llmq::utils::IsV20Active 2023-12-21 23:02:31 -06:00
Konstantin Akimov
5d4b16a783 refactor: drop public method llmq::utils::IsV19Active 2023-12-21 23:02:31 -06:00
Konstantin Akimov
55abf7fa8d refactor: drop dependency test/evo_deterministicmns_tests on llmq::utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
ad4d753bd7 refactor: use DeploymentActiveAfter in llmq/blockprocessor 2023-12-21 23:02:31 -06:00
Konstantin Akimov
1ed7f0cca4 refactor: use DeploymentActiveAfter instead llmq::utils in rpc/ 2023-12-21 23:02:31 -06:00
Konstantin Akimov
39dc612eee refactor: drop dependency test/util/setup_common on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c4d634c051 refactor: use DeploymentActiveAfter in init.cpp 2023-12-21 23:02:31 -06:00
Konstantin Akimov
7bce9d8209 refactor: use CFinalCommitment::GetVersion in llmq/{commitment,dkgsession} 2023-12-21 23:02:31 -06:00
Konstantin Akimov
9aa437115a refactor: use DeploymentActiveAfter in evo/mnauth 2023-12-21 23:02:31 -06:00
Konstantin Akimov
2128d58b4f refactor: use DeploymentActiveAfter in cbtx 2023-12-21 23:02:31 -06:00
Konstantin Akimov
488c895a65 refactor: use DeploymentActiveAfter in ehf_signals 2023-12-21 23:02:31 -06:00
Konstantin Akimov
377d929edc refactor: drop dependency evo/simplifiedmns on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c742b9acf5 refactor: drop unused llmq::utils::IsMNRewardReallocationActive 2023-12-21 23:02:31 -06:00
Konstantin Akimov
a79aa56d9b refactor: move out helper IsDIP3Enforced from deterministicmns 2023-12-21 23:02:31 -06:00
Konstantin Akimov
5a84eb0f0a refactor: drop default value from IsDIP3Enforced() 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f7274c450b refactor: use deployment status in deterministicmns instead llmq's helpers 2023-12-21 23:02:31 -06:00
Konstantin Akimov
13adedb423 refactor: move common code in deterministicmns to the helper 2023-12-21 23:02:31 -06:00
Konstantin Akimov
251a89736d refactor: rename argument pindex to pindexPrev in GetMNPayee and GetProjectedMNPayees 2023-12-21 23:02:31 -06:00
Konstantin Akimov
82c01ea664 refactor: drop dependency creditpool on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
e94f5753c9 refactor: drop dependency of specialtxman on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
bacaa805ea fix: use proper pindex/pindex->pprev in credit pool code during v20/mn_rr activations 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f3d2f2da26 refactor: drop dependency unit test block_reward_reallocation_tests on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c25d336e95 refactor: drop dependency masternode/payments on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
8f3d3db9a4 refactor: drop dependency governance/classes on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c329615584 refactor: use value_or in std::optional 2023-12-21 23:02:31 -06:00
Konstantin Akimov
a7ad399824 refactor: drop IsDIP0024Active and its usage of llmq_vbc 2023-12-21 23:02:31 -06:00
Konstantin Akimov
68442e8dfe chore: add TODO for llmq/utils.h refactoring 2023-12-21 23:02:31 -06:00
PastaPastaPasta
acd2acd592
refactor: pass large structure by const reference on every RPC call (#5780) 2023-12-21 12:01:39 -06:00
UdjinM6
6fe36cc1cb
fix: Improve quorum caching (again) (#5761)
## Issue being fixed or feature implemented
1. `scanQuorumsCache` is a special one and we use it incorrectly.
2. Platform doesn't really use anything that calls `ScanQuorums()`
directly, they specify the exact quorum hash in RPCs so it's
`GetQuorum()` that is used instead. The only place `ScanQuorums()` is
used for Platform related stuff is `StartCleanupOldQuorumDataThread()`
because we want to preserve quorum data used by `GetQuorum()`. But this
can be optimised with its own (much more compact) cache.
3. RPCs that use `ScanQuorums()` should in most cases be ok with smaller
cache, for other use cases there is a note in help text now.

## What was done?
pls see individual commits

## How Has This Been Tested?
run tests, run a node (~in progress~ looks stable)

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-12-20 09:54:00 -06:00
UdjinM6
9a99a4abdc
fix(rpc): pass blockhash into TxToJSON so that getspecialtxes could show correct instantlock/chainlock values (#5774)
## Issue being fixed or feature implemented
`instantlock` and `chainlock` are broken in `getspecialtxes`

kudos to @thephez for finding the issue

## What was done?
pass the hash and also rename the variable to self-describing

## How Has This Been Tested?
run `getspecialtxes` on a node with and without the patch

## Breaking Changes
`instantlock` and `chainlock` will show actual values and not just
`false` all the time now (not sure if that qualifies for "breaking"
though)

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-12-19 07:43:36 -06:00
Odysseas Gabrielides
3bc77a6e1d
feat(rpc): submit chainlock signature if needed RPC (#5765)
## Issue being fixed or feature implemented
Once Platform is live, there could be an edge case where the CL could
arrive to an EvoNode faster through Platform quorum than regular P2P
propagation.

## What was done?
This PR introduces a new RPC `submitchainlock` with the following 3
mandatory parameters:
- `blockHash`, `signature` and `height`.

Besides some basic tests:
- If the block is unknown then the RPC returns an error (could happen if
the node is stucked)
- If the signature is not verified then the RPC return an error.
- If the node already has this CL, the RPC returns true.
- If the node doesn't have this CL, it inserts it, broadcast it through
the inv system and return true.

## How Has This Been Tested?
`feature_llmq_chainlocks.py` was modified with the following scenario:

1. node0 is isolated from the rest of the network
2. node1 mines a new block and waits for CL
3. Make sure node0 doesn't know the new block/CL (by checking
`getbestchainlock()`)
4. CL is submitted via the new RPC on node0
5. checking `getbestchainlock()` and make sure the CL was processed +
'known_block' is false
6. reconnect node0

## Breaking Changes
no

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: thephez <thephez@users.noreply.github.com>
2023-12-18 22:27:19 -06:00
Konstantin Akimov
e3d9327d17 refactor: replace usage of deterministicMNManager to new interface listMNCollaterials 2023-12-17 12:42:45 -06:00
Konstantin Akimov
2c61d842a9 refactor: new method listMNCollaterials() for chain interface 2023-12-17 12:42:45 -06:00
Konstantin Akimov
4966bf7582 refactor: use static method CDeterministicMNManager without touching global variable in wallet's code 2023-12-17 12:42:45 -06:00
Konstantin Akimov
2310e353ff refactor: use std::all_of in isGroupISLocked 2023-12-17 12:42:45 -06:00
Konstantin Akimov
41b71dc0f5 refactor: removed usage of llmq::chainLocksHandler from wallet 2023-12-17 12:42:45 -06:00
Konstantin Akimov
0fea98b65f refactor: replace llmq::quorumInstantSendManager->IsLocked() to new chain's interface 2023-12-17 12:42:45 -06:00