I just tested it using this SimpleRaffle contract, and the request was fulfilled successfully within a minute.
You should try to increase the value of callbackGasLimit
according to the number of random words/numbers that you're requesting. As you can see from my contract, I've used callbackGasLimit
as 100_000
and numWords
as 1
.
requestId = s_vrfCoordinator.requestRandomWords(
VRFV2PlusClient.RandomWordsRequest({
keyHash: keyHash,
subId: s_subscriptionId,
requestConfirmations: requestConfirmations,
callbackGasLimit: 100_000,
numWords: 1,
extraArgs: VRFV2PlusClient._argsToBytes(
VRFV2PlusClient.ExtraArgsV1({
nativePayment: enableNativePayment
})
)
})
);
You can even get this callbackGasLimit
value by passing it from the function argument, in order to test with different values depending on your use-case. Or, you can do something like:
callbackGasLimit: numberOfRandomWords * 100_000,