-
Notifications
You must be signed in to change notification settings - Fork 874
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
Validate that blockperiodseconds is set to a positive integer #3186
Validate that blockperiodseconds is set to a positive integer #3186
Conversation
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
…lues Signed-off-by: George Patterson <g-patt@outlook.com>
…nds property Signed-off-by: George Patterson <g-patt@outlook.com>
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
4646893
to
5b3e5fc
Compare
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
config/src/test/java/org/hyperledger/besu/config/JsonBftConfigOptionsTest.java
Show resolved
Hide resolved
Signed-off-by: George Patterson <g-patt@outlook.com>
besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateBlockchainConfig.java
Outdated
Show resolved
Hide resolved
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
config/src/test/java/org/hyperledger/besu/config/CliqueConfigOptionsTest.java
Outdated
Show resolved
Hide resolved
…in JsonUtil Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
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.
Minor nitpicks and suggestions in the comments.
I am going to be annoying though and ask that you make the same change for BftFork.getBlockPeriodSeconds
please :)
It is possible to use a 'transition' to change the blockperiodseconds of an existing network so it needs the same validation constraints applied to it.
See: https://besu.hyperledger.org/en/stable/HowTo/Configure/Consensus-Protocols/IBFT/#configure-block-time-on-an-existing-network-deployment
Note this transition also applies to QBFT
util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java
Outdated
Show resolved
Hide resolved
config/src/test/java/org/hyperledger/besu/config/JsonBftConfigOptionsTest.java
Outdated
Show resolved
Hide resolved
config/src/test/java/org/hyperledger/besu/config/CliqueConfigOptionsTest.java
Outdated
Show resolved
Hide resolved
util/src/test/java/org/hyperledger/besu/util/number/PositiveNumberTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
…ts. Changes applied for BftFork. Signed-off-by: George Patterson <g-patt@outlook.com>
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.
Code looks good 👍 .
I want to have a play with it locally before I approve which will probably be next year :)
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
…kperiodseconds Signed-off-by: George Patterson <g-patt@outlook.com>
Signed-off-by: George Patterson <g-patt@outlook.com>
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.
LGTM!
Kudos, SonarCloud Quality Gate passed! |
…edger#3186) Implemented getPositiveInt function in JsonUtil to validate a JSON positive number value. Using this function, the blockperiodseconds should now be validated whenever retrieved from the genesis config, including transitions. Signed-off-by: George Patterson <g-patt@outlook.com>
…edger#3186) Implemented getPositiveInt function in JsonUtil to validate a JSON positive number value. Using this function, the blockperiodseconds should now be validated whenever retrieved from the genesis config, including transitions. Signed-off-by: George Patterson <g-patt@outlook.com>
PR description
Implemented getPositiveInt function in JsonUtil to validate a JSON positive number value. Using this function, the blockperiodseconds should now be validated whenever retrieved from the genensis config.
Fixed Issue(s)
Fixes #3093