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

feat!(sidecar): add start check callback with rollkit example #1118

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gjermundgaraba
Copy link
Contributor

I don't know what the best way to deal with dependencies between sidecars and chains, but since I used Celestia as a sidecar for the Rollkit example it needed some time to wait for the sidecar to start up before starting the chain itself.

Putting this here for discussion.

@gjermundgaraba gjermundgaraba requested a review from a team as a code owner May 8, 2024 17:51
@gjermundgaraba gjermundgaraba requested a review from agouin May 8, 2024 17:51
Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
interchaintest-docs ⬜️ Ignored (Inspect) Visit Preview May 15, 2024 10:03am

@gjermundgaraba gjermundgaraba marked this pull request as draft May 8, 2024 17:51
@Reecepbcups Reecepbcups self-requested a review May 8, 2024 17:52
@Reecepbcups Reecepbcups changed the title Added start check callback for sidecars with rollkit example feat: add start check callback for sidecars with rollkit example May 9, 2024
ChainID: "gm",
Images: []ibc.DockerImage{
{
Repository: "ghcr.io/gjermundgaraba/gm",
Copy link
Member

@Reecepbcups Reecepbcups May 10, 2024

Choose a reason for hiding this comment

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

Is this just the standard https://github.com/rollkit/gm or are there changes made to work with this?

Ref https://github.com/rollchains/tiablob/blob/main/interchaintest/setup_celestia.go as well vs using a combined instance. I should probably get this moved here and help clean up some setup

Copy link
Contributor Author

@gjermundgaraba gjermundgaraba May 10, 2024

Choose a reason for hiding this comment

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

Just standard, but there is no updated docker builds (and the main branch is outdated) so I just took the tutorial-local-da branch and built a docker image of that

@@ -256,6 +256,7 @@ type SidecarConfig struct {
StartCmd []string
Env []string
PreStart bool
StartCheck func(int) error
Copy link
Member

Choose a reason for hiding this comment

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

This is a good addition

NoHostMount: false,
SkipGenTx: false,
PreGenesis: nil,
ModifyGenesis: func(config ibc.ChainConfig, bytes []byte) ([]byte, error) {
Copy link
Member

@Reecepbcups Reecepbcups May 10, 2024

Choose a reason for hiding this comment

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

Ahh I see now. Ideally we would abstract this away and have a RollKit section which does this but does not have the user be informed of all the setup complexities. Everything here looks reasonable imo

great work!

I need to think on it for how we can handle. Maybe a IsRollkitChain: true (or if we can somehow figure this out without user interaction, i.e. something within the filesystem or part of the main binary cobra)

then this would all run after modify genesis with a celestia-da

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it would be great to automagically sort this somehow without all the manual stuff for sure :)

@Reecepbcups Reecepbcups changed the title feat: add start check callback for sidecars with rollkit example feat!(sidecar): add start check callback with rollkit example May 10, 2024
StartCmd: []string{"/bin/bash", "/opt/entrypoint.sh"},
Env: nil, // Here we could set CELESTIA_NAMESPACE if needed
PreStart: true,
StartCheck: func(index int) error {
Copy link
Member

@Reecepbcups Reecepbcups May 10, 2024

Choose a reason for hiding this comment

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

note to self: Maybe to be more inline with #1123, we rename this to PostStart() on the sidecar process. Just so it more closely matches that PRs API conventions and also is more versatile vs just a standard check.

Does not seem the index here is used? Could put the CosmosChain here or something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That naming makes sense.

Yeah, the idea was originally to send in the SidecarProcess but that gets to a cyclical dependency so ended up with an index and then in the end didn't use it.

In the code below I just do Sidecars[0], but I guess the idea was to access the right one. But I suppose I would always know the order they are added (being the same as the SidecarConfigs slice order). So could send in the chain like you said instead.

@Reecepbcups
Copy link
Member

Hey, we have still not decided on a priority level for this PR. It is something we want to get in, but have to juggle with other priorities right now as well.

Review / impl time is still unknown

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.

2 participants