TheOneSock
TheOneSock
FFlow
Created by Giovanni S on 9/12/2024 in #🛠│developer-questions
Giovanni S | Flow (2024-09-12)
So I'm going to change your function to f(a,b) which counts the number of valid Flow addresses between a and b , regardless of whether the address has been generated or not. Then you get back exactly to the notion of equidistribution.
hm, I think a bit of information is lost this way.... so going back to f(a,b,N) if you look at the first half of the interval after N addresses have been generated f(0, 2^63 - 1, N) you would expect it to have approximately N/2 addresses. But that is not necessarily true! it could be that the first half of the interval fills up with addresses first. While the distribution of all addresses might be uniform, the distribution of the first N addresses might not be.
20 replies
FFlow
Created by Giovanni S on 9/12/2024 in #🛠│developer-questions
Giovanni S | Flow (2024-09-12)
@tarakby I think I understand what you mean by your answer, but I'm not certain. Addresses on flow are an 8 byte number so they range from 0 to 2^64 - 1. Lets say I have a function f(a,b,N) which returns the number of generated addresses on the interval between 0 <= a <= 2^64 - 1 and 0 <= b <= 2^64 - 1 after 0 < N <= 2^45 addresses have been generated in total. Can I assume that if b-a = d-c and N is large that f(a,b,N) ≈ f(c,d,N)? I think if that is true, this should also hold right: (b-a)/(2^64 - 1) ≈ f(a,b,N)/N Wouldn't that constitute a uniform distribution?
20 replies
FFlow
Created by Giovanni S on 9/12/2024 in #🛠│developer-questions
Giovanni S | Flow (2024-09-12)
UUiDs for resources are sequential uint64s, with the caveat that some of the bytes in those uint64 are used for partitions (for future paralell execution). very roughly that means that in a block with 3 transactions they will generate UUIDs like this: TX1: 7000...00023, 7000...00024, 7000...00025 TX2: 8000...00047, 8000...00048, 8000...00049 TX3: 9000...00019, 9000...00020, 9000...00021 That is for the global UUIDs used resources. For Capabilities you have account local UUID indexes which are sequential and start at 0 for each account. DISCLAIMER!!!! This is an internal detail of the FVM and no guarantee is given that this logic will stay the same. Do not rely on the fact that UUIDs are generated sequentially, because doing so might mean that that code will break.
20 replies