Skip to content

docs: state contract requires idempotent + associative merge, not just commutative - #92

Merged
sanity merged 1 commit into
mainfrom
docs/state-idempotent-associative
Aug 14, 2026
Merged

docs: state contract requires idempotent + associative merge, not just commutative#92
sanity merged 1 commit into
mainfrom
docs/state-idempotent-associative

Conversation

@sanity

@sanity sanity commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Problem

ContractInterface's doc comment only required delta updates to be commutative, but the whitepaper defines contract state as an idempotent commutative monoid (merge must be associative, commutative, AND idempotent). Missing idempotence in the trait docs is misleading for contract authors.

Approach

Align the doc comment wording with the whitepaper's terminology ("associative, commutative, and idempotent" / "idempotent commutative monoid").

Testing

Doc-comment-only change; cargo check -p freenet-stdlib --all-features passes.

[AI-assisted - Claude]

…t commutative

The whitepaper defines contract state as an idempotent commutative
monoid (associative, commutative, idempotent merge), but the
ContractInterface doc comment only mentioned commutativity. Align the
trait docs with the whitepaper's terminology.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018gMSXHaQ2rXKGfAVWKqk11
@sanity
sanity merged commit 395bc7b into main Aug 14, 2026
8 checks passed
@sanity
sanity deleted the docs/state-idempotent-associative branch August 14, 2026 03:35
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