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

Problem: halt-height is not deterministic #998

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Jul 4, 2023

Solution:

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

@yihuang yihuang requested a review from a team as a code owner July 4, 2023 07:01
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: yihuang <[email protected]>
@yihuang yihuang requested a review from mmsqe July 4, 2023 07:04
case app.haltHeight > 0 && uint64(req.Header.Height) > app.haltHeight:
halt = true

case app.haltTime > 0 && req.Header.Time.Unix() > int64(app.haltTime):

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
// backport: https://github.com/cosmos/cosmos-sdk/pull/16639
var halt bool
switch {
case app.haltHeight > 0 && uint64(req.Header.Height) > app.haltHeight:

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #998 (a6c8c6c) into master (681c32b) will decrease coverage by 9.04%.
The diff coverage is 38.88%.

@@            Coverage Diff             @@
##           master     #998      +/-   ##
==========================================
- Coverage   33.07%   24.03%   -9.04%     
==========================================
  Files         126      126              
  Lines       19999    20013      +14     
==========================================
- Hits         6615     4811    -1804     
- Misses      12327    14545    +2218     
+ Partials     1057      657     -400     
Flag Coverage Δ
integration_tests 20.68% <38.88%> (-0.01%) ⬇️
integration_tests_byzantine 9.63% <27.77%> (+0.01%) ⬆️
integration_tests_gov 9.97% <27.77%> (+0.01%) ⬆️
integration_tests_grpc 9.95% <27.77%> (+0.01%) ⬆️
integration_tests_ibc ?
integration_tests_ledger 9.84% <27.77%> (+0.01%) ⬆️
integration_tests_slow 9.84% <27.77%> (+0.01%) ⬆️
integration_tests_solomachine 9.63% <27.77%> (+0.01%) ⬆️
integration_tests_upgrade ?
unit_tests 10.99% <27.77%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/app.go 90.21% <38.88%> (-2.13%) ⬇️

... and 37 files with indirect coverage changes

if err := app.Close(); err != nil {
app.Logger().Info("close application failed", "error", err)
}
panic("halt application")

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@yihuang yihuang added this pull request to the merge queue Jul 5, 2023
Merged via the queue into crypto-org-chain:master with commit f689474 Jul 5, 2023
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.

2 participants