Make parsing generic on accounts - #80
Merged
Merged
Conversation
squadgazzz
reviewed
Jul 23, 2026
squadgazzz
left a comment
Contributor
There was a problem hiding this comment.
Thanks! LGTM, but let me quickly try to adapt it from the indexer side to ensure we don't miss anything else.
squadgazzz
approved these changes
Jul 24, 2026
squadgazzz
left a comment
Contributor
There was a problem hiding this comment.
Tested, should be g2g. cowprotocol/services#4666
Thanks again!
kaze-cow
approved these changes
Jul 29, 2026
kaze-cow
left a comment
Contributor
There was a problem hiding this comment.
amazing to me how this seemingly little change makes such a big difference, but I suppose it makes sense when you consider that the accounts aren't being manipulated at all. We are just rearranging them for parsing purposes. Hopefully this doesn't become an issue later for some unforseen future change would be my only reservation here 😆
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to this comment and discussed here.
This PR makes parsing generic in the account vector. This helps back-end use the parser when
AccountViewisn't available.Motivation
Right now, instruction parsing is done by parsing accounts and data in parallel. Parsing depends on both, in principle there isn't a way to "just parse the data, not the accounts," at least not now. For example, the way the data is parsed could depend on the number of accounts.
The main motivation for Ilya's request is that there's no meaningful way to get an
AccountViewoff-chain, so even if parsing is part of the interface, it can't be relied upon for parsing instruction data. Here we make parsing generic, no moreAccountViewbut some genericA. This works nicely for the program, because the parsing doesn't care about the account type, it just reorganizes the accounts into their specific role. So the back-end should be able to just give it the instruction's account list or whatever type it uses, which the back-end team confirmed to be available at the time they needs to parse the data.How to test
CI. A passing review from someone from the back-end team.