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

fix: ibc clients creation stuck #639

Merged
merged 13 commits into from
Dec 17, 2023
Merged

Conversation

omritoptix
Copy link
Collaborator

@omritoptix omritoptix commented Dec 16, 2023

This PR improves substantially the channel creation.
Channel creation is now done < 3 mins.

It removes unnecessary code which used the old assumption of the forked ibc and changed the chain block production to use send fund commands from sequencer to itself vs update-client which would introduce problems such as account sequence mismatch and header heights coordination between received ibc packet header and already existing ibc header sent using the update command.

PR Standards

Opening a pull request should be able to meet the following requirements


For Author:

  • Targeted PR against correct branch
  • included the correct type prefix in the PR title
  • Linked to Github issue with discussion and accepted design
  • Targets only one github issue
  • Wrote unit and integration tests
  • All CI checks have passed
  • Added relevant godoc comments

For Reviewer:

  • confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • confirmed all author checklist items have been addressed

After reviewer approval:

  • In case targets main branch, PR should be squashed and merged.
  • In case PR targets a release branch, PR should be rebased.

@omritoptix omritoptix requested a review from a team as a code owner December 16, 2023 12:27
@omritoptix omritoptix linked an issue Dec 16, 2023 that may be closed by this pull request
@@ -69,64 +112,49 @@ func (r *Relayer) CreateIBCChannel(override bool, logFileOption utils.CommandOpt
}, nil
}

// waitForValidRollappHeight waits for the rollapp height to be greater than 2 otherwise
Copy link
Contributor

Choose a reason for hiding this comment

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

Waiting for the rollapp height on the hub to be greater than initial height not needed anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no. because we open a connection optimistically so only the rollapp height is important.

@@ -34,15 +44,48 @@ func (r *Relayer) CreateIBCChannel(override bool, logFileOption utils.CommandOpt
return ConnectionChannels{}, err
}

// We always pass override otherwise this commands hangs if there are too many clients
Copy link
Contributor

Choose a reason for hiding this comment

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

what the difference with previous version?
it worked without hanging, and without override=true

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it did only if you run it against local hub without thousands of ibc clients. if you run it against froopyland it hangs. the difference i the data on the hub which makes this command hangs as it searches first to see if an ibc client already exists on the hub and when it needs to iterates thousands of clients and consensus states it takes forever.

time.Sleep(10 * time.Second)

connectionID, _ := r.GetActiveConnection()
if connectionID == "" || override {
Copy link
Contributor

Choose a reason for hiding this comment

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

if u set override=true in the createClients, this check is wrong.
if creating new client, u will must to create new connection as well

if !override {
// Check if clients exist
clientsExist, err = r.CheckClientsExist()
if err != nil {
Copy link
Contributor

@mtsitrin mtsitrin Dec 17, 2023

Choose a reason for hiding this comment

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

ignore err as u don't won't to return here

}
clientIDRollapp_raw, err := roller_utils.GetNestedValue(rlyCfg, []string{"paths", consts.DefaultRelayerPath, "dst", "client-id"})
if err != nil {
return false, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

better to return the err, and ignore it by the caller
keep same standard as in GetActiveConnection

…'re using now optimistic creation so not necessary.
@omritoptix omritoptix merged commit ff3983a into main Dec 17, 2023
3 checks passed
@omritoptix omritoptix deleted the omritoptix/637-clients-creation-stuck branch December 17, 2023 22:16
omritoptix added a commit that referenced this pull request Dec 17, 2023
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.

roller stuck on creating clients
2 participants