Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic UUID (System.Guid) generator for distributed actions #371

Closed
dahlia opened this issue Jul 26, 2019 · 1 comment · Fixed by #439

Comments

@dahlia
Copy link
Member

commented Jul 26, 2019

Since actions are executed in a distributed network, these have to be deterministic so that they have the same result regardless of node. Therefore, we've provided APIs like IActionContext.Random to replace .NET's System.Random. (Disclaimer: Saying random numbers should be deterministic here could sound contradictory, but it technically means “random numbers should be unpredictable until a block is mined, and they should not change and be consistent between all nodes in a distributed network after a block is once mined.”)

However, for UUIDs (System.Guid values) we currently provide no correspondence to IActionContext.Random for this. Although library users could implement their own UUID generator built on IActionContext.Random, it's not only unhandy but also leads to make a mistake that a library user thoughtlessly use the System.Guid.NewGuid() method.

So I suggest to have an API to generate a System.Guid value in the same way IActionContext.Random generates a random number!

See also: https://github.com/dotnet/corefx/blob/master/src/Common/src/CoreLib/System/Guid.Unix.cs#L12-L35

@dahlia dahlia added the suggestion label Jul 26, 2019

@dahlia dahlia added this to To do in PyCon Korea 2019 Aug 15, 2019

@ipdae

This comment has been minimized.

Copy link
Member

commented Aug 15, 2019

i'll try this issue.

@longfin longfin moved this from To do to In progress in PyCon Korea 2019 Aug 15, 2019

@dahlia dahlia closed this in #439 Aug 16, 2019

PyCon Korea 2019 automation moved this from In progress to Done Aug 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.