-
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
prefetch: claim.sweat::claim #11094
prefetch: claim.sweat::claim #11094
Conversation
8a9786c
to
527dcb6
Compare
527dcb6
to
5422c2c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11094 +/- ##
==========================================
- Coverage 71.14% 71.05% -0.09%
==========================================
Files 761 764 +3
Lines 152857 153225 +368
Branches 152857 153225 +368
==========================================
+ Hits 108748 108881 +133
- Misses 39672 39902 +230
- Partials 4437 4442 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2e2da38
to
71c26cc
Compare
So that we can see what's failing?
71c26cc
to
0baca04
Compare
b01c5b5
to
0c23b2a
Compare
5029b43
to
e62cd7e
Compare
return; | ||
}; | ||
|
||
for (dt, idx) in account_record.accruals { |
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.
Idea: if we think there could be especially large number of accruals
in some of the records, it might make sense to limit the work in this thread to only prefetch the first K of them.
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.
How do we know what limit to use? But also, given that this code is going to be dead in 3 weeks...
// Just read this directly for now since this is temporary anyway | ||
let prefetcher_storage = prefetch_api.make_storage(); | ||
let trie = Trie::new(prefetcher_storage, trie_root, None); | ||
let Ok(Some(account_record)) = trie.get(&trie_key.to_vec()) else { |
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 trie
is based on TriePrefetchingStorage
, which should ensure the data is not retrieved simultaneously by multiple threads
let Ok(()) = 1u8.serialize(&mut accruals_key) else { continue }; | ||
let Ok(()) = dt.serialize(&mut accruals_key) else { continue }; | ||
let accruals_key = sha2::Sha256::digest(&accruals_key).to_vec(); | ||
let _ = prefetch_api.prefetch_trie_key( |
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.
Going through prefetch_api.prefetch_trie_key
puts this request at the end of the prefetcher's FIFO work queue.
Bypassing the queue might be avoided by using trie.get
as above, to have the data available earlier. However bypassing the queue and prefetcher API like that for many keys is probably risky.
let Ok(()) = 2u8.serialize(&mut amount_key) else { continue }; | ||
let Ok(()) = dt.serialize(&mut amount_key) else { continue }; | ||
amount_key.extend(&idx.to_le_bytes()); // index into Vector | ||
let _ = prefetch_api.prefetch_trie_key( |
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.
Same here.
<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.20.1 to 6.21.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 **5 versions** ahead of your current version. - The recommended version was released **21 days ago**, on 2023-12-13. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>react-router</b></summary> <ul> <li> <b>6.21.0</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.21.0">2023-12-13</a></br><p>react-router-native@6.21.0</p> </li> <li> <b>6.21.0-pre.3</b> - <a href="https://snyk.io/redirect/github/remix-run/react-router/releases/tag/react-router-native%406.21.0-pre.3">2023-12-06</a></br><p>react-router-native@6.21.0-pre.3</p> </li> <li> <b>6.21.0-pre.2</b> - 2023-12-05 </li> <li> <b>6.21.0-pre.1</b> - 2023-12-05 </li> <li> <b>6.21.0-pre.0</b> - 2023-12-05 </li> <li> <b>6.20.1</b> - 2023-12-01 </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/69ba50e06633fd4add234fb47f2d49b0a5ee41f9">69ba50e</a> chore: Update version for release (near#11114)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ffd4373737a5bda3ad0fcebfa4895fbd8038a504">ffd4373</a> Exit prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ea0ffeef8a0c353f8ef402b5df2ac7c60a4d0b49">ea0ffee</a> chore: Update version for release (pre) (near#11095)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/fe3c071037b18f447dabb44fb24e4b1bce2a2a15">fe3c071</a> Slight refactor to partial hydration to leverage state.initialized properly (near#11094)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ed40ee9e61f3c4608bcc2e4cb1275c4b5dbd144e">ed40ee9</a> Update release notes comparison link</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1447eb03a740b765ce79079ebd832afb5d1b02d8">1447eb0</a> Update release notes</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/373b30cdfb4a770e77f6ded25e94ba72fbde4e23">373b30c</a> chore: Update version for release (pre) (near#11091)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f9d7ed62904766013d05a1642232d73e47f3bc27">f9d7ed6</a> Fix server future plumbing</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/56b2944ef18307fa6d5e432b52eead38eeda3402">56b2944</a> chore: Update version for release (pre) (near#11090)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/558d7936cc8fe643374a2c9a9fdcf022e8c4c939">558d793</a> Fix plumbing of future prop</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1c6f3b31fcd49a9065298769d097df420216238e">1c6f3b3</a> fix typos</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ee5fcd54af4784d58191d97a7117fa4d75378946">ee5fcd5</a> Generate release notes</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ddc2b94c26ac4a12b5a8e37dc4179e1b10644e1b">ddc2b94</a> chore: Update version for release (pre) (near#11089)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/1752d84eb44f9e1218798a1e431be9b02bbef9ab">1752d84</a> Enter prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/120de8c6c61af165cd09b3b785141336619aadf8">120de8c</a> Merge branch 'main' into release-next</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/149ad65a8dfb90b18835ec784792b6a86e4427a9">149ad65</a> Add future.v7_relativeSplatPath flag (near#11087)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/839df232462e710f5f3bdff1cac2dff9504820be">839df23</a> Bump bundle</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/d04c54100c527dd84c1ca4b7059d38d2a4b4be99">d04c541</a> Fix tests from conflicting PRs</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/0d2a38c7395d2434f9b8cf8100890b8ad6aad0b8">0d2a38c</a> Support partial hydration for Remix clientLoader/clientAction (near#11033)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/cb53f41d4341fcc7ca053d89b5bda03a4fe95106">cb53f41</a> Fix issue when rendering Link/NavLink outside of matched routes (near#11062)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/211c1ff4af0fbf18d79de71a59dd1b6fe410637e">211c1ff</a> Bump bundle</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/e6814d5202beab18a259441144203727a3f13287">e6814d5</a> Properly handle falsy error values in ErrorBoundary's (near#11071)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/dc7833c2beec923a26f2e54898f66fe81e524fa5">dc7833c</a> Catch errors when trying to unwrap responses (near#11061)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/7a5c0a7d91b6f62847418a46ec2d43e0e292a5b2">7a5c0a7</a> Merge branch 'release-next' into dev</li> </ul> <a href="https://snyk.io/redirect/github/remix-run/react-router/compare/8b1ee67ebc00fc3e778d5e36fe9bca140b576b5c...69ba50e06633fd4add234fb47f2d49b0a5ee41f9">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=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJhNDI2MjMwYi1iOTMzLTQwZmYtYjU1YS1mM2U2YTM5MzE2ODciLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImE0MjYyMzBiLWI5MzMtNDBmZi1iNTVhLWYzZTZhMzkzMTY4NyJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/near-ecosystem/project/e3526cdd-987a-4d84-a55d-30d275fc17bc?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/near-ecosystem/project/e3526cdd-987a-4d84-a55d-30d275fc17bc/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/near-ecosystem/project/e3526cdd-987a-4d84-a55d-30d275fc17bc/settings/integration?pkg=react-router&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"a426230b-b933-40ff-b55a-f3e6a3931687","prPublicId":"a426230b-b933-40ff-b55a-f3e6a3931687","dependencies":[{"name":"react-router","from":"6.20.1","to":"6.21.0"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/near-ecosystem/project/e3526cdd-987a-4d84-a55d-30d275fc17bc?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"e3526cdd-987a-4d84-a55d-30d275fc17bc","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":5,"publishedDate":"2023-12-13T21:34:17.308Z"},"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.20.1 to 6.21.1.</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 **7 versions** ahead of your current version. - The recommended version was released **22 days ago**, on 2023-12-21. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>react-router-dom</b></summary> <ul> <li> <b>6.21.1</b> - 2023-12-21 </li> <li> <b>6.21.1-pre.0</b> - 2023-12-21 </li> <li> <b>6.21.0</b> - 2023-12-13 </li> <li> <b>6.21.0-pre.3</b> - 2023-12-06 </li> <li> <b>6.21.0-pre.2</b> - 2023-12-05 </li> <li> <b>6.21.0-pre.1</b> - 2023-12-05 </li> <li> <b>6.21.0-pre.0</b> - 2023-12-05 </li> <li> <b>6.20.1</b> - 2023-12-01 </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/08cda17f450ebe19481be3fc080d243ec5ef509f">08cda17</a> chore: Update version for release (near#11132)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/14df5db772c1ec92fd680b7646c8865d5caf1a84">14df5db</a> Exit prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/c55f8417e17491e8e4f5626680bc4c9b8d0f9ed9">c55f841</a> Update release notes</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/e5d73cf2251bf99d3113695a57c34c84e0ac92e5">e5d73cf</a> chore: Update version for release (pre) (near#11131)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/a7ec1c50756172b92aeff2225cbedca7254c63b7">a7ec1c5</a> Enter prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ba99ec567e1899f811973d99ca804dc620a9cfae">ba99ec5</a> Merge branch 'main' into release-next</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/8bb3ffdf3225dafd2c8df11a27141b0745fcc647">8bb3ffd</a> Fix typo in changeset</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/0f04d11d152a2d7d7ebace786bc7c2fd30d55fbc">0f04d11</a> Fix issues with partial hydration combined with route.lazy (near#11121)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/cc4436c544300a09d9d95c5f733d3b00fd7d426f">cc4436c</a> Update changelogs for useResolvedSplat example</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/d9b36f6e16a7b437be30faf7fdd8154cff40e9cc">d9b36f6</a> Update useResolvedPath docs</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/f8c54a89f604185e8462a7768d0172a670beae6d">f8c54a8</a> chore: format</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/abb23de1345349fc81a5beb6ff6697ea04816078">abb23de</a> doc edited for unstable_useViewTransitionState (near#11117)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/a4e91e089a730443f638742759e7dd335aea1399">a4e91e0</a> chore: sort contributors list</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/2ea19faf9b47222a797037a63e61375622ad0fb6">2ea19fa</a> docs: Add minor grammatical changes to `errorElement` docs for better readability (near#11119)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/87d5d6114420b3f00e156c04564c2c24496b6235">87d5d61</a> Fix unit test (near#11115)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/19e6398f20779dd34d8b4eca0f3605bf5831a7f0">19e6398</a> Add v7_relativeSplatPath to createBrowserRouter docs</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/c292bdb9bd1171546b5937c6ff226a6f064c8652">c292bdb</a> Merge branch 'release-next' into dev</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/5567158e1f7ab96683bcb4c757e27b1c22ceb68f">5567158</a> Merge branch 'release-next'</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/69ba50e06633fd4add234fb47f2d49b0a5ee41f9">69ba50e</a> chore: Update version for release (near#11114)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ffd4373737a5bda3ad0fcebfa4895fbd8038a504">ffd4373</a> Exit prerelease mode</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/54ec39ee35cfde99ee7218e6aa2bd1b7d8afc787">54ec39e</a> Allow persisted fetchers unmounted during submit to revalidate (near#11102)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/a76ee41e08f0b2a88557b48656ff2fc318f5c4d0">a76ee41</a> Dedup relative path logic in resolveTo (near#11097)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/ea0ffeef8a0c353f8ef402b5df2ac7c60a4d0b49">ea0ffee</a> chore: Update version for release (pre) (near#11095)</li> <li><a href="https://snyk.io/redirect/github/remix-run/react-router/commit/fe3c071037b18f447dabb44fb24e4b1bce2a2a15">fe3c071</a> Slight refactor to partial hydration to leverage state.initialized properly (near#11094)</li> </ul> <a href="https://snyk.io/redirect/github/remix-run/react-router/compare/8b1ee67ebc00fc3e778d5e36fe9bca140b576b5c...08cda17f450ebe19481be3fc080d243ec5ef509f">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=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIyODZlOTdmZi04MTUxLTRiMWYtODM2Zi0zNzJiMTg4NzZjZWIiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjI4NmU5N2ZmLTgxNTEtNGIxZi04MzZmLTM3MmIxODg3NmNlYiJ9fQ==" 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":"286e97ff-8151-4b1f-836f-372b18876ceb","prPublicId":"286e97ff-8151-4b1f-836f-372b18876ceb","dependencies":[{"name":"react-router-dom","from":"6.20.1","to":"6.21.1"}],"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":7,"publishedDate":"2023-12-21T17:00:03.440Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> Co-authored-by: snyk-bot <snyk-bot@snyk.io>
No description provided.