Skip to content

Make parsing generic on accounts - #80

Merged
fedgiac merged 2 commits into
mainfrom
make-parsing-generic-on-accounts
Jul 29, 2026
Merged

Make parsing generic on accounts#80
fedgiac merged 2 commits into
mainfrom
make-parsing-generic-on-accounts

Conversation

@fedgiac

@fedgiac fedgiac commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Related to this comment and discussed here.

This PR makes parsing generic in the account vector. This helps back-end use the parser when AccountView isn'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 AccountView off-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 more AccountView but some generic A. 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.

@fedgiac
fedgiac requested a review from a team as a code owner July 23, 2026 15:38
@fedgiac
fedgiac requested a review from squadgazzz July 23, 2026 15:38

@squadgazzz squadgazzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM, but let me quickly try to adapt it from the indexer side to ensure we don't miss anything else.

@squadgazzz squadgazzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, should be g2g. cowprotocol/services#4666
Thanks again!

@kaze-cow kaze-cow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😆

@fedgiac
fedgiac merged commit 77f10c7 into main Jul 29, 2026
12 checks passed
@fedgiac
fedgiac deleted the make-parsing-generic-on-accounts branch July 29, 2026 08:32
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 this pull request may close these issues.

3 participants