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

integration-tests/smoke: add manual exec test #15242

Merged
merged 5 commits into from
Nov 15, 2024
Merged

Conversation

makramkd
Copy link
Contributor

Manually execute the message that failed to execute due to low callback gas. This is the first manual exec scenario, others will be covered in future PRs.

Manually execute the message that failed to execute due to low callback
gas. This is the first manual exec scenario, others will be covered in
future PRs.
Copy link
Contributor

github-actions bot commented Nov 14, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@makramkd makramkd marked this pull request as ready for review November 14, 2024 16:56
@makramkd makramkd requested review from a team as code owners November 14, 2024 16:56
})
}

func sleepAndReplay(t *testing.T, e ccipdeployment.DeployedEnv, sourceChain, destChain uint64) {
func manuallyExecute(
Copy link
Contributor

@AnieeG AnieeG Nov 14, 2024

Choose a reason for hiding this comment

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

is it possible to extract the manual execute logic as a generic function which can be moved to deployment package ?

Copy link
Contributor

@winder winder Nov 14, 2024

Choose a reason for hiding this comment

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

There isn't much to extract beyond the merklemulti utils which are already extracted. We have similar logic in the plugin for exec and commit , unfortunately even there it was difficult to reuse the helper.

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, I want to make this more generic, but there are a few challenges:

  1. Similar to the exec plugin, you need to get the commit report corresponding to a particular message, and then fetch all the messages that made up that root
  2. Once you fetch all the messages, you need to hash them all and construct the tree leaves
  3. Once you get all the tree leaves, you can use merklemulti.NewTree to construct the tree and the proof

This function is overfit to the one message per root case which is why its surprisingly straightforward. The more general case would be more complex. Step (1) in particular is quite bad because the CommitReportAccepted log has nothing that we can use to narrow down the log query, so you have to fetch all the logs and do an in-memory filter (with the absence of something more structured like Atlas databases).

Copy link
Contributor Author

@makramkd makramkd Nov 15, 2024

Choose a reason for hiding this comment

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

I think I'll do this in a follow-up where I'd want to test manual exec for a multi-message root. Will add a comment here to that effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One related thing that I think we should be doing is that our log queries shouldn't just be passing in nil for the FilterOpts (I am doing this right now but it's wrong) and we also shouldn't be replaying from block 1. This makes these tests not really runnable on testnets. I think we'd have to do a sweep on all of these and make sure we catch all the stragglers.

winder
winder previously approved these changes Nov 14, 2024
Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

LGTM

mateusz-sekara
mateusz-sekara previously approved these changes Nov 15, 2024
seqNr uint64,
msgID [32]byte,
) (messageHash [32]byte) {
iter, err := offRamp.FilterExecutionStateChanged(nil,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nil? Shouldn't we pass the test context here?

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 this is super ugly, lemme see what I can do. Also the block ranges are not specified meaning it'll search from genesis. Its OK for these simchains but it won't work on the real testnets

@makramkd makramkd added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@makramkd makramkd added this pull request to the merge queue Nov 15, 2024
@makramkd makramkd removed this pull request from the merge queue due to a manual request Nov 15, 2024
@makramkd makramkd added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@makramkd makramkd added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@makramkd makramkd added this pull request to the merge queue Nov 15, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 15, 2024
* integration-tests/smoke: add manual exec test

Manually execute the message that failed to execute due to low callback
gas. This is the first manual exec scenario, others will be covered in
future PRs.

* fix lint

* updates after PR feedback

* use ctx, fill out filteropts
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@makramkd makramkd added this pull request to the merge queue Nov 15, 2024
Merged via the queue into develop with commit dda65c4 Nov 15, 2024
161 of 162 checks passed
@makramkd makramkd deleted the mk/p1/CCIP-4173 branch November 15, 2024 23:00
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.

6 participants