-
Notifications
You must be signed in to change notification settings - Fork 185
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
fix(cli): deploy systems/modules before registering/installing them #1767
Conversation
🦋 Changeset detectedLatest commit: c771374 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
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 |
|
||
if (contractTxs.length) { | ||
debug("waiting for contracts"); | ||
// wait for each tx separately/serially, because parallelizing results in RPC errors |
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.
because parallelizing results in RPC errors
oh interesting
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.
I think because viem under the hood sets up a block watcher when you call waitForTransactionReceipt
, so when we do this 100x in parallel, we get a LOT of polling of the RPC.
Since ultimately the waitForTransactionReceipt
just does a getTransactionReceipt
for each watched block until it succeeds, it's fine to do this serially, because each transaction confirmed in the same block or blocks before will return immediately without the polling.
That means they'll all resolve in the same amount of time with far less RPC calls.
Using the
pending
block tag to simulate/estimate gas seems to give bad results if the a contract being called does not yet exist (i.e. is itself pending in the mempool). So we need to wait for contracts to be deployed before proceeding.