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 batching test #15292

Merged
merged 25 commits into from
Nov 22, 2024
Merged

integration-tests/smoke: add batching test #15292

merged 25 commits into from
Nov 22, 2024

Conversation

makramkd
Copy link
Contributor

@makramkd makramkd commented Nov 18, 2024

Ticket: https://smartcontract-it.atlassian.net/browse/CCIP-4166

Context for CCIP onchain reviewers: We add the Multicall3 contract in tests/helpers so that we can use it to trigger multiple CCIP messages in a single tx in the test. Repo here: https://github.com/mds1/multicall

Requires

N/A

Supports

N/A

deployment/ccip/deploy.go Outdated Show resolved Hide resolved
deployment/ccip/deploy.go Outdated Show resolved Hide resolved
Copy link
Contributor

I see you updated files related to contracts. Please run pnpm changeset in the contracts directory to add a changeset.

@makramkd makramkd changed the title integration-tests/smoke: add batching test [WIP]integration-tests/smoke: add batching test Nov 18, 2024
@makramkd makramkd changed the title [WIP]integration-tests/smoke: add batching test integration-tests/smoke: add batching test Nov 19, 2024
@makramkd makramkd marked this pull request as ready for review November 19, 2024 16:45
@makramkd makramkd requested review from a team as code owners November 19, 2024 16:45
} else {
e.Logger.Infow("router already deployed", "addr", chainState.Router.Address)
}
if mc3 == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to deploy mc3 always? Or should it have some conditional input?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the best way to condition it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We use DeployCCIPContractConfig to tell the deployer whether to deploy or not USDC-related contracts.

if c.USDCConfig.Enabled {

Not sure if it fits your case. Another way would be to deploy multicall explicitly on demand (using a separate function)

ccdeploy.DeployMultiCall(chainId)

integration-tests/smoke/ccip_batching_test.go Outdated Show resolved Hide resolved
deployment/ccip/test_helpers.go Outdated Show resolved Hide resolved
bring down the numMessages to 5 again because exec is exceeding the max
observation size
mateusz-sekara
mateusz-sekara previously approved these changes Nov 21, 2024

i = 0
var execStates []map[uint64]int
outer3:
Copy link
Contributor

Choose a reason for hiding this comment

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

for i < len(sourceChains) {
	select {
	case outputErr := <-execErrs:
		require.NoError(t, outputErr.err)
		execStates = append(execStates, outputErr.output)
		i++
	case <-ctx.Done():
		require.FailNow(t, "didn't get all exec reports before test context was done")
	}
}

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 doesn't work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually that does work, just weirder :D

Copy link
Contributor

Choose a reason for hiding this comment

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

I tested it before writing it :D. I know it works but why is it weirder? I think it's much clearer that way.

wg.Wait()

var i int
outer:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is duplicated 3 times, please add a function that takes the channel as an input

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think having the function here is not as good, there's a ton of vars to take in. Will have to think about how to refactor this to be prettier later

Copy link
Contributor

Choose a reason for hiding this comment

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

It's 3 variables

  • testing.T
  • errs channel
  • sourceChains length

Much better IMO than current.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The chan types are all different unfortunately, there is chan error, chan outputErr[CommitReport] and chan outputErr[map[...]]

} else {
e.Logger.Infow("router already deployed", "addr", chainState.Router.Address)
}
if mc3 == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO need to update this based on deployOpts here https://github.com/smartcontractkit/chainlink/pull/15349/files

Copy link
Contributor

@AnieeG AnieeG left a comment

Choose a reason for hiding this comment

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

LGTM. do you want to wait for the deployOpts ?

RensR
RensR previously approved these changes Nov 22, 2024
Copy link
Contributor

@RensR RensR left a comment

Choose a reason for hiding this comment

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

Approving only the Solidity / gethwrapper part of this PR

@makramkd makramkd added this pull request to the merge queue Nov 22, 2024
Merged via the queue into develop with commit 31bced9 Nov 22, 2024
190 of 191 checks passed
@makramkd makramkd deleted the mk/p1/CCIP-4166 branch November 22, 2024 10:53
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.

8 participants