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

docs: proxy contract cookbook #3253

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

danielbate
Copy link
Contributor

@danielbate danielbate commented Oct 5, 2024

Release notes

In this release, we:

  • Added a cookbook for deploying and manually upgrading by proxy contract

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@danielbate danielbate added the docs Requests pertinent to documentation label Oct 5, 2024
@danielbate danielbate self-assigned this Oct 5, 2024
Copy link

vercel bot commented Oct 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 3:50pm
ts-api-docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 3:50pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 3:50pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ts-docs-api ⬜️ Ignored (Inspect) Nov 19, 2024 3:50pm

Copy link

codspeed-hq bot commented Oct 5, 2024

CodSpeed Performance Report

Merging #3253 will not alter performance

Comparing db/chore/manual-proxy-contracts (6abfd3b) with master (6ab3e6b)

Summary

✅ 18 untouched benchmarks

@danielbate danielbate changed the base branch from next to master October 9, 2024 06:40
Copy link
Member

@Dhaiwat10 Dhaiwat10 left a comment

Choose a reason for hiding this comment

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

Awesome work mate, just some typos:

apps/docs/src/guide/contracts/proxy-contracts.md Outdated Show resolved Hide resolved
apps/docs/src/guide/contracts/proxy-contracts.md Outdated Show resolved Hide resolved
Torres-ssf
Torres-ssf previously approved these changes Oct 17, 2024

[dependencies]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.6.0" }
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.24.0" }
Copy link
Member

Choose a reason for hiding this comment

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

We must be sure this is the correct version of this contract.

Can we please have a README explaining all these details?

This must always be paired with the one used by the fuels CLI, and forc:

Copy link
Member

Choose a reason for hiding this comment

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

You'll notice we use a pre-built version in the' fuels' CLI, which is the same approach followed by forc:

Perhaps we could even reuse the same built version inside the fuels/deploy command. We'd only need the source to use the contract's contents in code snippets, which doesn't seem to be the case.

Copy link
Contributor

Choose a reason for hiding this comment

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

@arboleya Should we export the generated types from the Src14Proxy contract in the umbrella package?

This way, we can advise users who prefer manual deployment ( not using the fuels CLI ) to use our exported version, ensuring it stays in sync with the audited version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Torres-ssf @arboleya I get a cyclic dep if I export this directly from fuels, do we want, dare I say, another package?

Copy link
Contributor Author

@danielbate danielbate Nov 19, 2024

Choose a reason for hiding this comment

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

We could export it from fuel-ts/abi-typegen as example standards?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exporting this has been a bit painful.

If the generated factory exists inside fuels and we want to export it from there, we get cyclic deps for all the things that the factory itself is importing. So we'd need to swap out the imports for the module imports.

It probably needs to exist in it's own package, that imports all the required module imports that the factory needs. With a script that swaps the fuels imports for the module imports so we can still export it from fuels.

Will feedback soon.

Copy link
Contributor

Choose a reason for hiding this comment

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

@danielbate Yes. I've struggled to find a solution for this as well.

@Torres-ssf Torres-ssf marked this pull request as draft October 21, 2024 13:28
@danielbate
Copy link
Contributor Author

Going to delay this till after #3369 to not impede snippet finalisation.

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
64.09%(-0.11%) 69.78%(+0.07%) 73.05%(+0.06%) 64.57%(-0.07%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 ✨ apps/docs-snippets2/src/contracts/proxy-contracts.ts 0%
(+0%)
100%
(+100%)
100%
(+100%)
0%
(+0%)
🔴 apps/docs-snippets2/src/typegend/contracts/Counter.ts 83.33%
(+16.67%)
100%
(+0%)
50%
(+50%)
83.33%
(+16.67%)
🔴 ✨ apps/docs-snippets2/src/typegend/contracts/CounterV2.ts 83.33%
(+83.33%)
100%
(+100%)
50%
(+50%)
83.33%
(+83.33%)
✨ apps/docs-snippets2/src/typegend/contracts/CounterV2Factory.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
🔴 ✨ apps/docs-snippets2/src/typegend/contracts/Proxy.ts 83.33%
(+83.33%)
100%
(+100%)
75%
(+75%)
91.66%
(+91.66%)
🔴 ✨ apps/docs-snippets2/src/typegend/contracts/ProxyFactory.ts 66.66%
(+66.66%)
0%
(+0%)
66.66%
(+66.66%)
66.66%
(+66.66%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Requests pertinent to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs on manually upgrading by proxy
5 participants