-
Notifications
You must be signed in to change notification settings - Fork 105
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: evm chain param validation #1264
Conversation
return nil | ||
} | ||
} | ||
|
||
if err := validateBytes(m.GatewayCode); err != nil { |
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.
Validate bytecode first
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.
Why? what bug does this fix?
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.
On devnet, I used the old bytecode params and it doesn't include absorber
. So add-chain
succeeded, but VoteConfirmChainRequest
fails when setting the param set. add-chain
should also validate the bytecode properly.
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 bug is that if the network is found in the networks list, we return nil
right away instead of validating the bytecode.
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.
ok then the fix should be that if the network isn't in the list, return an error, otherwise continue instead of return. Simply reordering would leave the problem there when someone wants to add more validation.
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.
Sure, I prefer that anyways. Still getting used to the preferred coding style here lol
return nil | ||
} | ||
} | ||
|
||
if err := validateBytes(m.GatewayCode); err != nil { |
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.
ok then the fix should be that if the network isn't in the list, return an error, otherwise continue instead of return. Simply reordering would leave the problem there when someone wants to add more validation.
Description
Todos
Steps to Test
Expected Behaviour
Other Notes