diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index 67dd80d7a9..ff318a26ef 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -2246,7 +2246,7 @@ func (destCCIP *DestCCIPModule) AssertNoExecutionStateChangedEventReceived( destCCIP.ExecStateChangedWatcher.Range(func(_, value any) bool { e, exists := value.(*contracts.EVM2EVMOffRampExecutionStateChanged) if exists { - vLogs := e.Raw + vLogs := e.LogInfo hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(ctx, big.NewInt(int64(vLogs.BlockNumber))) if err != nil { return true @@ -2292,7 +2292,7 @@ func (destCCIP *DestCCIPModule) AssertEventExecutionStateChanged( if exists { // if the value is processed, delete it from the map destCCIP.ExecStateChangedWatcher.Delete(seqNum) - vLogs := e.Raw + vLogs := e.LogInfo receivedAt := time.Now().UTC() hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(context.Background(), big.NewInt(int64(vLogs.BlockNumber))) if err == nil { @@ -2367,7 +2367,7 @@ func (destCCIP *DestCCIPModule) AssertEventReportAccepted( // if the value is processed, delete it from the map destCCIP.ReportAcceptedWatcher.Delete(seqNum) receivedAt := time.Now().UTC() - hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(context.Background(), big.NewInt(int64(reportAccepted.Raw.BlockNumber))) + hdr, err := destCCIP.Common.ChainClient.HeaderByNumber(context.Background(), big.NewInt(int64(reportAccepted.LogInfo.BlockNumber))) if err == nil { receivedAt = hdr.Timestamp } @@ -2386,7 +2386,7 @@ func (destCCIP *DestCCIPModule) AssertEventReportAccepted( Msg("ReportAccepted event received before finalized timestamp") totalTime = time.Second } - receipt, err := destCCIP.Common.ChainClient.GetTxReceipt(reportAccepted.Raw.TxHash) + receipt, err := destCCIP.Common.ChainClient.GetTxReceipt(reportAccepted.LogInfo.TxHash) if err != nil { lggr.Warn().Msg("Failed to get receipt for ReportAccepted event") } @@ -2397,7 +2397,7 @@ func (destCCIP *DestCCIPModule) AssertEventReportAccepted( reqStat.UpdateState(lggr, seqNum, testreporters.Commit, totalTime, testreporters.Success, &testreporters.TransactionStats{ GasUsed: gasUsed, - TxHash: reportAccepted.Raw.TxHash.String(), + TxHash: reportAccepted.LogInfo.TxHash.Hex(), CommitRoot: fmt.Sprintf("%x", reportAccepted.MerkleRoot), }) return reportAccepted, receivedAt, nil @@ -2462,7 +2462,7 @@ func (destCCIP *DestCCIPModule) AssertReportBlessed( value, ok = destCCIP.ReportBlessedBySeqNum.Load(seqNum) } if ok && value != nil { - vLogs, exists := value.(*types.Log) + vLogs, exists := value.(*contracts.LogInfo) if exists { // if the root is found, set the value for all the sequence numbers in the interval and delete the root from the map if foundAsRoot { @@ -3337,8 +3337,11 @@ func (lane *CCIPLane) StartEventWatchers() error { SequenceNumber: e.Message.SequenceNumber, DataLength: len(e.Message.Data), NoOfTokens: len(e.Message.TokenAmounts), - Raw: e.Raw, - Fee: e.Message.FeeTokenAmount, + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, + Fee: e.Message.FeeTokenAmount, })) } else { lane.Source.CCIPSendRequestedWatcher.Store(e.Raw.TxHash.Hex(), []*contracts.SendReqEventData{ @@ -3347,8 +3350,11 @@ func (lane *CCIPLane) StartEventWatchers() error { SequenceNumber: e.Message.SequenceNumber, DataLength: len(e.Message.Data), NoOfTokens: len(e.Message.TokenAmounts), - Raw: e.Raw, - Fee: e.Message.FeeTokenAmount, + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, + Fee: e.Message.FeeTokenAmount, }, }) } @@ -3382,7 +3388,10 @@ func (lane *CCIPLane) StartEventWatchers() error { Min: e.Report.Interval.Min, Max: e.Report.Interval.Max, MerkleRoot: e.Report.MerkleRoot, - Raw: e.Raw, + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, }) } lane.Dest.ReportAcceptedWatcher = testutils.DeleteNilEntriesFromMap(lane.Dest.ReportAcceptedWatcher) @@ -3411,7 +3420,10 @@ func (lane *CCIPLane) StartEventWatchers() error { case e := <-reportBlessedEvent: lane.Logger.Info().Msgf("TaggedRootBlessed event received for root %x", e.TaggedRoot.Root) if e.TaggedRoot.CommitStore == lane.Dest.CommitStore.EthAddress { - lane.Dest.ReportBlessedWatcher.Store(e.TaggedRoot.Root, &e.Raw) + lane.Dest.ReportBlessedWatcher.Store(e.TaggedRoot.Root, &contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }) } lane.Dest.ReportBlessedWatcher = testutils.DeleteNilEntriesFromMap(lane.Dest.ReportBlessedWatcher) case <-lane.Context.Done(): @@ -3443,7 +3455,10 @@ func (lane *CCIPLane) StartEventWatchers() error { MessageId: e.MessageId, State: e.State, ReturnData: e.ReturnData, - Raw: e.Raw, + LogInfo: contracts.LogInfo{ + BlockNumber: e.Raw.BlockNumber, + TxHash: e.Raw.TxHash, + }, }) lane.Dest.ExecStateChangedWatcher = testutils.DeleteNilEntriesFromMap(lane.Dest.ExecStateChangedWatcher) case <-lane.Context.Done(): diff --git a/integration-tests/ccip-tests/contracts/contract_models.go b/integration-tests/ccip-tests/contracts/contract_models.go index 7ab92a673c..efbe1bbf62 100644 --- a/integration-tests/ccip-tests/contracts/contract_models.go +++ b/integration-tests/ccip-tests/contracts/contract_models.go @@ -48,6 +48,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ) +type LogInfo struct { + BlockNumber uint64 + TxHash common.Hash +} + // Name denotes a contract name type Name string @@ -955,7 +960,7 @@ type CommitStoreReportAccepted struct { Min uint64 Max uint64 MerkleRoot [32]byte - Raw types.Log + LogInfo LogInfo } type CommitStoreWrapper struct { @@ -1496,7 +1501,7 @@ type SendReqEventData struct { SequenceNumber uint64 DataLength int NoOfTokens int - Raw types.Log + LogInfo LogInfo Fee *big.Int } @@ -2151,7 +2156,7 @@ type EVM2EVMOffRampExecutionStateChanged struct { MessageId [32]byte State uint8 ReturnData []byte - Raw types.Log + LogInfo LogInfo } type MockAggregator struct { diff --git a/integration-tests/ccip-tests/load/ccip_loadgen.go b/integration-tests/ccip-tests/load/ccip_loadgen.go index e02f118095..1a002af14b 100644 --- a/integration-tests/ccip-tests/load/ccip_loadgen.go +++ b/integration-tests/ccip-tests/load/ccip_loadgen.go @@ -268,7 +268,6 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response { } txConfirmationTime := time.Now().UTC() - lggr.Info().Str("tx", sendTx.Hash().Hex()).Msg("waiting for tx to be mined") lggr = lggr.With().Str("Msg Tx", sendTx.Hash().String()).Logger() stats.UpdateState(&lggr, 0, testreporters.TX, txConfirmationTime.Sub(startTime), testreporters.Success, nil) @@ -296,13 +295,13 @@ func (c *CCIPE2ELoad) Validate(lggr zerolog.Logger, sendTx *types.Transaction, t // if the finality tag is enabled and the last finalized block is greater than the block number of the message // consider the message finalized if c.Lane.Source.Common.ChainClient.GetNetworkConfig().FinalityDepth == 0 && - lstFinalizedBlock != 0 && lstFinalizedBlock > msgLogs[0].Raw.BlockNumber { + lstFinalizedBlock != 0 && lstFinalizedBlock > msgLogs[0].LogInfo.BlockNumber { sourceLogFinalizedAt = c.LastFinalizedTimestamp.Load() for i, stat := range stats { stat.UpdateState(&lggr, stat.SeqNum, testreporters.SourceLogFinalized, sourceLogFinalizedAt.Sub(sourceLogTime), testreporters.Success, &testreporters.TransactionStats{ - TxHash: msgLogs[i].Raw.TxHash.Hex(), + TxHash: msgLogs[i].LogInfo.TxHash.Hex(), FinalizedByBlock: strconv.FormatUint(lstFinalizedBlock, 10), FinalizedAt: sourceLogFinalizedAt.String(), Fee: msgLogs[i].Fee.String(), @@ -314,7 +313,7 @@ func (c *CCIPE2ELoad) Validate(lggr zerolog.Logger, sendTx *types.Transaction, t } else { var finalizingBlock uint64 sourceLogFinalizedAt, finalizingBlock, err = c.Lane.Source.AssertSendRequestedLogFinalized( - &lggr, msgLogs[0].Raw.TxHash, msgLogs, sourceLogTime, stats) + &lggr, msgLogs[0].LogInfo.TxHash, msgLogs, sourceLogTime, stats) if err != nil { return err }