Skip to content
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

feat!: consider message on resources cache #2872

Merged
merged 34 commits into from
Aug 9, 2024

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented Aug 1, 2024

Release notes

In this release, we:

  • Cached Message resources upon transaction submission

Summary

This PR addresses two issues:

1 - Unsetting cached resources if the transaction fails during processing. Previously, UTXO(s) remained cached and unavailable for new transactions until the cache TTL expired, potentially leading to resource unavailability for subsequent transactions.
2- Ensure the resource cache considers Message coins upon transaction submission, not just UTXO(s).

Breaking Changes

The provider option flag cacheUtxo was renamed to resourceCacheTTL

// before
const provider = await Provider.create(FUEL_NETWORK_URL, {
  cacheUtxo: 5000,
});


using launched = await launchTestNode({
  providerOptions: {
    cacheUtxo: 5000,
  },
});
// after
const provider = await Provider.create(FUEL_NETWORK_URL, {
  resourceCacheTTL: 5000,
});

using launched = await launchTestNode({
  providerOptions: {
    resourceCacheTTL: 5000,
  },
});

Checklist

  • I addedtests to prove my changes
  • I updated — all the necessary docs
  • I reviewed — the entire PR myself, using the GitHub UI
  • I described — all breaking changes and the Migration Guide

@Torres-ssf Torres-ssf added bug Issue is a bug p0 labels Aug 1, 2024
@Torres-ssf Torres-ssf self-assigned this Aug 1, 2024
@Torres-ssf Torres-ssf changed the title fix: unset cached resource for failed tx fix: unset cached resource for failed TX Aug 2, 2024
@github-actions github-actions bot added the bug Issue is a bug label Aug 2, 2024
nedsalk
nedsalk previously approved these changes Aug 7, 2024
Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 🚀

Copy link
Contributor

github-actions bot commented Aug 9, 2024

Coverage Report:

Lines Branches Functions Statements
79.77%(+0.15%) 72.06%(+0.15%) 77.81%(+0.25%) 79.93%(+0.17%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/provider.ts 68.53%
(+0.34%)
62.29%
(-0.14%)
73.49%
(-0.31%)
68.48%
(+0.33%)
🔴 ✨ packages/account/src/providers/resource-cache.ts 96.15%
(+96.15%)
92.85%
(+92.85%)
100%
(+100%)
96.42%
(+96.42%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 89.05%
(+0%)
79.71%
(+1.45%)
85.71%
(+0%)
89.28%
(+0%)
🔴 packages/account/src/providers/transaction-response/transaction-response.ts 75.86%
(+3.14%)
58.33%
(+8.33%)
90%
(+1.12%)
75.86%
(+3.14%)
🔴 packages/account/src/providers/utils/extract-tx-error.ts 35%
(+25%)
11.11%
(+11.11%)
57.14%
(+57.14%)
36.36%
(+27.27%)

@Torres-ssf Torres-ssf merged commit c7e01b4 into master Aug 9, 2024
20 checks passed
@Torres-ssf Torres-ssf deleted the st/fix/unset-cached-resource-for-failed-tx branch August 9, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unset Cached Resources After Transaction Failure UTXOs Cache Mechanism Needs To Consider Message Nonces
5 participants