Skip to content

Conversation

@sanity
Copy link
Contributor

@sanity sanity commented Feb 1, 2026

Summary

Adds message types to allow delegates to store new contracts via PUT operation.

Part of freenet/freenet-core#2829 (Delegate capability: Contract PUT).

Changes

New types in delegate_interface.rs

  • PutContractRequest: Request to store a new contract

    • contract: ContractContainer - the contract code and parameters
    • state: WrappedState - the initial state
    • related_contracts: RelatedContracts<'static> - dependencies
    • context: DelegateContext - for context propagation
    • processed: bool - processing flag
  • PutContractResponse: Response after PUT attempt

    • contract_id: ContractInstanceId - the contract that was stored
    • result: Result<(), String> - success or error message
    • context: DelegateContext - for context propagation

Enum updates

  • OutboundDelegateMsg::PutContractRequest added
  • InboundDelegateMsg::PutContractResponse added
  • Helper methods updated (processed, get_context, get_mut_context, into_owned)
  • From implementations added

Client serialization

  • Added stub for PutContractRequest in client_events.rs (logs error if reached, as it should be handled by executor)

Testing

  • All existing tests pass
  • Types serialize/deserialize correctly

[AI-assisted - Claude]

@sanity sanity force-pushed the feat-delegate-contract-put branch from 61b0b2f to aaf6f1e Compare February 7, 2026 05:09
…tract PUT

Adds message types to allow delegates to store new contracts:

- PutContractRequest: Contains contract code, initial state, and related contracts
- PutContractResponse: Contains result (success or error message)

Part of #2829 (delegate capability: contract PUT).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add UpdateContractRequest/Response and SubscribeContractRequest/Response
to enable delegates to update contracts and subscribe to contract changes.

Part of freenet/freenet-core#2827 (delegate capabilities).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sanity sanity merged commit 1c0c5ae into main Feb 8, 2026
8 of 9 checks passed
@sanity sanity deleted the feat-delegate-contract-put branch February 8, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant