Skip to content

Conversation

@ciricc
Copy link
Contributor

@ciricc ciricc commented Nov 29, 2025

Motivation

protojson.Marshal does not guarantee deterministic output (map key ordering, etc.),
causing panics during replay when payload comparisons fail.

Changes

  • Added VmOptions to internal proto
  • Modified Rust WASM binding to pass NonDeterministicChecksOption::PayloadChecksDisabled
  • Added WithDisablePayloadChecks() method to server.Restate

Usage

restate := server.NewRestate().
WithDisablePayloadChecks().
Bind(...)

Fixes #116

@github-actions
Copy link

github-actions bot commented Nov 29, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ciricc
Copy link
Contributor Author

ciricc commented Nov 29, 2025

I have read the CLA Document and I hereby sign the CLA

@slinkydeveloper slinkydeveloper self-requested a review December 9, 2025 09:52
@slinkydeveloper
Copy link
Contributor

Hey @ciricc, I think there was a misunderstanding in our initial discussion.

As said here: #116 (comment)
I think the checks should be disabled automatically on individual sys_ calls using protojson ser/de, and not on CoreVM::new. I also disagree that we should have a public API like WithDisablePayloadChecks(), as this opens up the doors for being misused...

@slinkydeveloper
Copy link
Contributor

Hey @ciricc can you update this PR?

@ciricc
Copy link
Contributor Author

ciricc commented Jan 15, 2026

Hey @ciricc can you update this PR?

Yes, i'll do that soon

@slinkydeveloper
Copy link
Contributor

I published the shared core 0.7.0, you can use that

@ciricc ciricc force-pushed the main branch 2 times, most recently from 700105a to 7a76235 Compare January 17, 2026 03:47
@ciricc ciricc changed the title Adds WithDisablePayloadChecks() option to disable non-determinism checks for payloads during replay. Support non-deterministic codecs via PayloadOptions Jan 17, 2026
@ciricc
Copy link
Contributor Author

ciricc commented Jan 17, 2026

@slinkydeveloper

Changes

  • Added PayloadOptions message to internal proto with unstable_serialization field
  • Modified syscall wrappers to pass PayloadOptions based on codec characteristics
  • Added IsUnstableSerialization() function to detect non-deterministic codecs
  • Added UnstableSerializer interface for custom codecs to declare instability
  • ProtoJSONCodec is automatically detected as unstable

Added test suite for E2E testing (without changing the sdk-test-suite).

Copy link
Contributor

@slinkydeveloper slinkydeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor bits, and it looks good!

@slinkydeveloper slinkydeveloper merged commit ffa5c21 into restatedev:main Jan 26, 2026
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2026
@slinkydeveloper
Copy link
Contributor

Thank you so much for your PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encoding: protojson.Marshal are not determenistic and may return unstable results

2 participants