near / nearcore

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

Increase gas cost of sending non-sir receipts to 50 TGas / MiB #11681

Closed jancionear closed 1 week ago

jancionear commented 1 week ago

The gas cost of sending receipts between shards is currently too low - it doesn't reflect the limitations caused by network bandwidth. Let's increase the cost of sending a receipt to another account to 50 Tgas / MiB. The increase is low enough so that it shouldn't break any contracts, while still being a big improvement over the previous situation.

Refs: https://github.com/near/nearcore-private/issues/107

jancionear commented 1 week ago

I got stuck in a insta review loop x,x Stable wants the snapshot one way, but statelessnet_protocol wants it the other way (9e0a4de0632964be294f839322e02a65aef06f1e, 4e2d3039c4d00b38804cf936b038b90443110634)

happens because of test_cost_sanity test: https://github.com/near/nearcore/blob/ea9765f9f91ad4d38cdd4cdfa224b2037c7a19c5/integration-tests/src/tests/runtime/sanity_checks.rs#L95

jancionear commented 1 week ago

I got stuck in a insta review loop x,x Stable wants the snapshot one way, but statelessnet_protocol wants it the other way (9e0a4de, 4e2d303)

Dealt with it by adding a separate gas cost snapshot for statelessnet_protocol, now it doesn't collide with the one from stable protocol

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 (48201f8) to head (e6513e4). Report is 3 commits behind head on master.

Files Patch % Lines
core/primitives-core/src/version.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11681 +/- ## ========================================== - Coverage 71.66% 71.66% -0.01% ========================================== Files 788 788 Lines 161371 161391 +20 Branches 161371 161391 +20 ========================================== + Hits 115644 115656 +12 - Misses 40693 40697 +4 - Partials 5034 5038 +4 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11681/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/11681/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%> (-0.01%)` | :arrow_down: | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/11681/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%> (-0.01%)` | :arrow_down: | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/11681/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%> (-0.01%)` | :arrow_down: | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/11681/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.87% <0.00%> (-0.03%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11681/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.06% <0.00%> (-0.01%)` | :arrow_down: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11681/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.14% <0.00%> (-0.02%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11681/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/11681/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%> (-0.01%)` | :arrow_down: | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11681/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%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11681/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.01%)` | :arrow_down: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11681/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%> (-0.01%)` | :arrow_down: | 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.