Skip to content

Fix uint64 overflow on blobber reward/penalty#2145

Merged
peterlimg merged 5 commits into
stagingfrom
fix/uint64-overflow-debug
Feb 25, 2023
Merged

Fix uint64 overflow on blobber reward/penalty#2145
peterlimg merged 5 commits into
stagingfrom
fix/uint64-overflow-debug

Conversation

@peterlimg
Copy link
Copy Markdown
Contributor

@peterlimg peterlimg commented Feb 21, 2023

Fixes

We will see this uint64 overflow when processing challenges if they are old challenges, which means the last completed challenge has timestamp fresher than the current one.

Changes

Need to be mentioned in CHANGELOG.md?

Tests

Tasks to complete before merging PR:

  • Ensure system tests are passing. If not Run them manually to check for any regressions 📋
  • Do any new system tests need added to test this change? do any existing system tests need updated? If so create a PR at 0chain/system_test
  • Merge your system tests PR to master AFTER merging this PR

Associated PRs (Link as appropriate):

  • blobber:
  • gosdk:
  • system_test:
  • zboxcli:
  • zwalletcli:
  • Other: ...

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 21, 2023

Codecov Report

Merging #2145 (3a7ce41) into staging (eca34d6) will decrease coverage by 0.01%.
The diff coverage is 40.59%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##           staging    #2145      +/-   ##
===========================================
- Coverage    27.00%   27.00%   -0.01%     
===========================================
  Files          374      374              
  Lines        61991    62047      +56     
===========================================
+ Hits         16741    16755      +14     
- Misses       43289    43305      +16     
- Partials      1961     1987      +26     
Flag Coverage Δ
Unit-Tests 27.00% <40.59%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...de/go/0chain.net/smartcontract/storagesc/models.go 53.20% <30.00%> (-2.08%) ⬇️
...e/go/0chain.net/smartcontract/storagesc/blobber.go 45.30% <40.00%> (-0.31%) ⬇️
...o/0chain.net/smartcontract/storagesc/allocation.go 51.47% <46.66%> (-0.39%) ⬇️
...go/0chain.net/smartcontract/storagesc/challenge.go 37.50% <50.00%> (-0.50%) ⬇️
code/go/0chain.net/core/datastore/worker.go 97.26% <0.00%> (-2.74%) ⬇️
...ain.net/smartcontract/storagesc/config_settigns.go 54.76% <0.00%> (ø)
...de/go/0chain.net/smartcontract/vestingsc/config.go 58.42% <0.00%> (+9.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@peterlimg peterlimg changed the title Debug uint64 overflow Fix uint64 overflow on blobber reward/penalty Feb 22, 2023
@peterlimg peterlimg removed the wip label Feb 22, 2023
Copy link
Copy Markdown
Contributor

@dabasov dabasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@service-0chain
Copy link
Copy Markdown
Collaborator

Manual system tests [success] with the following config

config value
tests skipped TRUE
system-tests master
gosdk NOT OVERRIDDEN
zboxcli staging
zwalletcli staging
0chain fix/uint64-overflow-debug
blobber staging
authorizer staging
0box staging
0block staging
0dns staging
explorer master
0proxy staging
0search staging

@peterlimg
Copy link
Copy Markdown
Contributor Author

Failed system test cases are not related to the changes, so mark it as pass.

@peterlimg peterlimg merged commit ff023d1 into staging Feb 25, 2023
@peterlimg peterlimg deleted the fix/uint64-overflow-debug branch February 25, 2023 00:25
@service-0chain
Copy link
Copy Markdown
Collaborator

Manual system tests [cancelled] with the following config

config value
tests skipped FALSE
system-tests master
gosdk NOT OVERRIDDEN
zboxcli fix-rounding-off-for-balance
zwalletcli fix-rounding-off-for-balance
0chain staging
blobber staging
authorizer staging
0box staging
0block staging
0dns staging
explorer master
0proxy staging
0search staging

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.

4 participants