near / nearcore

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

[memtrie] Introduce HybridArena and FrozenArena #12075

Closed shreyan-gupta closed 1 month ago

shreyan-gupta commented 1 month ago

Review this PR after #12073

This PR introduces HybridArena which represents a combination of owned and shared memory.

This is useful during resharding to create temporary memtries for the children of a split parent shard.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 95.13889% with 7 lines in your changes missing coverage. Please review.

Project coverage is 71.62%. Comparing base (cf47d81) to head (68e457d). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
core/store/src/trie/mem/arena/hybrid.rs 96.52% 3 Missing and 1 partial :warning:
core/store/src/trie/mem/arena/frozen.rs 50.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #12075 +/- ## ========================================== + Coverage 71.60% 71.62% +0.01% ========================================== Files 816 818 +2 Lines 164337 164468 +131 Branches 164337 164468 +131 ========================================== + Hits 117676 117800 +124 - Misses 41525 41528 +3 - Partials 5136 5140 +4 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/12075/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/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.17% <0.00%> (-0.01%)` | :arrow_down: | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.17% <0.00%> (-0.01%)` | :arrow_down: | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.26% <0.00%> (-0.01%)` | :arrow_down: | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `38.73% <34.02%> (+<0.01%)` | :arrow_up: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.21% <95.13%> (+<0.01%)` | :arrow_up: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.14% <95.13%> (+0.02%)` | :arrow_up: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `54.00% <95.13%> (-0.10%)` | :arrow_down: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.53% <0.00%> (-0.01%)` | :arrow_down: | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.33% <0.00%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `65.40% <95.13%> (+0.02%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/12075/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `0.22% <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.