Skip to content

feat: replace attested bytes with typed MessageOrigin in delegate API#61

Merged
iduartgomez merged 2 commits intomainfrom
feat/delegate-message-origin
Mar 12, 2026
Merged

feat: replace attested bytes with typed MessageOrigin in delegate API#61
iduartgomez merged 2 commits intomainfrom
feat/delegate-message-origin

Conversation

@iduartgomez
Copy link
Contributor

@iduartgomez iduartgomez commented Mar 12, 2026

Summary

  • Replace raw attested: Option<&'static [u8]> with typed origin: Option<MessageOrigin> in DelegateInterface::process
  • Remove redundant app: ContractInstanceId field from ApplicationMessage
  • Add new MessageOrigin enum (WebApp(ContractInstanceId))
  • Bump version to 0.3.0 (breaking API changes)

Breaking Changes

  • DelegateInterface::process signature: attested: Option<&'static [u8]>origin: Option<MessageOrigin>
  • ApplicationMessage::new(app, payload)ApplicationMessage::new(payload)
  • ApplicationMessage.app field removed
  • FlatBuffers schema: app field removed from ApplicationMessage table

Test plan

  • stdlib builds and tests pass
  • freenet-core lib tests pass (1958 tests)
  • All 7 test delegate crates build and pass unit tests
  • test_delegate_request e2e integration test passes (Docker/Linux)
  • test_attested_contract_passed_to_delegate e2e integration test passes (Docker/Linux)

Related PRs

Merge order: stdlib first → publish 0.3.0 → core → river

Replace the raw `attested: Option<&'static [u8]>` parameter in
DelegateInterface::process() with `origin: Option<MessageOrigin>`,
where MessageOrigin::WebApp(ContractInstanceId) identifies the
originating web application.

Also removes the `app` field from ApplicationMessage — the origin
is now conveyed through the process() parameter rather than being
duplicated on every message.

Closes #1498
Breaking changes in this release:
- DelegateInterface::process: attested → origin: Option<MessageOrigin>
- ApplicationMessage: removed app field, new() takes only payload
- New public type: MessageOrigin enum
@iduartgomez iduartgomez merged commit 63dbf07 into main Mar 12, 2026
8 checks passed
@iduartgomez iduartgomez deleted the feat/delegate-message-origin branch March 12, 2026 15:38
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