Repository navigation
Upgrade Random - #1052
Open
N-010 wants to merge 3 commits into
Open
Upgrade Random#1052N-010 wants to merge 3 commits into
N-010 wants to merge 3 commits into
Conversation
…fund reserve functionality
…ns for epoch handling
cyber-pc
reviewed
Nov 2, 2026
| Array<uint32, RANDOM_MAX_PROVIDERS> lastUpdateTick; | ||
|
|
||
| // Append-only state extension. Entries survive slot removal until epoch settlement. | ||
| HashMap<id, uint64, RANDOM_MAX_PROVIDERS> epochContributions; |
Contributor
There was a problem hiding this comment.
Not sure if this is intended, but is this hash map can be filled capacity easily with cheap QUs, and the honest ones can not become provider ?
| constexpr uint32 RANDOM_STREAM_CAPACITY = 1365; | ||
| constexpr uint32 RANDOM_MAX_PROVIDERS = 4096; | ||
| constexpr uint64 RANDOM_PROVIDER_REWARD_PERCENT = 50; | ||
| constexpr uint64 RANDOM_SHAREHOLDER_REWARD_PERCENT = 50; |
Contributor
There was a problem hiding this comment.
I remembered the fee is set as zeros in state file, so those number will not affect the reward (multiply to zero).
| * @param output Amount burned, or -1 for a nonpositive amount or failed burn. | ||
| * @note Failed burns are refunded. Funding is excluded from dividend revenue. | ||
| */ | ||
| PUBLIC_PROCEDURE(FundReserve) |
Contributor
There was a problem hiding this comment.
If a contract reserve is <=0. This functions can not be called because the SC is de-active.
May be you want to check BurnQubicForContract of QUtils, I think it work for both empty and non-empty case, when you want to fund the reserve.
This file contains hidden or 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
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.
Summary
Added epoch revenue distribution to RANDOM:
Added: