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

node: ensure payload serialisation code doesn't panic #3897

Closed
kcsongor opened this issue Apr 23, 2024 · 0 comments · Fixed by #3898
Closed

node: ensure payload serialisation code doesn't panic #3897

kcsongor opened this issue Apr 23, 2024 · 0 comments · Fixed by #3898
Assignees

Comments

@kcsongor
Copy link
Contributor

kcsongor commented Apr 23, 2024

The VAA payload serialisation functions are called in the admin server during governance VAA injection. Ideally these functions should not panic (and instead propagate error values) so in case of malformed input, the admin server doesn't crash.
Most functions follow this principle, with a couple of exceptions:

if module != IbcReceiverModuleStr && module != IbcTranslatorModuleStr {
panic("module for BodyIbcUpdateChannelChain must be either IbcReceiver or IbcTranslator")
}

and the functions that call LefPad

if length < 0 {
panic("cannot prepend bytes to a negative length buffer")
}
if len(payload) > length {
panic(fmt.Sprintf("payload longer than %d bytes", length))
}

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.

2 participants