Subtract remaining amount after sigma and lelantus pull closed#1777
Subtract remaining amount after sigma and lelantus pull closed#1777levonpetrosyan93 wants to merge 1 commit intomasterfrom
Conversation
WalkthroughThis PR adds two new RPC endpoints ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/rpc/misc.cpp`:
- Around line 1967-1988: getlelantuspoolbalance() currently omits the
lelantusJMint address type, causing an incomplete pool total; call
GetAddressIndex with AddressType::lelantusJMint (like the existing calls for
AddressType::lelantusMint and AddressType::lelantusJSplit), iterate the returned
addressIndex vector and add each it.second to nTotalAmount, ensuring
addressIndex is cleared or reused between calls; update the function around the
existing GetAddressIndex usages so all three types (lelantusMint, lelantusJMint,
lelantusJSplit) are queried and summed.
|
@cursor review |
|
Skipping Bugbot: Bugbot is disabled for this repository |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
Need to calculate end supply before tail emission hit before approving this. |
Sigma and Lelantus pools have already been closed,
As we allowed to spend sigma coins by Lelantus spend transactions, so we need to take in account remaining numbers from 2 pools.
Sigma number https://explorer.firo.org/address/Sigma : 182463.94882676
Lelantus number https://explorer.firo.org/address/Lelantus : -86771.07491993
As we had some amount of forged coins and we added that figures into our total supply number, it would be fair to subtract the remainder from this 2 figures, which is 95692.8739068 .
This PR introduces all required changes to do it.
Note
Medium Risk
Changes the
gettotalsupplyRPC calculation by subtracting additional pool balances, which can affect reported monetary supply used by explorers/analytics. Logic relies on-addressindexdata and new address-type sums, so incorrect indexing or type selection could skew outputs.Overview
Adjusts the
gettotalsupplyRPC to also subtract the remaining balances in the closed Sigma and Lelantus pools, in addition to the existing Zerocoin/CVE/burn adjustments.Introduces new addressindex-backed helpers and RPCs,
getsigmapoolbalanceandgetlelantuspoolbalance, which compute pool remainders by summingAddressTypeindex entries for the relevant mint/spend categories, and registers these commands in the RPC table.Written by Cursor Bugbot for commit 5dcd7fc. This will update automatically on new commits. Configure here.