Skip to content

Use a random UUID for ctx.new_guid()#27

Closed
tjgreen42 wants to merge 1 commit into
mainfrom
fix/new-guid-random-uuid
Closed

Use a random UUID for ctx.new_guid()#27
tjgreen42 wants to merge 1 commit into
mainfrom
fix/new-guid-random-uuid

Conversation

@tjgreen42

Copy link
Copy Markdown
Contributor

ctx.new_guid() built its UUID-shaped string from the wall clock plus a thread-local counter, so the returned identifiers were sequential and predictable across calls. This switches it to a real version-4 UUID.

Replay behavior is unchanged: the value is generated once inside the built-in syscall activity and recorded in history, so the same GUID is returned on every replay. uuid was already in the dependency tree.

generate_guid() built UUID-shaped strings from the wall clock plus a
thread-local counter, which made the returned identifiers sequential and
predictable. Generate a real version-4 UUID instead.

The value is produced once inside the built-in syscall activity and
recorded in history, so it is still returned unchanged on replay.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tjgreen42 tjgreen42 closed this Jun 5, 2026
@tjgreen42 tjgreen42 deleted the fix/new-guid-random-uuid branch June 5, 2026 22:58
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