usecannon / cannon

Manage EVM protocol deployments. Inspired by Docker, Terraform, and npm.
https://usecannon.com
GNU General Public License v3.0
104 stars 21 forks source link

fix(builder): Error passthrough on rpc errors #1324

Closed FuzzB0t closed 2 months ago

FuzzB0t commented 2 months ago

Any errors that happen while trying to communicate with the RPC during read operations on optimism were being skipped, which is why the fallback registry would try mainnet even though it may result in fetching the wrong package info.

Adding a throw statement resulted in the RPC error being thrown when a read operation fails due to an RPC issue.

fixes https://linear.app/usecannon/issue/CAN-470/differentiate-errors-better-on-the-fallback-registry

Examples:

Package only on Ethereum mainnet throws rpc error if there is one: https://www.loom.com/share/bfea17e267f4436395dcdac94e2afd9d

Package only on Ethereum mainnet throws rpc error if there is one: https://www.loom.com/share/393264be32cd44bcbb499e800521d0aa

Package on both networks does not fall back to eth mainnet if theres an rpc error: https://www.loom.com/share/e064960836264851aa8ffe63f1ab3dd2

Ive confirmed that all the packages are resolved correctly and the fallback behaviour now works ONLY if the package is not found (aka returns empty string)

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: 6a0c08388a10225a2525ee6ee4237aa8afc79e49

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

nx-cloud[bot] commented 2 months ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 6a0c08388a10225a2525ee6ee4237aa8afc79e49. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target - [`lerna run build --ignore cannon-website --ignore @usecannon/indexer --ignore repo --ignore @usecannon/api`](https://cloud.nx.app/runs/WCb3YujHnh?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.