Skip to content

Conversation

@buffalojoec
Copy link
Contributor

@buffalojoec buffalojoec commented Apr 1, 2024

This PR adds the Core BPF implementation of the Config program.

I think in general it makes sense to reduce dependency on the config program crate in the monorepo, so I've omitted the following for now:

  • create_config_account (helper)
  • impl ConfigState for StakeConfig

If that makes sense I'll look into refactoring over there.

Closes #2

@kevinheavey
Copy link
Contributor

kevinheavey commented Apr 2, 2024

Re leaving create_config_account in the original config program crate, will that mean keeping the solana-config-program dependency in solana-account-decoder (this discussion) or is there some other plan for that?

@buffalojoec
Copy link
Contributor Author

Re leaving create_config_account in the original config program crate, will that mean keeping the solana-config-program dependency in solana-account-decoder (this discussion) or is there some other plan for that?

Actually I was looking at refactoring config program out of the monorepo altogether, if possible. Wherever not possible, I think we can generate a client here and use just the client to supply account-decoder with the handlers it needs.

I think what might be best is to just move get_config_data and create_config_account into the client only, and not in the program anywhere. Wdyt?

@kevinheavey
Copy link
Contributor

Wherever not possible, I think we can generate a client here and use just the client to supply account-decoder with the handlers it needs.

I don't think Kinobi generates any of what account-decoder needs for the config program: anza-xyz/agave#265 (comment)

So it will just be a matter of cut+paste from programs/config into the new client crate.

I think what might be best is to just move get_config_data and create_config_account into the client only, and not in the program anywhere. Wdyt?

Client seems like the right place to put them!

@buffalojoec
Copy link
Contributor Author

I don't think Kinobi generates any of what account-decoder needs for the config program

You don't need to only rely on generated code for a generated client. There's code you can put client-side only.

@kevinheavey
Copy link
Contributor

Oh sure I just meant that the generated code isn't anything to do with what account-decoder needs

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Great work! Mostly comments on the tests, but the program is perfect.

@buffalojoec buffalojoec changed the title Core BPF: Config Core BPF impl: Config Apr 3, 2024
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

One more program conversion for the books, great job!

config

@buffalojoec buffalojoec merged commit 5e92fe5 into main Apr 4, 2024
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.

PR the initial Core BPF implementation for review

4 participants