Skip to content

Commit

Permalink
skip validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Nov 22, 2023
1 parent edd5063 commit f8ef5be
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/scripts/ccip/ccip-send/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package ccip_send
15 changes: 11 additions & 4 deletions integration-tests/actions/ccip_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,7 @@ type CCIPLane struct {
SrcNetworkLaneCfg *laneconfig.LaneConfig
DstNetworkLaneCfg *laneconfig.LaneConfig
Subscriptions []event.Subscription
SkipValidation bool
}

func (lane *CCIPLane) UpdateLaneConfig() {
Expand Down Expand Up @@ -1604,6 +1605,10 @@ func (lane *CCIPLane) ValidateRequests() {
}

func (lane *CCIPLane) ValidateRequestByTxHash(txHash string, txConfirmattion time.Time, reqNo int64) error {
if lane.SkipValidation {
lane.Logger.Info().Msg("Skipping validation")
return nil
}
msgLog, ccipSendReqGenAt, err := lane.Source.AssertEventCCIPSendRequested(
lane.Logger, reqNo, txHash, lane.ValidationTimeout, txConfirmattion, lane.Reports)
if err != nil || msgLog == nil {
Expand Down Expand Up @@ -1795,10 +1800,12 @@ func (lane *CCIPLane) DeployNewCCIPLane(
}
lane.UpdateLaneConfig()

// start event watchers
err = lane.StartEventWatchers()
if err != nil {
return errors.WithStack(err)
if !lane.SkipValidation {
// start event watchers
err = lane.StartEventWatchers()
if err != nil {
return errors.WithStack(err)
}
}
// if lane is being set up for already configured CL nodes and contracts
// no further action is necessary
Expand Down
21 changes: 21 additions & 0 deletions integration-tests/ccip-tests/testconfig/override/test-config.env

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions integration-tests/load/ccip_loadgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.CallResult {
NoOfTokensSent: len(msg.TokenAmounts),
MessageBytesLength: len(msg.Data),
})
// if skip validation is true, return
if c.Lane.SkipValidation {
res.Failed = false
return res
}
// wait for
// - CCIPSendRequested Event log to be generated,
msgLog, sourceLogTime, err := c.Lane.Source.AssertEventCCIPSendRequested(
Expand Down
11 changes: 11 additions & 0 deletions integration-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type CCIPTestConfig struct {
MsgType string
PhaseTimeout time.Duration
TestDuration time.Duration
SkipEventValidation bool
LocalCluster bool
ExistingDeployment bool
ExistingEnv string
Expand Down Expand Up @@ -393,6 +394,16 @@ func NewCCIPTestConfig(t *testing.T, lggr zerolog.Logger, tType string) *CCIPTes
}
}

skip, _ := utils.GetEnv("CCIP_SKIP_VALIDATION")
if skip != "" {
e, err := strconv.ParseBool(skip)
if err != nil {
allError = multierr.Append(allError, err)
} else {
p.SkipEventValidation = e
}
}

local, _ := utils.GetEnv("CCIP_DEPLOY_ON_LOCAL")
if local != "" {
e, err := strconv.ParseBool(local)
Expand Down

0 comments on commit f8ef5be

Please sign in to comment.