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

Ccip-2578 - Enable slow and fast chain #1122

Merged
merged 13 commits into from
Jul 4, 2024
Merged

Conversation

AnieeG
Copy link
Contributor

@AnieeG AnieeG commented Jun 30, 2024

Motivation

Memory consumption issues when log finalization takes long.
Enabling slow and fast chain to execute in single test.
Deterministic lane creation logic.

Solution

  1. Stop storing successful Tx and CCIPSendReq Phase data in request status if the phases are successful. This will not create unnecessary phase status in memory when SendRequested Log finalization takes time to complete.

  2. To enable fast and slow chain, provide the network details for fast and slow chain in test config. If you want to run all but 3 chains as fast network, you need to provide fast network details in 1st index of test config's selected_network and rest of the network as slow config, so that when you provide NoOfNetworks to be greater than provided network number in selected_network, the test can then replicate 1st network config( except chain id) to create rest of the networks ( NoOfNetworks- len(selected_network).
    For example -
    If you want to run with 3 slow chains and 5 fast chains, provide network details in this order -

selected_network - [fast chain, slow chain, slow chain, slow chain]
NoOfNetworks - 8

In this way the test will find config for 4 networks and the rest 4 network will be created by replicating 1st network.

  1. To address non-deterministic lane creation logic - Got rid of the random shuffling on network pair array. Just selected the first MaxNoOfLanes from the network pair.

@AnieeG AnieeG requested review from jasonmci and a team as code owners June 30, 2024 22:11
@AnieeG AnieeG marked this pull request as draft July 1, 2024 17:17
@AnieeG AnieeG marked this pull request as ready for review July 2, 2024 23:54
@@ -77,19 +77,17 @@ func (stat *RequestStat) UpdateState(
step Phase,
duration time.Duration,
state Status,
sendTransactionStats ...TransactionStats,
sendTransactionStats *TransactionStats,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I find naming the argument as optional can help clarify things in cases like this.

Suggested change
sendTransactionStats *TransactionStats,
optionalSendTransactionStats *TransactionStats,

MessageBytesLength: int64(len(msg.Msg.Data)),
})
for _, stat := range rValues.Stats {
stat.UpdateState(&lggr, 0, testreporters.TX, startTime.Sub(txConfirmationTime), testreporters.Success, nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why remove the stats here? Are they no longer important in this context?

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 am storing this stats in SourceLogFinalized step
This is to avoid unnecessary streaming to loki and hoarding data in memory. Otherwise if there is significant load and the msg takes 30-40 min in getting finalized, the memory usage increases due to storing this stats in TX, and CCIPSendReq step. If request fails in TX, and CCIPSendReq step we store the stats, but if it passes these two steps, we just store the relevant data in SourceLogFinalized step to avoid duplication

NoOfTokensSent: sendRequestedEvent.NoOfTokens,
MessageBytesLength: int64(sendRequestedEvent.DataLength),
})
reqStat[i].UpdateState(lggr, seqNum, testreporters.CCIPSendRe, 0, testreporters.Success, nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the stat no longer useful here? Or never was?

txConfirmationTime := time.Now().UTC()
// wait for the tx to be mined, timeout is set to 10 minutes
lggr.Info().Str("tx", sendTx.Hash().Hex()).Msg("waiting for tx to be mined")
ctx, cancel := context.WithTimeout(context.Background(), sourceCCIP.Common.ChainClient.GetNetworkConfig().Timeout.Duration)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed all of this as we are not capturing how long does it take to confirm a tx. This is a generic chain behavior and can be omitted from validating CCIP specific outcomes.

Copy link
Collaborator

@b-gopalswami b-gopalswami left a comment

Choose a reason for hiding this comment

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

LGTM!

@AnieeG AnieeG enabled auto-merge (squash) July 4, 2024 01:10
@AnieeG AnieeG merged commit 2cd83fb into ccip-develop Jul 4, 2024
56 checks passed
@AnieeG AnieeG deleted the ccip-2578-tier-b branch July 4, 2024 01:11
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.

3 participants