subtensor icon indicating copy to clipboard operation
subtensor copied to clipboard

change weight commit logic

Open soring323 opened this issue 5 months ago • 1 comments

Description

  • This should only check if the weights_rate_limit time has passed since the last committed weights, without imposing the interval-based restriction.
  • The chain should now store multiple weight commits in the WeightCommits storage, so we will modify the storage to retain all commits older than the defined commit_reveal_interval * 2
  • Validators can reveal weights if the difference between the current_block and committed_block exceeds the commit_reveal_interval.

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation update
  • [ ] Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

soring323 avatar Sep 06 '24 10:09 soring323