near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.3k stars 600 forks source link

fix(client): fix overflow in get_extra_sync_block_hashes() #11670

Closed marcelo-gonzalez closed 1 week ago

marcelo-gonzalez commented 1 week ago

Subtracting 1 from the smallest chunk height included crashes when it's zero, which can actually happen in many tests, and is currently causing the skip_epoch.py test to fail

marcelo-gonzalez commented 1 week ago

it seems that skip_epoch.py still fails after this... but it's for an unrelated reason

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.66%. Comparing base (642f6a0) to head (302bb83).

Files Patch % Lines
chain/client/src/client_actor.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11670 +/- ## ========================================== - Coverage 71.67% 71.66% -0.02% ========================================== Files 788 788 Lines 161374 161374 Branches 161374 161374 ========================================== - Hits 115669 115647 -22 - Misses 40672 40687 +15 - Partials 5033 5040 +7 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | Coverage Δ | | |---|---|---| | [backward-compatibility](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <0.00%> (ø)` | | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.23% <0.00%> (ø)` | | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.36% <0.00%> (ø)` | | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.84% <0.00%> (-0.02%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.05% <0.00%> (-0.02%)` | :arrow_down: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.16% <0.00%> (-0.01%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `52.66% <0.00%> (+1.58%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.59% <0.00%> (ø)` | | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.39% <0.00%> (ø)` | | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.24% <0.00%> (-0.02%)` | :arrow_down: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11670/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.28% <0.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

marcelo-gonzalez commented 1 week ago

cc @wacban

wacban commented 1 week ago

@marcelo-gonzalez To what do I owe the cc? :)

marcelo-gonzalez commented 1 week ago

@marcelo-gonzalez To what do I owe the cc? :)

ah, well just wanted to cc you so youre aware since it looks like your area. not much else to do with this particular PR of course :) . But I prob could have added this in the cc message... it looks like even after applying this PR, skip_epoch.py still fails right after c16ca0b7c8f1b92c0597cc7519aa5c54eb9c8a90, which looks like the commit that added this function. will provide some more details later

wacban commented 1 week ago

Ah I see, is it my PR that broke this test?

marcelo-gonzalez commented 1 week ago

Ah I see, is it my PR that broke this test?

yea I think it looks that way.. did a git bisect and it landed on that one