From 61f7bae4a97366419606bf866c39f489fa81eeef Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Mon, 13 May 2024 17:35:23 -0600 Subject: [PATCH] fix(gar): modify random to use unbounded and convert to 32 bit signed integer --- contract/src/gar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract/src/gar.lua b/contract/src/gar.lua index a92f6ee0..76b8dddc 100644 --- a/contract/src/gar.lua +++ b/contract/src/gar.lua @@ -105,7 +105,7 @@ function gar.getPrescribedObserversForEpoch(epochStartTimestamp, epochEndTimesta local hash = timestampEntropyHash while #prescribedObserversAddresses < gar.settings.observers.maxObserversPerEpoch do local hashString = crypto.utils.array.toString(hash) - local random = crypto.random(0, 1, hashString) + local random = crypto.random(nil, nil, hashString) / 0xffffffff local cumulativeNormalizedCompositeWeight = 0 -- use ipairs as filtered observers is an array for _, observer in ipairs(filteredObservers) do