Simplify channel handshake logic to not involve retry #1090
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a follow up on #1066. I have refactored the logic in
do_chan_open_ack_confirm_step
so that it completes the full handshake without having to rely on the error retry loop.The issue of using the same error retry loop for intentional retry is that the delay set in the error retry also affects the intentional retry. For the case of
do_chan_open_finalize_with_retry
, whendo_chan_open_ack_confirm_step
returnsPartialOpenHandshake
, theretry_with_index
function will only try the next handshake step after the delay set in the fibonacci delay timer. This can significantly slow down the relayer if we do too many of such retries.A better strategy is to explicitly write down the expected state transition, especially given that our state machine is pretty small. This also helps improve the readability, as readers do not need to understand the state machine defined else where in order to understand how the code works.
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.