Skip to content

Fix module deployment #6869

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

Merged
merged 1 commit into from
Apr 28, 2025
Merged

Fix module deployment #6869

merged 1 commit into from
Apr 28, 2025

Conversation

kumaryash90
Copy link
Member

@kumaryash90 kumaryash90 commented Apr 27, 2025

  • Handle refs and metadata format (solc vs zksolc) for modules

PR-Codex overview

This PR focuses on fixing module deployment issues related to references and zero-knowledge (zk) technology in the thirdweb package.

Detailed summary

  • Updated the function getOrDeployInfraContractFromMetadata to improve deployment logic.
  • Changed the way contracts are deployed, using deployContractfromDeployMetadata.
  • Enhanced fetchPublishedContractsFromDeploy to handle zkSync chain variants and fetch metadata correctly.
  • Added error handling for fetching contract URIs.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@kumaryash90 kumaryash90 requested review from a team as code owners April 27, 2025 13:50
Copy link

changeset-bot bot commented Apr 27, 2025

🦋 Changeset detected

Latest commit: 880650d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 27, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2025 8:33am
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2025 8:33am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2025 8:33am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2025 8:33am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2025 8:33am

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Apr 27, 2025
Copy link
Contributor

graphite-app bot commented Apr 27, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

github-actions bot commented Apr 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 51.19 KB (0%) 1.1 s (0%) 285 ms (+6.95% 🔺) 1.4 s
thirdweb (cjs) 143.86 KB (0%) 2.9 s (0%) 745 ms (-2.14% 🔽) 3.7 s
thirdweb (minimal + tree-shaking) 5.67 KB (0%) 114 ms (0%) 44 ms (+54.17% 🔺) 158 ms
thirdweb/chains (tree-shaking) 514 B (0%) 11 ms (0%) 37 ms (+452.66% 🔺) 47 ms
thirdweb/react (minimal + tree-shaking) 19.38 KB (0%) 388 ms (0%) 98 ms (+107.48% 🔺) 486 ms

Copy link

codecov bot commented Apr 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.22%. Comparing base (e9069c9) to head (880650d).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6869   +/-   ##
=======================================
  Coverage   55.21%   55.22%           
=======================================
  Files         896      896           
  Lines       57040    57042    +2     
  Branches     3952     3952           
=======================================
+ Hits        31497    31499    +2     
- Misses      25446    25447    +1     
+ Partials       97       96    -1     
Flag Coverage Δ
packages 55.22% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
...hirdweb/src/contract/deployment/utils/bootstrap.ts 90.15% <100.00%> (ø)
...rdweb/src/extensions/prebuilts/deploy-published.ts 86.33% <100.00%> (+0.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

});
publishURIs = [published.publishMetadataUri];
}
} catch {}
Copy link
Member

Choose a reason for hiding this comment

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

do we want to log an error here?

also what happens if this fails, but the code continues? is it just gonna fail down the line?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this is a fallback, but we don't need to throw here.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's something I added in case there's a contract-id we can search on thirdweb published contracts. Else, continue as before.

Copy link
Member Author

Choose a reason for hiding this comment

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

We'll need to update ContractPublisher contract to map multiple metadata-uris (if present) for a single publish version. That's the best way to handle it. Added this in comments.

Copy link
Member

Choose a reason for hiding this comment

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

got it

Copy link
Member Author

kumaryash90 commented Apr 28, 2025

Merge activity

- Handle refs and metadata format (solc vs zksolc) for modules

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on fixing module deployment issues in the `thirdweb` package, particularly with references and zk (zero-knowledge) support. It modifies contract deployment utilities and enhances the fetching of published contracts.

### Detailed summary
- Updated the `getOrDeployInfraContractFromMetadata` function to simplify contract retrieval.
- Changed the deployment logic to use `deployContractfromDeployMetadata`.
- Enhanced `fetchPublishedContractsFromDeploy` to handle zkSync chains and fetch metadata appropriately.
- Added new types and improved error handling for contract metadata fetching.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants