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
I noticed when switching between transacting on a local wasmd chain and the DO node that the cache will provide the wrong code_id / contract due to not updating when the user changes which chain they are interacting with.
The solution is to make the cache entry include the a unique identifier for the chain being interacted with, with cache reading functions taking this identifier as input to know which code_id to provide.
I'm not exactly sure what an appropriate unique identifier would be, however, since chain_id isn't guaranteed to be unique. However, maybe this is to be ignored? Not sure what the convention is within the cosmos ecosystem for this kind of thing.
Also, the cache reading functions should be more resilient as to not throw a panic/error if, for example, a file exists in the cache for a given contract but is empty instead of containing the code_id (which can happen if the user manually deletes the contents of the file). Such a case should just cause the cache to behave as though the cache is empty.
Acceptance Criteria
The text was updated successfully, but these errors were encountered:
dangush
changed the title
Cache doesn't take into account target chain
CLI UX: Cache doesn't take into account target chain
Sep 16, 2024
Summary
I noticed when switching between transacting on a local wasmd chain and the DO node that the cache will provide the wrong code_id / contract due to not updating when the user changes which chain they are interacting with.
The solution is to make the cache entry include the a unique identifier for the chain being interacted with, with cache reading functions taking this identifier as input to know which code_id to provide.
I'm not exactly sure what an appropriate unique identifier would be, however, since
chain_id
isn't guaranteed to be unique. However, maybe this is to be ignored? Not sure what the convention is within the cosmos ecosystem for this kind of thing.Also, the cache reading functions should be more resilient as to not throw a panic/error if, for example, a file exists in the cache for a given contract but is empty instead of containing the code_id (which can happen if the user manually deletes the contents of the file). Such a case should just cause the cache to behave as though the cache is empty.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: