Skip to content
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

zetacore : Invalid address fields may be truncated and processed in error #2696

Open
kingpinXD opened this issue Aug 13, 2024 · 3 comments
Open

Comments

@kingpinXD
Copy link
Contributor

image

@kingpinXD
Copy link
Contributor Author

The three messages
MsgUpdateSystemContract : We can modify the validate basic to add the required validation
MsgWhitelistErc20 : We can modify the validate basic to add the required validation
MsgVoteInbound: This is more complicated as rejecting outright in the validate basic might be too harsh , for the end user as this does not give up any opportunity to refund back to the sender address .

@kingpinXD
Copy link
Contributor Author

With regards to evm_deposit , I am considering validating the receiver address based on coin-type,

https://github.com/zeta-chain/zeta-node/blob/8da507f0cdfb5affbc5121a712670fbd1feaab11/x/crosschain/types/cctx.go#L175-L218

Which can be called at the beginning of the function HandleEvmDeposit
https://github.com/zeta-chain/zeta-node/blob/8da507f0cdfb5affbc5121a712670fbd1feaab11/x/crosschain/keeper/evm_deposit.go#L27-L30

This Validate is for ZEVM gateway only, and I considered placing this validation in the validate_inbound.go as well
https://github.com/zeta-chain/zeta-node/blob/8da507f0cdfb5affbc5121a712670fbd1feaab11/x/crosschain/keeper/cctx_orchestrator_validate_inbound.go#L14-L57
And use gateway+cointype for conditions.
This would have made more logical sense; however, due to the current structure of the code, this would not allow us to create a revert back to the sender address.

@kingpinXD
Copy link
Contributor Author

Draft pr for reference #2707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant