-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rln-relay): graceful retries on rpc calls #2250
Conversation
You can find the image built from this PR at
Built from 90074c2 |
for the js-waku integration test seems that some peer management test is failing, should be OK on our side |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for it!
Just added a couple of minor comments.
The js-waku
test set has been failing for more than a month so we expect it.
retryWrapper(gasPrice, RetryStrategy.new(), "Failed to get gas price"): | ||
int(await ethRpc.provider.eth_gasPrice()) * 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick. Shall we have a little comment explaining why * 2
?
except CatchableError: | ||
error "failed to get the current block number", error = getCurrentExceptionMsg() | ||
return false | ||
retryWrapper(currentBlock, RetryStrategy.new(), "Failed to get the current block number"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick. I see the RetryStrategy.new()
is always being used. I wonder if we could clean it a little and have it created as a default parameter value.
That applies elsewhere.
retryWrapper(currentBlock, RetryStrategy.new(), "Failed to get the current block number"): | |
retryWrapper(currentBlock, "Failed to get the current block number"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried having it set as default in the template, but templates don't allow that with multiple params afaik
cc: @alrevuelta for a review please :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks.
Description
This PR introduces graceful retries for rpc calls made by the onchain group manager to improve robustness of rln-relay.
Changes
retry_wrapper
that exposes a templateretryWrapper
that accepts a retry strategy, error string and res varTODO:
Issue
closes #2217
closes #2204