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.
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
refactor: update cctx status to object to split error message into
error
andrevert_error
#3326base: develop
Are you sure you want to change the base?
refactor: update cctx status to object to split error message into
error
andrevert_error
#3326Changes from 14 commits
dd6aa99
7380d27
66170ae
542b448
9e20402
889a815
1948197
5af3f2c
3a26b7e
2ed02a9
acf9793
a72b3ef
2fb8d5d
2045d3d
afe7be1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This struct is only used internally, and not saved to the state.
In my opinion, the code looks cleaner using this object rather than three strings as arguments. But it can be changed to that if needed
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.
If it's used internally we don't need a proto definition and it can be an internal type
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.
Defined this at the proto level as we we can refactor the Status object in the future to use this directly instead of defining three fields .
I wanted to get reviews on this pr before creating an issue.
I can refactor to defining a type, though, if its still needed
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.
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.
Makes sense to use universal contract ,
But I would rather structure it so that outbound failed comes first , to make sure its a special case of outbound failed as mentioned int he document
outbound failed but the universal contract did not revert
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.
Let's be accurate
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 did not specifically use
HandleEVMDeposit
here as this error message might be used by people not familiar with the protocol , andEvmDeposit
might be easier to understandThere 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.
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.
Similar to the comment above , I am planning to use
outbound failed
as the prefix for all outbound failed messages , so that the wording is consistent.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.
This is the failure of the revert, not the outbound
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.
The revert is never created for this particular flow , I think adding a ErrMessageRevert would be confusing since this flow has only 1 outbound params
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.
Part of #3194 was also to simplify some of the error message which can be too long, we should check if some processing is need in
errorMsg
to simplify and gives a standardized messageThere 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.
Yes, I checked on this, and the feedback was that all the fields are required.
The pr adds some more details to each error , and also splits into outbound and revert error , which would be helpful for anyone trying to debug .
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.
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.
Happy to make this change,
But the reason for keeping this minimal is to have a simple status that anyone can read and understand what happened
"The fact the revert was happening on Zeatchaincan be figured out easily by looking at the outbound params.`
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.
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.
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.
This is a status message, error message should contains why it failed
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 agree, however, the
why
is not available to us right now.I thought of adding
Observers voted this outbound as failed
but I think that information would be confusing .We can in the future , add a field for observers to add a message as to why they are voting this tx as failed . I can create an issue for that if needed
Check warning on line 379 in x/crosschain/keeper/cctx_orchestrator_validate_outbound.go
Codecov / codecov/patch
x/crosschain/keeper/cctx_orchestrator_validate_outbound.go#L376-L379
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.
Check warning on line 399 in x/crosschain/keeper/cctx_orchestrator_validate_outbound.go
Codecov / codecov/patch
x/crosschain/keeper/cctx_orchestrator_validate_outbound.go#L397-L399
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.
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.
This is the status message,
ErrorMessageRevert
should give reason why revert failedThere 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.
Same comment as above , resolving this to continue discussion there
Check warning on line 415 in x/crosschain/keeper/cctx_orchestrator_validate_outbound.go
Codecov / codecov/patch
x/crosschain/keeper/cctx_orchestrator_validate_outbound.go#L412-L415
Check warning on line 51 in x/crosschain/keeper/evm_deposit.go
Codecov / codecov/patch
x/crosschain/keeper/evm_deposit.go#L51
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.
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 choose to use initiate , as that's the function called right after this line