-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement/longer pricing window #616
Merged
Merged
Conversation
This file contains 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
d42664f
to
50a0afe
Compare
9b16086
to
17e462b
Compare
17e462b
to
4c87e07
Compare
@@ -582,7 +582,7 @@ repack_no_nif(Args) -> | |||
case unpack(StoredPacking, ChunkOffset, TXRoot, | |||
Chunk, ChunkSize, PackingState, External) of | |||
{ok, Unpacked, _WasAlreadyUnpacked} -> | |||
case pack(RequestedPacking, ChunkOffset, TXRoot, Chunk, PackingState, External) of | |||
case pack(RequestedPacking, ChunkOffset, TXRoot, Unpacked, PackingState, External) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
- Separate the locked rewards period and the pricing window apart; - compute the reward history hash iteratively from the previous reward history hash.
eb29d19
to
da32de1
Compare
da32de1
to
2636b98
Compare
2636b98
to
9f169c0
Compare
The reward history that gets cached in #block and returned by /reward_history has to be long enough to include: 1. The current reward history (i.e. reward_history_length(Height)) 2. The reward history that was in use recently (i.e. reward_history_length(Height - expected_hashes_length(Height))) 3. The current locked rewards (i.e. locked_rewards_blocks(Height)) This change handles 2 rare but important cases: 1. when a hard fork causes a change in the reward history length 2. when forking off for a testnet which uses a different reward history length
9f169c0
to
eab2b96
Compare
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.
No description provided.