-
Notifications
You must be signed in to change notification settings - Fork 54
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 message hasher and tests #1169
Conversation
LCOV of commit
|
@@ -149,5 +125,27 @@ func (h *MessageHasherV1) abiEncode(method string, values ...interface{}) ([]byt | |||
return res[4:], nil | |||
} | |||
|
|||
func decodeExtraArgs(extraArgs []byte) (gasLimit *big.Int, err error) { | |||
var method string | |||
if bytes.Equal(extraArgs[:4], evmExtraArgsV1Tag) { |
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.
suggestion: once we support more chains, might be easier to just create a map bytes -> string
and just lookup the value. We could maintain that constants file in the same file as we would do chain selector family lookups
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.
Yeah, thats a good point. I think there's quite a bit of room for improvement in terms of code organization (and possibly these interfaces) after we get the basic functionality working.
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 order of operations for parsing the extra args would be something like:
- Look up the chain family for the source chain and dest chain selectors
- Decode the extra args with the chain-family specific extra args decoder, return the decoded values for the dest chain
- Within each extra args decoder, you'd have some kind of table, for EVM we'd have a table of valid tags, for others we'd probably want to follow a similar pattern.
Motivation
Fix the message hasher EVM implementation after the chainlink-common and chainlink-ccip bumps which alter the
Message
type.Solution