From 0014c75ea2c718fa7b12521f7ab71c471400ab0b Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Wed, 5 Nov 2025 17:12:59 +0100 Subject: [PATCH] hard-coding gasPrice to avoid unexpected crashes due wrong gas price estimations --- .../group_manager/on_chain/group_manager.nim | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim b/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim index 942ac724e..2744394e0 100644 --- a/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim +++ b/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim @@ -239,14 +239,15 @@ method register*( let wakuRlnContract = g.wakuRlnContract.get() debug "AAAAA register called" - var gasPrice: int - g.retryWrapper(gasPrice, "Failed to get gas price"): - debug "AAAAA register called before calling eth_gasPrice" - let gasPriceValue = await ethRpc.provider.eth_gasPrice() - debug "AAAAA register called", gasPriceValue = gasPriceValue - let doubleGasPriceValue: int = gasPriceValue.int * 2 - debug "AAAAA register called", doubleGasPriceValue - int(gasPriceValue) * 2 + ## Bypassing this because it generates a crash after 32 iterations/calls + # var gasPrice: int + # g.retryWrapper(gasPrice, "Failed to get gas price"): + # debug "AAAAA register called before calling eth_gasPrice" + # let gasPriceValue = await ethRpc.provider.eth_gasPrice() + # debug "AAAAA register called", gasPriceValue = gasPriceValue + # let doubleGasPriceValue: int = gasPriceValue.int * 2 + # debug "AAAAA register called", doubleGasPriceValue + # int(gasPriceValue) * 2 debug "AAAAA register called" let idCommitmentHex = identityCredential.idCommitment.inHex() @@ -265,7 +266,7 @@ method register*( g.retryWrapper(txHash, "Failed to register the member"): await wakuRlnContract .register(idCommitment, userMessageLimit.stuint(32), idCommitmentsToErase) - .send(gasPrice = gasPrice) + .send(gasPrice = 1) debug "AAAAA register called" # wait for the transaction to be mined