near / nearcore

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

vmlogic: split up into two #11643

Closed nagisa closed 1 week ago

nagisa commented 2 weeks ago

The split boundary has been chosen to be what's necessary to compute a VMOutcome, which now in turn allows us to load a contract without constructing a VMLogic, or contract memory quite yet.

This might very well resolve issues I've been working through by attempting to remove lifetimes and such from VMLogic...? As previous changes this makes quite some sense in isolation regardless of the ongoing projects. While I imagine there are more lines, they will mostly be due to the fact that in many places the previous code now needs to go through an additional field projection to get to types it needs to operate.

@Ekleog-NEAR I think you'll appreciate these as I recall you've struggled with the VMLogic nonsense as well in the past.

Part of #11319

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 73.40206% with 129 lines in your changes missing coverage. Please review.

Project coverage is 71.63%. Comparing base (e95c123) to head (25a6979). Report is 16 commits behind head on master.

Files Patch % Lines
runtime/near-vm-runner/src/logic/logic.rs 68.10% 13 Missing and 105 partials :warning:
runtime/near-vm-runner/src/wasmtime_runner.rs 84.21% 4 Missing and 2 partials :warning:
runtime/near-vm-runner/src/wasmer_runner.rs 83.33% 1 Missing and 3 partials :warning:
runtime/near-vm-runner/src/wasmer2_runner.rs 96.29% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11643 +/- ## ========================================== - Coverage 71.64% 71.63% -0.02% ========================================== Files 787 787 Lines 160969 161191 +222 Branches 160969 161191 +222 ========================================== + Hits 115333 115475 +142 - Misses 40602 40683 +81 + Partials 5034 5033 -1 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11643/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/11643/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/11643/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/11643/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/11643/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.81% <52.98%> (+0.03%)` | :arrow_up: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11643/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `69.03% <73.40%> (+<0.01%)` | :arrow_up: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11643/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.11% <72.78%> (-0.02%)` | :arrow_down: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11643/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `52.62% <65.19%> (-0.14%)` | :arrow_down: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11643/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/11643/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/11643/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.24% <72.78%> (+0.02%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11643/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.