near / nearcore

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

runtime: start lifting contract preparation up through tx runtime layers #11810

Closed nagisa closed 1 month ago

nagisa commented 1 month ago

Best reviewed commit-by-commit.

This ultimately lifts the contract preparation up through a several function call layers in the transaction runtime up to the layer where all the currently necessary data are available.

This PR also establishes in broad strokes where the pipelining decisions will be made (ApplyProcessingReceiptState) and makes some minor changes to the type to have it contain local receipts (in addition to the previously contained delayed receipts etc) in a queue of sorts which would allow the pipelining code to look-ahead of the ongoing processing work and queue-up preparation of the upcoming contracts there.

This work so far is intended to have no functional changes.

Part of #11319

wacban commented 1 month ago

@nagisa Hey, sorry, I won't have time to review this PR today, I'm going on PTO tomorrow and I'll be gone for a week. Can you find another reviewer or ping me again in a week?

nagisa commented 1 month ago

I'll find somebody else, enjoy your time off!

frol commented 1 month ago

@nagisa Sorry for jumping in, I'd like to invite you to participate in the Race of Sloths. Just mention @race-of-sloths user in your github comment or PR description to join!

See how the flow works here: https://github.com/near/nearcore/pull/11778

nagisa commented 1 month ago

@race-of-sloths

race-of-sloths commented 1 month ago

@nagisa Thank you for your contribution! Your pull request is now a part of the Race of Sloths! New Sloth joined the Race! Welcome!

[

<source media="(prefers-color-scheme: light)" srcset="https://badge.race-of-sloths.com/nagisa?type=bot&theme=light">
<img alt="Shows profile picture for the author of the PR" src="https://badge.race-of-sloths.com/nagisa?type=bot&theme=white">

](https://race-of-sloths.com/profile/nagisa)

Current status: executed @nagisa check out your results on the [Race of Sloths Leaderboard!](https://race-of-sloths.com/leaderboard) and in the [profile](https://race-of-sloths.com/profile/nagisa)
What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors: - Tag @race-of-sloths inside your pull requests - Wait for the maintainer to review and score your pull request - Check out your position in the [Leaderboard](https://race-of-sloths.com/leaderboard) - Keep weekly and monthly streaks to reach higher positions - Boast your contributions with a dynamic picture of your [Profile](https://race-of-sloths.com/profile/nagisa) For maintainers: - Score pull requests that participate in the Race of Sloths - Engage contributors with fair scoring and fast responses so they keep their streaks - Promote the Race to the point where the Race starts promoting you - Grow the community of your contributors Feel free to check [our website](https://race-of-sloths.com) for additional details!

Bot commands - For contributors - **Include a PR:** `@race-of-sloths include` to enter the Race with your PR - For maintainers: - **Assign points:** `@race-of-sloths score [1/2/3/5/8/13]` to award points based on your assessment. - **Reject this PR:** `@race-of-sloths exclude` to send this PR back to the drawing board. - **Exclude repo:** `@race-of-sloths pause` to stop bot activity in this repo until `@race-of-sloths unpause` command is called
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 94.42897% with 20 lines in your changes missing coverage. Please review.

Project coverage is 71.80%. Comparing base (41f6554) to head (79170bc). Report is 61 commits behind head on master.

Files Patch % Lines
runtime/near-vm-runner/src/wasmer_runner.rs 77.41% 2 Missing and 5 partials :warning:
...ntime/runtime-params-estimator/src/gas_metering.rs 55.55% 4 Missing :warning:
runtime/near-vm-runner/src/wasmer2_runner.rs 90.00% 2 Missing and 1 partial :warning:
runtime/near-vm-runner/src/wasmtime_runner.rs 95.83% 2 Missing and 1 partial :warning:
...time/runtime-params-estimator/src/function_call.rs 60.00% 2 Missing :warning:
runtime/near-vm-runner/fuzz/src/lib.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #11810 +/- ## ========================================== + Coverage 71.78% 71.80% +0.02% ========================================== Files 792 796 +4 Lines 162617 163325 +708 Branches 162617 163325 +708 ========================================== + Hits 116729 117279 +550 - Misses 40844 40998 +154 - Partials 5044 5048 +4 ``` | [Flag](https://app.codecov.io/gh/near/nearcore/pull/11810/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/11810/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_up: | | [db-migration](https://app.codecov.io/gh/near/nearcore/pull/11810/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_up: | | [genesis-check](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.35% <0.00%> (-0.01%)` | :arrow_down: | | [integration-tests](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `37.80% <57.66%> (-0.11%)` | :arrow_down: | | [linux](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.54% <94.42%> (+0.23%)` | :arrow_up: | | [linux-nightly](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `71.39% <93.59%> (+0.03%)` | :arrow_up: | | [macos](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `54.67% <58.40%> (+0.74%)` | :arrow_up: | | [pytests](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.62% <0.00%> (+0.04%)` | :arrow_up: | | [sanity-checks](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `1.42% <0.00%> (+0.04%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/near/nearcore/pull/11810/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=near) | `66.26% <87.18%> (+0.05%)` | :arrow_up: | | [upgradability](https://app.codecov.io/gh/near/nearcore/pull/11810/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_up: | 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.

race-of-sloths commented 1 month ago

🔄 The PR has been merged.

[!IMPORTANT] This pull request is a part of the Race of Sloths and has not been scored yet. Scoring will close in 24 hours! 🕰️

race-of-sloths commented 1 month ago

✅ PR is finalized!

Your contribution is much appreciated with a final score of 0! You have received 10 (0 base + 10 weekly bonus) Sloth points for this contribution

Another weekly streak completed, well done @nagisa! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths