You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is impossible to do without having an intermittent state where B is broken.
This is because contract updates are only effective after the transaction has finished. So the transaction:
tx {
Update A0 to A1
Update B0 to B1
}
would fail because at the second instruction B1 is importing A0 as A0 only updates to A1 after the transaction body is executed.
An instance of this occurring was an update to system contracts where one system contract was updated, and a few blocks later the other was updated. In between those transactions the system transaction always failed.
While contract updates are delayed until the end of the transaction we could use the updated contract code for cadence type checking for the subsequent updates in the same transaction.
tx {
// Actual update is delayed until the end of the transaction
Update A0 to A1
// When type checking B1 use code from A1 instead of that of A0
Update B0 to B1
}
Definition of Done
Contracts can be updated so that dependant contracts are updated within the same transaction
The text was updated successfully, but these errors were encountered:
Problem Definition
In the following situation:
This is impossible to do without having an intermittent state where B is broken.
This is because contract updates are only effective after the transaction has finished. So the transaction:
would fail because at the second instruction B1 is importing A0 as A0 only updates to A1 after the transaction body is executed.
An instance of this occurring was an update to system contracts where one system contract was updated, and a few blocks later the other was updated. In between those transactions the system transaction always failed.
relevant discord conversation: https://discord.com/channels/613813861610684416/1108968095982293002/1210247669683986442
Proposed Solution
While contract updates are delayed until the end of the transaction we could use the updated contract code for cadence type checking for the subsequent updates in the same transaction.
Definition of Done
The text was updated successfully, but these errors were encountered: