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
Why. The write functions wrote the raw Storage and bypassed the node's state-store chokepoints, so every side effect those perform had to be copied by hand. Two omissions reached production (freenet-core #4683, #5479). subscribe_contract only worked for a contract the node already held. A delegate should write by emitting OutboundDelegateMsg::PutContractRequest / UpdateContractRequest, and subscribe with SubscribeContractRequest. Those go through the node's normal path and, since freenet-core #5615, reach the network.
Effect on SDK users. A delegate that calls one of the three removed methods fails to instantiate on a node with #5638, with a named missing-import error. A delegate that only links stdlib is unaffected, because unused imports are dropped. No delegate in river, delta, harvest, ghostkeys, atlas, freenet-bitcoin or raven calls them.
What stdlib should do
Deprecateput_contract_state, update_contract_state and subscribe_contract on DelegateCtx, pointing at the outbound-message equivalents, then remove them in a later breaking release. subscribe_contract_checked (0.10.0) imports __frnt__delegate__subscribe_contract_checked, which freenet-core has never provided; it needs the same treatment.
Rename the read to say what it does.get_contract_state returns only the state this node already holds, and None means "not held here", not "does not exist". Suggested: add local_contract_state over the same __frnt__delegate__get_contract_state(_len) imports and deprecate get_contract_state as an alias. freenet-core deliberately kept the import names so existing delegates keep loading.
Correct delegate_interface.rs (around line 884 in 0.10.0). It currently recommends "the V2 host-function API (the freenet_delegate_contracts import namespace)" as the forward-compatible path for delegates. After #5638 that namespace holds only the read.
Stop calling this the "V2" API in docs. There is one delegate API version, DelegateWasmAPIVersion::V1.
Before starting, check: the local, unpushed branch feat/delegate-subscription-api (last commit 2026-08-22) documents these wrappers as the public delegate API, and a separate chore/deprecate-lone-subscribe branch exists. Check with whoever owns them first so the work doesn't collide.
Closing: the deprecation half is done. #134 (merged) removed the DelegateCtx put/update/subscribe wrappers outright, since no released freenet-core provides those host imports. The remaining get_contract_state → local_contract_state rename is cosmetic and would need a stdlib release plus a core bump; open a fresh issue if it's still wanted.
Activity
fix(delegates): keep the read's import names for stdlib compatibility…
test
sanity commentedon Oct 15, 2026
Closing: the deprecation half is done. #134 (merged) removed the
DelegateCtxput/update/subscribe wrappers outright, since no released freenet-core provides those host imports. The remainingget_contract_state→local_contract_staterename is cosmetic and would need a stdlib release plus a core bump; open a fresh issue if it's still wanted.[AI-assisted - Claude]