Skip to content

feat: Qtreat SC - #973

Open
double-k-3033 wants to merge 4 commits into
qubic:developfrom
double-k-3033:feat/QTreatSC
Open

feat: Qtreat SC#973
double-k-3033 wants to merge 4 commits into
qubic:developfrom
double-k-3033:feat/QTreatSC

Conversation

@double-k-3033

@double-k-3033 double-k-3033 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The earlier fix that spread ASIC ownership re-verification and NFT
dividend snapshots across multiple epochs (to bound external QBAY calls
per END_EPOCH) had a real fund-misallocation gap: mining rewards and
NFT dividends kept being paid to the last-known owner/possessor during
the staleness window, so a seller could keep collecting for up to
8/4 epochs (~2 months / ~1 month) after transferring the underlying
asset away, while the new owner got nothing.

- ASIC mining: merged ownership re-verification and reward payment into
  a single pass, so a rig is only ever paid in the same epoch it is
  freshly re-verified. Payment is scaled by
  QTREAT_ASIC_VERIFY_SPREAD_EPOCHS to compensate for only being eligible
  1-in-N epochs. Also scaled the mining->dividend cut down to a matching
  1/N slice per epoch, since it was previously being taken at full size
  every epoch regardless of whether any rig was due, which would starve
  miningFund before rigs got their (now larger) turn.
- NFT dividend snapshot: replaced the "last known possessor" carry
  forward with a full rebuild from only that epoch's freshly-checked
  slice, each entry counted QTREAT_NFT_SNAPSHOT_SPREAD_EPOCHS times to
  keep the collection's aggregate dividend share consistent with
  checking everyone every epoch. Removed the now-unneeded
  dividendNftLastPossessor state field.
- Added a test proving a sold ASIC part's old owner receives no reward
  on the epoch the mismatch is caught, updated the mining-reward test
  for the new scaled/compensated payout math.
@Franziska-Mueller
Franziska-Mueller self-requested a review August 11, 2026 15:40

@Franziska-Mueller Franziska-Mueller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please add your header and test cpp file to the respective Visual Studio project files

@double-k-3033

Copy link
Copy Markdown
Contributor Author

please add your header and test cpp file to the respective Visual Studio project files

Fixed it

@Franziska-Mueller Franziska-Mueller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you've only fixed it for the header file, please also do it for the test file

@double-k-3033

Copy link
Copy Markdown
Contributor Author

you've only fixed it for the header file, please also do it for the test file

fixed it

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.

2 participants