Skip to content
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

refactor: added validation on buffer percent limits #1228

Conversation

Yashk767
Copy link
Contributor

@Yashk767 Yashk767 commented Aug 29, 2024

Description

Added a validation before voting process starts to check buffer percent should be within limit of default value and maximum value.

  • While setting buffer percent, it should not be less than default buffer percent value(5) else throw an error.
  • While fetching buffer percent during voting, it should be less than max calculated buffer else throw an error.

Maximum value for buffer percent is calculated using state buffer and state length.

Fixes https://linear.app/interstellar-research/issue/RAZ-971
This will fix https://linear.app/interstellar-research/issue/RAZ-965 as well as we update the default buffer percent value for shorter epoch value.

@Yashk767 Yashk767 marked this pull request as ready for review August 29, 2024 11:50
ashish10677
ashish10677 previously approved these changes Aug 30, 2024
cmd/config-utils.go Outdated Show resolved Hide resolved
@ashish10677 ashish10677 self-requested a review August 30, 2024 05:59
@ashish10677 ashish10677 dismissed their stale review August 30, 2024 05:59

Approved by mistake

cmd/config-utils.go Show resolved Hide resolved
@Yashk767 Yashk767 force-pushed the yash/raz-971-add-a-validation-for-buffer-percent-to-be-in-valid-range branch from 753de21 to 05214b6 Compare September 3, 2024 09:59
@Yashk767 Yashk767 merged commit 691ae36 into feature/v2.0.0 Sep 4, 2024
2 checks passed
@Yashk767 Yashk767 deleted the yash/raz-971-add-a-validation-for-buffer-percent-to-be-in-valid-range branch September 11, 2024 11:37
Yashk767 added a commit to Yashk767/razor-go that referenced this pull request Sep 16, 2024
* refactor: calculated gas limit using formula for reveal transaction (razor-network#1231)

* chore: updated deployment parameters for 5 min epoch europa contracts   (razor-network#1229)

* chore: updated deployement parameters for 5 min europa chain

* refactor: fixed statelength and epochlength change tests

* chore: updated version to v2.0.0

* refactor: updated the chain name to EUROPA in chainId info

* refactor: added validation on buffer percent limits (razor-network#1228)

* refactor: added validation on buffer percent limits

* refactor: fixed tests

* refactor: updated default value when builded from source in config script

* refactor: fixed lint error

* refactor: fixed vote tests

* refactor: fixed getBufferPercent() tests

* refactor: recorrected the comment for max buffer formula used

* chore: updated config variable default and limits for 5 min epoch (razor-network#1232)

* refactor: created the local cache instance only once (razor-network#1233)

* refactor: replaced goroutine cleanuploop with normal cleanup function

* refactor: initialised local cache only once an reused again

* refactor: fixed tests

* chore: update default wait time in config.sh (razor-network#1234)
Yashk767 added a commit that referenced this pull request Sep 16, 2024
* refactor: calculated gas limit using formula for reveal transaction (#1231)

* chore: updated deployment parameters for 5 min epoch europa contracts   (#1229)

* chore: updated deployement parameters for 5 min europa chain

* refactor: fixed statelength and epochlength change tests

* chore: updated version to v2.0.0

* refactor: updated the chain name to EUROPA in chainId info

* refactor: added validation on buffer percent limits (#1228)

* refactor: added validation on buffer percent limits

* refactor: fixed tests

* refactor: updated default value when builded from source in config script

* refactor: fixed lint error

* refactor: fixed vote tests

* refactor: fixed getBufferPercent() tests

* refactor: recorrected the comment for max buffer formula used

* chore: updated config variable default and limits for 5 min epoch (#1232)

* refactor: created the local cache instance only once (#1233)

* refactor: replaced goroutine cleanuploop with normal cleanup function

* refactor: initialised local cache only once an reused again

* refactor: fixed tests

* chore: update default wait time in config.sh (#1234)

* chore: updated npm version and mainnet contract addresses to official contracts for 5 min epoch (#1243)

* chore: updated mainnet contract addresses to official 5 min epoch contracts

* chore: updated contracts version in dependencies

* chore: updated node-version in workflows

* refactor: update package-lock.json and reinstall dependencies
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.

3 participants