hard-coding gasPrice to avoid unexpected crashes due wrong gas price estimations

This commit is contained in:
Ivan Folgueira Bande 2025-11-05 17:12:59 +01:00
parent 3dd3d01493
commit 0014c75ea2
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7

View File

@ -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