-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: prefetch account keys and data for chunk finalization #10935
Conversation
Some prefetcher requests can take a longer time to execute than the receipt being processed. So clearing the queue between all the receipts can lead to prefetching of account data that we prefetch for finalize not happen for the most part, as the prefetcher being busy with its current task wouldn't even see the prefetch request. This is a pretty crude implementation: ideally we'd have some sort of priority queue here, but for now it works alright.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10935 +/- ##
=======================================
Coverage 71.52% 71.52%
=======================================
Files 758 758
Lines 151686 151704 +18
Branches 151686 151704 +18
=======================================
+ Hits 108489 108506 +17
- Misses 38708 38712 +4
+ Partials 4489 4486 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, can't argue with the data! :D
I think the observed problem came in when we added flat storage, long after the prefetcher itself. Before that, anything read in finalize()
was already read before. But now that flat storage is "cheating", we have to pay the full price in finalize()
.
Putting that work on the prefetcher makes sense. But it's stretching it, as it was designed to reduce latency on receipt processing. The idea of prefetching for something further ahead than a 10-100ms was not really intended. Hence you were forced to this somewhat hacky approach, I guess.
Never the less, awesome that it works so well!
// (This probably results in more data being accessed than strictly necessary and | ||
// prefetcher may touch data that is no longer relevant as a result but...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to point out the obvious, confirming what you already wrote:
Removing all those clear()
calls means we do more overfetching and we have less efficient usage of the prefetcher's resources (IO bandwith, threads, staging area, request queue). This will generally lead to more useless data being fetched and higher chances that we are too late to fetch the data we actually need.
One of the concerns is that we don't know how many receipts we even need to execute from the delayed queue. But we prefetch for all of them. So, if you have 100 delayed sweat batch-updates in the queue, you will be fetching all those, even if only 4 fit in a chunk.
Even worse, although usually not happening, if a sweat batch receipt fail for some reason, we might be left with a full staging area and cannot prefetch anything until we clear it.
But yeah, in the end I agree it's better to not clear as things stand today, since we need this data in finalize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC we check compute limit as we go through the delayed receipts and the prefetching happens inside the loop:
nearcore/runtime/runtime/src/lib.rs
Lines 1487 to 1507 in 1d082db
// Then we process the delayed receipts. It's a backlog of receipts from the past blocks. | |
while delayed_receipts_indices.first_index < delayed_receipts_indices.next_available_index { | |
if total.compute >= compute_limit | |
|| proof_size_limit | |
.is_some_and(|limit| state_update.trie.recorded_storage_size() > limit) | |
{ | |
break; | |
} | |
let key = TrieKey::DelayedReceipt { index: delayed_receipts_indices.first_index }; | |
let receipt: Receipt = get(&state_update, &key)?.ok_or_else(|| { | |
StorageError::StorageInconsistentState(format!( | |
"Delayed receipt #{} should be in the state", | |
delayed_receipts_indices.first_index | |
)) | |
})?; | |
if let Some(prefetcher) = &mut prefetcher { | |
prefetcher.clear(); | |
// Prefetcher is allowed to fail | |
_ = prefetcher.prefetch_receipts_data(std::slice::from_ref(&receipt)); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downside of that is there is very little delay between when the prefetcher is invoked for the receipt and when the receipt is actually processed.
Could it be worth trying:
- Implement a new prefetcher method which chains
prefetch_trie_key
intoprefetch_receipts_data
. We could call it with a trie keyDelayedReceipt { index }
and basically it would understand that the trie value is expected to be a receipt and it should perform prefetching for the receipt as well. - Call the new prefetcher method on the next index in the delayed receipts queue while we are processing the current one. Or in general, have some sliding window of K indices over which we invoke the prefetcher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to do anything as fancy. We can take a guess that we fit e.g. "about 500 delayed receipts" and start prefetching them even before we start executing transactions at the beginning of the apply
. Even if we are overzealous with how many we do end up prefetching for that specific chunk, its not like those receipts are going anywhere -- we'll have to process them next iteration around anyway. And at that point the receipts would still be in some of the caches, so they would be faster to prefetch on the next iteration.
It is true that we prefetch them just before they are necessary currently, and at least some of the metrics do indicate that before the clear()
call was moved to-after-finalize we would "cancel" some prefetch requests quite consistently (suggesting that we indeed prefetch a little too Just In Time.)
Regardless these are all good thoughts to evaluate if and when we improve on this code. I don't think we strictly need to add to this PR to address anything here so far.
// In the future it may make sense to have prefetcher have a mode where it has two | ||
// queues: one for data that is going to be required soon, and the other that it would | ||
// only work when otherwise idle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds useful, indeed.
Then it would also make sense to aggressively clear the "required soon" queue but basically never touch the other queue.
// Only clear the prefetcher queue after finalize is done because as part of receipt | ||
// processing we also prefetch account data and access keys that are accessed in | ||
// finalize. This data can take a very long time otherwise if not prefetched. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if we follow the initial design of the prefetcher, this means we are just sending those prefetch requests too early. The prefetches are made before processing but we need the values after processing.
So, what I would have tried first is this: Instead of prefetching the access keys and account data in the prefetch_receipt_data()
call, I would have added a new method to the prefetcher. Maybe something like prefetch_finalize
where we specifically read data that was written but never read. Sure, we start it a bit later, but it's still with 8 background threads + 1 main thread instead of just the main thread.
Then I could still do the clearing in all places but guarantee parallel fetches on the data for finalize.
But what you have seems to work good enough, and I'm not sure my approach would actually give equal or better results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to explore this idea… as a follow up. Thank you for writing it down :)
Co-authored-by: Bowen Wang <bowenwang1996@users.noreply.github.com>
<p>This PR was automatically created by Snyk using the credentials of a real user.</p><br /><h3>Snyk has created this PR to upgrade react-router from 6.16.0 to 6.17.0.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **4 versions** ahead of your current version. - The recommended version was released **22 days ago**, on 2023-10-16. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>react-router</b></summary> <ul> <li> <b>6.17.0</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.17.0">2023-10-16</a></br><p>react-router-native@6.17.0</p> </li> <li> <b>6.17.0-pre.2</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.17.0-pre.2">2023-10-13</a></br><p>react-router-native@6.17.0-pre.2</p> </li> <li> <b>6.17.0-pre.1</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.17.0-pre.1">2023-10-12</a></br><p>react-router-native@6.17.0-pre.1</p> </li> <li> <b>6.17.0-pre.0</b> - 2023-10-11 </li> <li> <b>6.16.0</b> - 2023-09-13 </li> </ul> from <a href="https://snyk.io/redirect/github/remix-run/react-router/releases">react-router GitHub release notes</a> </details> </details> <details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>react-router</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/edd9ad4957321cfb260cee21ad98aab2becfe250">edd9ad4</a> chore: Update version for release (near#10935)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/c1d0e50fc9ef5706c0d6ce9d0866ec1f4dadaab7">c1d0e50</a> Exit prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1c64bc1d4fe9c212dcd073b12ea51d2e10c45ea7">1c64bc1</a> Update readme for view transitions example</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1604c74f3abb0650910efb264908a3803fcc2e5e">1604c74</a> Split changeset for remix router and react-router-dom</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ae843545c1a3a38c761b940ed5dc4fab15bb2d3a">ae84354</a> Update view-transitions example to use prerelease</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/6cfbd0e571018bf1d8722c09d70e394d2602f5be">6cfbd0e</a> chore: Update version for release (pre) (near#10934)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/c48341d6b75f4fd5b0ec60ed32c3c45ebb1e532f">c48341d</a> Lift startViewTransition implementation to react-router-dom (near#10928)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/b916689b4a211827cc324cf05994c334e25d380b">b916689</a> chore: Update version for release (pre) (near#10931)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/cbc9d7222cc4ca1e74f0b081472187bbd6a95a42">cbc9d72</a> Fix lint issues (near#10930)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1ad822c5bf8b32143aeef8511ca02577b487aafc">1ad822c</a> Update docs for startViewTransition (near#10927)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/e93e9088360e3fc1a4183efc5a39c8e680903554">e93e908</a> Docs updates</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/b09c5d09198b1ee4a8bfbf8a2a8910fc8eed7d2c">b09c5d0</a> chore: Update version for release (pre) (near#10924)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/d3203fb1b7bcfd73fa21e93b9b190defb769e33c">d3203fb</a> Enter prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/3adb639109ea5e90800e0b155035a610f0a09b4b">3adb639</a> Merge branch 'main' into release-next</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/a5451d5d3967a356e6d5af3cbefb858d2702044e">a5451d5</a> Update docs</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/feebfc0bf10614ba44ff43e2b9c69e22ad07a7a1">feebfc0</a> Add startViewTransition support (near#10916)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/7ce38dc49ee997706902ac2d033ba1fd683cfed0">7ce38dc</a> [Docs]: Use consistent feature warnings (near#10908)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f77743aebfca26faabdd04e9ed1dd31721459877">f77743a</a> chore: format</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/8af53e7bfcf004916af4ea37e9d24e295d6ac107">8af53e7</a> Root router have a path different to '' or '/' (near#10852)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ebe2491f7cd966d9967edb8acaeed86f9e1ab5b9">ebe2491</a> Fix RouterProvider future prop (near#10900)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/b98e82dbd774eadf3972f0b58f2542a8b5599d97">b98e82d</a> Specify `ErrorResponse` as interface to provide obvious contract (near#10876)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/da57748644da6400e2d051b2aa004df47beda1cf">da57748</a> fix(docs): add backticks to element names (near#10874)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f8194fdb8e371b715d29d30a82e04a82a7648e9b">f8194fd</a> Handle case when session storage is blocked (near#10848)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f9b3dbd9cbf513366c456b33d95227f42f36da63">f9b3dbd</a> chore: sort contributors list</li> </ul> <a href="https://snyk.io/redirect/github/remix-run/react-router/compare/13fb25a51184f66192e023e2e18be5ff00f37827...edd9ad4957321cfb260cee21ad98aab2becfe250">Compare</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIwMTQwNDNhYS1kNjYyLTQwMjMtOGQ5Yi02YzcyOTA0OTZjYmMiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjAxNDA0M2FhLWQ2NjItNDAyMy04ZDliLTZjNzI5MDQ5NmNiYyJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763/settings/integration?pkg=react-router&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"014043aa-d662-4023-8d9b-6c7290496cbc","prPublicId":"014043aa-d662-4023-8d9b-6c7290496cbc","dependencies":[{"name":"react-router","from":"6.16.0","to":"6.17.0"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"98480bdc-d80b-4fd1-89d7-c4c56a706763","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":4,"publishedDate":"2023-10-16T15:50:05.351Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> Co-authored-by: snyk-bot <snyk-bot@snyk.io>
<p>This PR was automatically created by Snyk using the credentials of a real user.</p><br /><h3>Snyk has created this PR to upgrade react-router-dom from 6.16.0 to 6.17.0.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **4 versions** ahead of your current version. - The recommended version was released **22 days ago**, on 2023-10-16. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>react-router-dom</b></summary> <ul> <li> <b>6.17.0</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.17.0">2023-10-16</a></br><p>react-router-native@6.17.0</p> </li> <li> <b>6.17.0-pre.2</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.17.0-pre.2">2023-10-13</a></br><p>react-router-native@6.17.0-pre.2</p> </li> <li> <b>6.17.0-pre.1</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.17.0-pre.1">2023-10-12</a></br><p>react-router-native@6.17.0-pre.1</p> </li> <li> <b>6.17.0-pre.0</b> - 2023-10-11 </li> <li> <b>6.16.0</b> - 2023-09-13 </li> </ul> from <a href="https://snyk.io/redirect/github/remix-run/react-router/releases">react-router-dom GitHub release notes</a> </details> </details> <details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>react-router-dom</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/edd9ad4957321cfb260cee21ad98aab2becfe250">edd9ad4</a> chore: Update version for release (near#10935)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/c1d0e50fc9ef5706c0d6ce9d0866ec1f4dadaab7">c1d0e50</a> Exit prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1c64bc1d4fe9c212dcd073b12ea51d2e10c45ea7">1c64bc1</a> Update readme for view transitions example</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1604c74f3abb0650910efb264908a3803fcc2e5e">1604c74</a> Split changeset for remix router and react-router-dom</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ae843545c1a3a38c761b940ed5dc4fab15bb2d3a">ae84354</a> Update view-transitions example to use prerelease</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/6cfbd0e571018bf1d8722c09d70e394d2602f5be">6cfbd0e</a> chore: Update version for release (pre) (near#10934)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/c48341d6b75f4fd5b0ec60ed32c3c45ebb1e532f">c48341d</a> Lift startViewTransition implementation to react-router-dom (near#10928)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/b916689b4a211827cc324cf05994c334e25d380b">b916689</a> chore: Update version for release (pre) (near#10931)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/cbc9d7222cc4ca1e74f0b081472187bbd6a95a42">cbc9d72</a> Fix lint issues (near#10930)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1ad822c5bf8b32143aeef8511ca02577b487aafc">1ad822c</a> Update docs for startViewTransition (near#10927)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/e93e9088360e3fc1a4183efc5a39c8e680903554">e93e908</a> Docs updates</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/b09c5d09198b1ee4a8bfbf8a2a8910fc8eed7d2c">b09c5d0</a> chore: Update version for release (pre) (near#10924)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/d3203fb1b7bcfd73fa21e93b9b190defb769e33c">d3203fb</a> Enter prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/3adb639109ea5e90800e0b155035a610f0a09b4b">3adb639</a> Merge branch 'main' into release-next</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/a5451d5d3967a356e6d5af3cbefb858d2702044e">a5451d5</a> Update docs</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/feebfc0bf10614ba44ff43e2b9c69e22ad07a7a1">feebfc0</a> Add startViewTransition support (near#10916)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/7ce38dc49ee997706902ac2d033ba1fd683cfed0">7ce38dc</a> [Docs]: Use consistent feature warnings (near#10908)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f77743aebfca26faabdd04e9ed1dd31721459877">f77743a</a> chore: format</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/8af53e7bfcf004916af4ea37e9d24e295d6ac107">8af53e7</a> Root router have a path different to '' or '/' (near#10852)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ebe2491f7cd966d9967edb8acaeed86f9e1ab5b9">ebe2491</a> Fix RouterProvider future prop (near#10900)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/b98e82dbd774eadf3972f0b58f2542a8b5599d97">b98e82d</a> Specify `ErrorResponse` as interface to provide obvious contract (near#10876)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/da57748644da6400e2d051b2aa004df47beda1cf">da57748</a> fix(docs): add backticks to element names (near#10874)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f8194fdb8e371b715d29d30a82e04a82a7648e9b">f8194fd</a> Handle case when session storage is blocked (near#10848)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f9b3dbd9cbf513366c456b33d95227f42f36da63">f9b3dbd</a> chore: sort contributors list</li> </ul> <a href="https://snyk.io/redirect/github/remix-run/react-router/compare/13fb25a51184f66192e023e2e18be5ff00f37827...edd9ad4957321cfb260cee21ad98aab2becfe250">Compare</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJlNTIxZTJlYi05MGNmLTRlZjEtYjljMC1iYTFlZTU2NjFjNzEiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImU1MjFlMmViLTkwY2YtNGVmMS1iOWMwLWJhMWVlNTY2MWM3MSJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763/settings/integration?pkg=react-router-dom&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"e521e2eb-90cf-4ef1-b9c0-ba1ee5661c71","prPublicId":"e521e2eb-90cf-4ef1-b9c0-ba1ee5661c71","dependencies":[{"name":"react-router-dom","from":"6.16.0","to":"6.17.0"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/ecp88/project/98480bdc-d80b-4fd1-89d7-c4c56a706763?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"98480bdc-d80b-4fd1-89d7-c4c56a706763","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":4,"publishedDate":"2023-10-16T15:50:05.302Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> Co-authored-by: snyk-bot <snyk-bot@snyk.io>
This significantly reduces the cost of finalize, especially for shard 3 where they were the largest:
The effect on the overall apply duration is not as high however:
This is understandable, as ultimately all of this data that we were seeing in
finalize
still needs to be retrieved. The important part, however is that the duration of this is much more consistent and less jumpy now.cc @saketh-are keep an eye out on whether we need to prefetch receipt data for yield-resume receipts.