Skip to content

Appveyor Backports v0.18 - #4486

Merged
UdjinM6 merged 2 commits into
dashpay:developfrom
Munkybooty:appveyor-backports-v0.18
Oct 10, 2021
Merged

UdjinM6 merged 2 commits into
dashpay:developfrom
Munkybooty:appveyor-backports-v0.18

Conversation

@Munkybooty

Copy link
Copy Markdown

This is a very small pr because it pulls all of the code that is not related to MSVC and Appveyor in v0.18

PastaPastaPasta
PastaPastaPasta previously approved these changes Oct 5, 2021

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for merging via merge commit

@PastaPastaPasta PastaPastaPasta added this to the 18 milestone Oct 5, 2021

@UdjinM6 UdjinM6 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

14151: missing changes in src/test/script_tests.cpp

@PastaPastaPasta

Copy link
Copy Markdown
Member

14151: missing changes in src/test/script_tests.cpp

I think these changes are segwit specific no? Hence why it's not in our codebase

@UdjinM6

UdjinM6 commented Oct 5, 2021

Copy link
Copy Markdown

14151: missing changes in src/test/script_tests.cpp

I think these changes are segwit specific no? Hence why it's not in our codebase

    if (libconsensus_flags == flags) {
        BOOST_CHECK_MESSAGE(dashconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect,message);
    }

->

    if (libconsensus_flags == flags) {
        int expectedSuccessCode = expect ? 1 : 0;
        BOOST_CHECK_MESSAGE(dashconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expectedSuccessCode, message);
    }

https://github.com/dashpay/dash/blob/develop/src/test/script_tests.cpp#L179-L181

laanwj and others added 2 commits October 6, 2021 20:05
b9dafe7 Fix remaining compiler warnings (MSVC). Move disabling of specific warnings from /nowarn to project file. (practicalswift)

Pull request description:

  Fix remaining compiler warnings (MSVC).

  Before:

  ```
  $ msbuild /p:TrackFileAccess=false /p:CLToolExe=clcache.exe build_msvc\bitcoin.sln /m /v:q /nowarn:C4244;C4267;C4715 /nologo
  …\script\script.cpp(272): warning C4018: '>': signed/unsigned mismatch
  …\test\allocator_tests.cpp(147): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size
  …\boost\test\tools\old\impl.hpp(107): warning C4805: '==': unsafe mix of type 'const Left' and type 'const Right' in operation
  …\test\crypto_tests.cpp(535): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
  …\test\script_tests.cpp(188): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
  …\test\script_tests.cpp(190): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
  …\test\script_tests.cpp(191): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
  $
  ```

  After:

  ```
  $ msbuild /p:TrackFileAccess=false /p:CLToolExe=clcache.exe build_msvc\bitcoin.sln /m /v:q /nowarn:C4244;C4267;C4715;C4805 /nologo
  $
  ```

Tree-SHA512: 5b30334d3804e869779e77dad75a799e8e5e7eb2e08634cd40035cce140edd623cbb6c8b5806d2158c3df97888d3ea9ff4b8b6a5a83de3fe2cb361e29588c115

# Conflicts:
#	.appveyor.yml
#	build_msvc/common.vcxproj
#	src/test/script_tests.cpp
15b3103 appveyor: Remove outdated libraries (Chun Kuan Lee)
ae892ad tests: accept unicode characters on Windows (Chun Kuan Lee)

Pull request description:

  This PR removes unused Windows compatible path. Encoding issues has been solved.

Tree-SHA512: d24dce035fe3b576eaa002896f815a6691e88618ea371171d7e39883e1d63b3ed4d4631ab3b3a26bd67ae4e8ae13b1ff188942ab7ac6a93d704e0de301368cd0

# Conflicts:
#	.appveyor.yml

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for merging via merge commit

@UdjinM6 UdjinM6 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6
UdjinM6 merged commit 35ed2b0 into dashpay:develop Oct 10, 2021
@Munkybooty
Munkybooty deleted the appveyor-backports-v0.18 branch November 30, 2021 03:57
PastaPastaPasta added a commit that referenced this pull request Sep 22, 2026
… and getcreditpoolinfo

14e87ab refactor: read the credit pool window from chainman in getcreditpoolinfo (pasta)
0a6ff10 doc: release notes for the relative v24 asset-unlock limit and getcreditpoolinfo (pasta)
afb556e test: cover the relative v24 unlock limit and getcreditpoolinfo (pasta)
06bd914 rpc: add getcreditpoolinfo (pasta)
cc13b57 consensus: make the v24 asset-unlock limit a relative net drop of the credit pool (pasta)

Pull request description:

  ## Issue being fixed or feature implemented

  Platform must never pool an asset unlock that Core rejects on the withdrawal limit. Since #7639 that is also a user-visible property: InstantSend signers refuse to lock any unlock while the mempool's pending withdrawal total exceeds Core's `currentLimit`, on the assumption that Platform pools under the same limit.

  Today's V24 rule caps *gross* unlocks at a flat 4000 DASH per 576 blocks, so it does not refill when funds enter the pool: with Platform's PV14 rule being a *net* one (15% of the total credits held a day ago, plus the inflows of the window, dashpay/platform#4457 and #4486), a deposit → withdraw cycle consumes Core's budget but not Platform's, and Core becomes the bottleneck under honest flow. dashpay/platform#4471 already recorded that Core needs the same net treatment before V24 activates, and with both caps at 4000 there is no margin at all in the regime mainnet is in (pool ~37k DASH).

  This PR makes the V24 rule relative and net. Platform's rule is unchanged; the Platform team will investigate the remaining edge cases, and the pair will be tested to breaking on regtest and testnet before V24 parameters are set.

  ## What was done?

  **Consensus (`src/evo/creditpool.{h,cpp}`, gated on `DEPLOYMENT_V24`):**

  With `P` the credit pool balance after block `N` and `D` the balance after block `N − 576` (0 when that block has no credit pool):

  ```
  A            = max(D × 20 / 100, 2000 DASH)   // allowed net drop over the window, no upper bound
  currentLimit = clamp(A − (D − P), 0, P)       // total unlocks minable in block N+1
  ```

  Equivalently, unlocks may not leave the pool below `D − A`. Because the rule compares two CbTx balances it is net without any inflow tracking: asset locks and the per-block Platform reward raise `P` and are withdrawable again inside the window, so a deposit followed by its withdrawal consumes nobody's budget. `D` comes from the ancestor block `ConstructCreditPool` already reads for the gross tally; there is no new serialized state, `latelyUnlocked` stays computed and stored for the pre-V24 branches, and those branches are unchanged. The formula is a total, constexpr function (`CCreditPoolManager::UnlockLimitV24`) so it can be tested directly; integer arithmetic only, truncation only ever makes the limit stricter.

  There is no absolute cap. That does not weaken the DIP-0027 rationale ("catastrophic failure if Platform is compromised"): a compromised Platform can drain at most 20% per window of whatever remains, which leaves 10% of the pool after ten windows and 1% after a month, versus emptying today's pool in nine days at a flat 4000/day. The 2000 DASH floor keeps small pools usable and matches Platform's flat bootstrap limit.

  **RPC (`getcreditpoolinfo [height]`, in `blockchain.cpp`):** reports `balance`, `currentlimit`, `unlockedinwindow`, `windowblocks`, `windowstartheight` and `windowstartbalance` for a block (default the tip). The window-start balance is read through the same `GetCreditDataFromBlock` path the consensus rule uses (`CCreditPoolManager::GetBalanceAt`), so the RPC cannot drift from consensus. It exists for observability and for the regtest/testnet testing of the rule; nothing depends on it.

  **Tests:** unit coverage of the formula (floor, linear regime, boundary, growth inside the window, absent window-start balance, truncation, `MAX_MONEY`); `feature_asset_locks.py` reads the limit from the RPC on the regtest window (100 blocks) both at the tip and by explicit height, cross-checks both balances against the CbTx, checks the limit against the formula, shows one duff over it is not mined while exactly the limit is, that a lock inside the window is withdrawable again at once, and that a whole window later the allowance has regenerated; the v2 unlock test asserts its leftovers exceed a full window's allowed drop instead of the old flat 4000.

  **Not changed:** `nCreditPoolPeriodBlocks` (576, regtest 100), the `CCreditPool` serialization, the pre-V24 branches, and the v22 per-block behaviour described in #7660.

  ## How Has This Been Tested?

  - `./src/test/test_dash --run_test=evo_assetlocks_tests` passes (12 cases, including the new one).
  - `test/functional/test_runner.py feature_asset_locks.py` passes (~160 s, macOS arm64, `--enable-debug --enable-werror`).
  - `test/lint/lint-python.py` clean.
  - Mainnet numbers used above were read from a synced mainnet node: pool 36,932 DASH, growing ~250 DASH/day from rewards, observed block time 2.627 min over the last 30 days.

  ## Breaking Changes

  Consensus for V24: the asset unlock limit changes from a flat 4000 DASH gross cap per window to the relative net rule above. V24 is `NEVER_ACTIVE` on mainnet and testnet, but **devnet has had V24 active since 2025-07-01 and regtest activates it at genesis, so for any existing devnet this is a hard fork**. Such devnets must be reset with fresh datadirs rather than upgraded in place: `currentLimit` is part of the EvoDB credit pool snapshot written every 576 blocks, an in-place upgrade would keep serving the old value at those heights, and the snapshot key is deliberately not bumped because that would force every mainnet node to rebuild the pool from the V20 activation on first start for a rule mainnet has not activated.

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

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

Top commit has no ACKs.

Tree-SHA512: 843459d9ca23ad26a2ab58a21438e88d742fc9491157b576407806904a4a861dffbcb2bd85daa3fcbe69847b9a9e23b2391f73cbf003f6ef3506fe7f836b8b7c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants