-
Notifications
You must be signed in to change notification settings - Fork 622
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
[ProjectTracking] Chunk validator rewards #11900
Labels
A-chain
Area: Chain, client & related
A-stateless-validation
Area: stateless validation
Near Core
T-core
Team: issues relevant to the core team
Comments
Longarithm
added
A-chain
Area: Chain, client & related
T-core
Team: issues relevant to the core team
Near Core
A-stateless-validation
Area: stateless validation
labels
Aug 7, 2024
Notes after meeting today:
|
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 20, 2024
…y headers (#11940) Tracking issue: #11900. Roadmap document: [Link](https://docs.google.com/document/d/1VJ6BPnZJMGQXZ56RdOUmwJMRH-BoPIfNQs94AegohsU/edit#heading=h.rd80jvftbqxx) This PR includes the following changes: - Introduce a new `ProtocolFeature::ChunkEndorsementsInBlockHeader` to enable new changes in this and upcoming PRs. - Introduce `ChunkEndorsementBitmap` to implement bitmap representation of endorsements. See the comments for more information. - Add the bitmap to BlockHeaderInfo and BlockInfo (add version V3). - Update the `EpochInfoAggregator` to use the chunk endorsement bitmap if exists, instead of the chunk production stats to aggregate endorsement stats. These stats are used for computing rewards and kickouts later in the EpochManager. - Add ReplayHeaders command to simulate the new method in `mainnet`. The command replays the block headers from the chain store and updates the EpochManager and compares the validator infos (stats, rewards, and kickouts) from the original EpochManager and the replayed EpochManager. Note that instead of adding a new command, we repurpose ReplayChain command, which seems to be doing a similar operation but it was very primitive before, so we decided to expand it. The new code update the `BlockInfos` if the new feature is enabled to inject the endorsements bitmap before calling the EpochManager. The following are not included and left for future PRs: - Adding the bitmap to the BlockHeader (currently it always returns None for the chunk endorsements bitmap). - Adding/updating unittests to use the new endorsement bitmap. - Integration tests.
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 20, 2024
…y headers (#11940) Tracking issue: #11900. Roadmap document: [Link](https://docs.google.com/document/d/1VJ6BPnZJMGQXZ56RdOUmwJMRH-BoPIfNQs94AegohsU/edit#heading=h.rd80jvftbqxx) This PR includes the following changes: - Introduce a new `ProtocolFeature::ChunkEndorsementsInBlockHeader` to enable new changes in this and upcoming PRs. - Introduce `ChunkEndorsementBitmap` to implement bitmap representation of endorsements. See the comments for more information. - Add the bitmap to BlockHeaderInfo and BlockInfo (add version V3). - Update the `EpochInfoAggregator` to use the chunk endorsement bitmap if exists, instead of the chunk production stats to aggregate endorsement stats. These stats are used for computing rewards and kickouts later in the EpochManager. - Add ReplayHeaders command to simulate the new method in `mainnet`. The command replays the block headers from the chain store and updates the EpochManager and compares the validator infos (stats, rewards, and kickouts) from the original EpochManager and the replayed EpochManager. Note that instead of adding a new command, we repurpose ReplayChain command, which seems to be doing a similar operation but it was very primitive before, so we decided to expand it. The new code update the `BlockInfos` if the new feature is enabled to inject the endorsements bitmap before calling the EpochManager. The following are not included and left for future PRs: - Adding the bitmap to the BlockHeader (currently it always returns None for the chunk endorsements bitmap). - Adding/updating unittests to use the new endorsement bitmap. - Integration tests.
I did some simulation of mainnet epochs (last 5 epochs) using the easy mode algorithm. Did not change the kickout threshold (80%) or rewards rate. Results are in this document, where diffs are between the original run of the network and the simulated run. |
Aug 30th report
|
This was referenced Sep 5, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 6, 2024
…kouts (#12048) We have been using the `neard replay-headers` command to simulate validator rewards and kickouts computations for past epochs to check the difference between original and replayed runs. Submitting the new version of the command we have been using for simulating the reward/kickout computations for chunk validators in the context of #11900. This version no longer assumes that the original and replayed values are the same and prints the diffs in kickouts and rewards (stakes).
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 9, 2024
Issue: #11900. This PR introduces a cutoff threshold for chunk endorsement ratio. We use the same kickout threshold as the cutoff threshold. It is currently 80, but we will make it 70 when stabilizing this feature. If the endorsement ratio is less than the cutoff ratio, it is treated 0, otherwise treated 1, when computing the average uptime ratio (including block and chunk production and endorsement). For this, we introduce a new struct `ValidatorOnlineThresholds` to contain `online_min_threshold` and `online_max_threshold` as well as `endorsement_cutoff_threshold` (initialized to the kickout threshold=70 if feature `ChunkEndorsementsInBlockHeader` is enabled). `ValidatorOnlineThresholds` is initialized from `EpochConfig`. We pass this struct to `calculate_rewards`, which then calls `get_validator_online_ratio` to apply the cutoff if present. We performed simulation of last 5 epochs in mainnet, results are in [this doc](https://docs.google.com/document/d/1GsYl0591CA8MyIjgjJ8_4NTP0cEv48BKSsKihGgROHc/edit). Only the chunk validators with very low endorsement ratio are kicked out and do not get any reward. Testing: We added some unittests for the basic logic. We will later add integration tests for the full behavior. --------- Co-authored-by: Aleksandr Logunov <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 12, 2024
…HeaderView and genesis header (#12087) The test `rpc_hash.py` revealed two problems for the changes previously done for task #11900. 1) `BlockHeaderView` was not updated to represent `BlockHeaderV5`, so added chunk endorsements bitmap there (we add the inner vector instead of exposing `ChunkEndorsementBitmap` struct there). 2) Genesis block header was not updated to represent `BlockHeaderV5`, so added an empty bitmap to the genesis block header. Then we updated the test `rpc_hash.py` to check for nightly version producing `BlockHeaderV5` with endorsements bitmap as well. TODO: We noticed that there are 3 places that we generate `BlockHeader` versions using `BlockHeader::new()` function (when producing blocks, for genesis block, and from view to header conversion). Added a TODO to consolidate them instead of needing to update separate places. Also fix test_inflation integration test by updating the validator reward multiplier.
Sept 2-6
Sept 9-13
|
github-merge-queue bot
pushed a commit
that referenced
this issue
Oct 14, 2024
We add a simple integration test for checking that offline nodes are kicked out properly. We kill a block+chunk producer and a chunk-validator only node. Assert that these two nodes are kicked out due to no block and endorsement production and not included in the next validators. This is part of the testing tasks for #11900.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-chain
Area: Chain, client & related
A-stateless-validation
Area: stateless validation
Near Core
T-core
Team: issues relevant to the core team
Goal
Make chunk validator kickouts&rewards fairly depend on the number of endorsements they actually created, not the fact of chunk inclusion
References
Design Doc
Roadmap
With approximate timelines
BlockHeaderInfo
andBlockInfo
. feat: Add chunk endorsements bitmap to BlockInfo and tooling to replay headers #11940.BlockHeaderInfo
as simplification. Remove BlockHeaderInfo #11971add_validator_proposals
and calculate rewards and kickoffs using it. feat: Add chunk endorsements bitmap to BlockInfo and tooling to replay headers #11940BlockBodyV3::chunk_endorsements
inChain::validate_block_impl
.compute_exempted_kickout
). Use same online ratio calculator for computing rewards and exemptions for validators #11982Also BP can specifically wait for small CVs, however, the exact logic is unclear.
2w
The text was updated successfully, but these errors were encountered: