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 Load Test connected to crib #15404

Closed
wants to merge 17 commits into from
Closed
Prev Previous commit
Next Next commit
use changeset cspairs in the ccip tests
0xAustinWang committed Jan 15, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2ce7370436a0c94965c13b056ec3e08bbfbf5b4a
23 changes: 12 additions & 11 deletions integration-tests/load/ccip/ccip_test.go
Original file line number Diff line number Diff line change
@@ -114,31 +114,32 @@ func TestCCIPLoad_RPS(t *testing.T) {
}

// find get fee revert
csPair := ChainSelectorPair{
src: 12922642891491394802,
dst: 3379446385462418246,
csPair := ccipchangeset.SourceDestPair{
SourceChainSelector: 12922642891491394802,
DestChainSelector: 3379446385462418246,
}
res, err := state.Chains[csPair.src].Router.IsChainSupported(nil, csPair.dst)
res, err := state.Chains[csPair.SourceChainSelector].Router.IsChainSupported(nil, csPair.DestChainSelector)
lggr.Infow("IsChainSupported", "res", res, "err", err)

destChainConfig, err := state.Chains[csPair.src].FeeQuoter.GetDestChainConfig(nil, csPair.dst)
destChainConfig, err := state.Chains[csPair.SourceChainSelector].FeeQuoter.GetDestChainConfig(nil, csPair.DestChainSelector)
lggr.Infow("GetDestChainConfig", "destChainConfig", destChainConfig, "err", err)

// find the getFee revert
_, err = p.Run(true)
//csPair := ChainSelectorPair{
// src: 12922642891491394802,
// dst: 3379446385462418246,
//}
src, dst := env.Chains[csPair.src], env.Chains[csPair.dst]

src, dst := env.Chains[csPair.SourceChainSelector], env.Chains[csPair.DestChainSelector]
startblk := uint64(11654)

seqNum := gunMap[csPair.dst].seqNums[csPair].End.Load()
seqNum := gunMap[csPair.DestChainSelector].seqNums[csPair].End.Load()
_, err = ccipchangeset.ConfirmCommitWithExpectedSeqNumRange(t, src, dst, state.Chains[3379446385462418246].OffRamp, &startblk, cciptypes.SeqNumRange{
cciptypes.SeqNum(seqNum - 1),
cciptypes.SeqNum(seqNum - 1),
}, false)

ccipchangeset.ConfirmExecWithSeqNrsForAll(t, *env, state, map[ccipchangeset.SourceDestPair][]uint64{
csPair: {seqNum - 1},
}, startBlocks)

// todo: create channels that watch for these events beforehand using WatchExecutionStateChanged and WatchCommitReportAccepted
// rather than waiting for the generator to finish
lokiLabels := map[string]string{}
23 changes: 9 additions & 14 deletions integration-tests/load/ccip/destination_gun.go
Original file line number Diff line number Diff line change
@@ -18,11 +18,6 @@ import (
"time"
)

type ChainSelectorPair struct {
src uint64
dst uint64
}

type SeqNumRange struct {
Start *atomic.Uint64
End *atomic.Uint64
@@ -31,7 +26,7 @@ type SeqNumRange struct {
type DestinationGun struct {
l logger.Logger
env deployment.Environment
seqNums map[ChainSelectorPair]SeqNumRange
seqNums map[ccipchangeset.SourceDestPair]SeqNumRange
roundNum *atomic.Int32
chainSelector uint64
receiver common.Address
@@ -40,13 +35,13 @@ type DestinationGun struct {
}

func NewDestinationGun(l logger.Logger, chainSelector uint64, env deployment.Environment, receiver common.Address, overrides *ccip.LoadConfig, loki *wasp.LokiClient) (*DestinationGun, error) {
seqNums := make(map[ChainSelectorPair]SeqNumRange)
seqNums := make(map[ccipchangeset.SourceDestPair]SeqNumRange)
for _, cs := range env.AllChainSelectorsExcluding([]uint64{chainSelector}) {

// query for the actual sequence number
seqNums[ChainSelectorPair{
src: cs,
dst: chainSelector,
seqNums[ccipchangeset.SourceDestPair{
SourceChainSelector: cs,
DestChainSelector: chainSelector,
}] = SeqNumRange{
Start: atomic.NewUint64(0),
End: atomic.NewUint64(0),
@@ -107,9 +102,9 @@ func (m *DestinationGun) Call(_ *wasp.Generator) *wasp.Response {
m.l.Errorw("Failed setting loki labels", "error", err)
}

csPair := ChainSelectorPair{
src: src,
dst: m.chainSelector,
csPair := ccipchangeset.SourceDestPair{
SourceChainSelector: src,
DestChainSelector: m.chainSelector,
}
m.l.Infow("Starting transmit with ",
"RoundNum", requestedRound,
@@ -245,7 +240,7 @@ func (m *DestinationGun) GetMessage() (router.ClientEVM2AnyMessage, error) {
}
}

func (m *DestinationGun) GetSequenceNumberRange(csPair ChainSelectorPair) (uint64, uint64, error) {
func (m *DestinationGun) GetSequenceNumberRange(csPair ccipchangeset.SourceDestPair) (uint64, uint64, error) {
if r, ok := m.seqNums[csPair]; !ok {
return 0, 0, fmt.Errorf("no sequence number found for chain pair %v", csPair)
} else {
Loading