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
{{ message }}
Repository navigation
Saved contracts on devnet/regtest are not tied to a chain, and document FFIs resolve contracts from the cache only #6078
SwiftExampleApp saves contracts with only their Network value, and AppState.loadKnownContractsIntoSDK preloads a new SDK with the saved contracts of its network, keyed by contract id. Two devnet configurations, or a devnet that was reset, share .devnet. So a contract saved on the old chain under a shared id (such as DashPay's) at an equal or higher version can shadow the new chain's copy.
For private document reads, newer_private_document_contract (#6052) keeps the held contract when the fetched version is not higher. The read then fails or reads under the stale schema.
Skipping the preload on configurable networks is not a fix today. SDKWrapper::data_contract in rs-sdk-ffi (18 call sites across the document FFIs: create, put, replace, delete, erase, transfer, purchase, price, fetch, history) reads only the context provider. A saved custom contract would then fail with "not found in the SDK's context provider". PersistentIdentity is keyed by networkRaw only too, so this is an app-wide gap for configurable networks.
Proposed
An rs-sdk resolver that fetches and registers the proved contract on a cache miss, used by the document FFIs, with a cold-SDK test (a saved non-system contract, no intervening download).
Record chain identity on saved rows for configurable networks, or drop the preload there once (1) lands.
Raised in the review of #6052, which narrows the preload from every network to the SDK's network.
Activity
revert: preload saved contracts on devnet and regtest again, filtered…