Skip to content

Commit 44a7392

Browse files
committed
Add E2E latency to load tests
1 parent 60ba0a0 commit 44a7392

File tree

29 files changed

+478
-359
lines changed

29 files changed

+478
-359
lines changed

.github/workflows/test-load-nightly.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
test:
2222
- subtest: rpc_latency
2323
timeout: 1h10m
24+
- subtest: gas
25+
timeout: 10m
26+
- subtest: burst
27+
timeout: 10m
2428
steps:
2529
- name: Enable S3 Cache for Self-Hosted Runners
2630
uses: runs-on/action@cd2b598b0515d39d78c38a02d529db87d2196d1e # v2.0.3
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- +goose Up
2+
-- +goose StatementBegin
3+
4+
-- Add source_chain_block_timestamp column to commit_verification_records
5+
-- This represents the timestamp when the message was included in a source chain block
6+
-- Default to current time in milliseconds for existing rows
7+
ALTER TABLE commit_verification_records
8+
ADD COLUMN source_chain_block_timestamp TIMESTAMP NOT NULL DEFAULT now();
9+
10+
-- +goose StatementEnd
11+
12+
-- +goose Down
13+
-- +goose StatementBegin
14+
15+
ALTER TABLE commit_verification_records
16+
DROP COLUMN source_chain_block_timestamp;
17+
18+
-- +goose StatementEnd

aggregator/pkg/model/commit_aggregated_report.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ func (c *CommitAggregatedReport) GetMessageExecutorAddress() protocol.UnknownAdd
6464
return c.Verifications[0].MessageExecutorAddress
6565
}
6666

67+
func (c *CommitAggregatedReport) GetSourceChainBlockTimestamp() time.Time {
68+
return c.Verifications[0].SourceChainBlockTimestamp
69+
}
70+
6771
// It is assumed that all verifications in the report have the same message since otherwise the message ID would not match.
6872
func (c *CommitAggregatedReport) GetProtoMessage() *pb.Message {
6973
if len(c.Verifications) > 0 && c.Verifications[0].Message != nil {

aggregator/pkg/model/commit_verification_record.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ func (c CommitVerificationRecordIdentifier) ToIdentifier() string {
3232

3333
// CommitVerificationRecord represents a record of a commit verification.
3434
type CommitVerificationRecord struct {
35-
MessageID MessageID
36-
Message *protocol.Message
37-
CCVVersion []byte
38-
Signature []byte
39-
MessageCCVAddresses []protocol.UnknownAddress
40-
MessageExecutorAddress protocol.UnknownAddress
41-
IdentifierSigner *IdentifierSigner
42-
createdAt time.Time // Internal field for tracking creation time from DB
35+
MessageID MessageID
36+
Message *protocol.Message
37+
CCVVersion []byte
38+
Signature []byte
39+
MessageCCVAddresses []protocol.UnknownAddress
40+
MessageExecutorAddress protocol.UnknownAddress
41+
SourceChainBlockTimestamp time.Time // Timestamp when message was included in source chain block (milliseconds)
42+
IdentifierSigner *IdentifierSigner
43+
createdAt time.Time // Internal field for tracking creation time from DB
4344
}
4445

4546
// GetID retrieves the unique identifier for the commit verification record.

aggregator/pkg/model/helpers.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,10 @@ func MapAggregatedReportToCCVDataProto(report *CommitAggregatedReport, c *Commit
140140
MessageExecutorAddress: []byte(report.GetMessageExecutorAddress()),
141141
CcvData: ccvData,
142142
Metadata: &pb.VerifierResultMetadata{
143-
Timestamp: timeToTimestampMillis(report.WrittenAt),
144-
VerifierSourceAddress: quorumConfig.GetSourceVerifierAddressBytes(),
145-
VerifierDestAddress: quorumConfig.GetDestVerifierAddressBytes(),
143+
Timestamp: timeToTimestampMillis(report.WrittenAt),
144+
VerifierSourceAddress: quorumConfig.GetSourceVerifierAddressBytes(),
145+
VerifierDestAddress: quorumConfig.GetDestVerifierAddressBytes(),
146+
SourceChainBlockTimestamp: report.GetSourceChainBlockTimestamp().UnixMilli(),
146147
},
147148
}, nil
148149
}
@@ -194,10 +195,11 @@ func CommitVerificationRecordFromProto(proto *pb.CommitteeVerifierNodeResult) (*
194195
}
195196

196197
record := &CommitVerificationRecord{
197-
CCVVersion: proto.CcvVersion,
198-
Signature: proto.Signature,
199-
MessageCCVAddresses: ccvAddresses,
200-
MessageExecutorAddress: protocol.UnknownAddress(proto.ExecutorAddress),
198+
CCVVersion: proto.CcvVersion,
199+
Signature: proto.Signature,
200+
MessageCCVAddresses: ccvAddresses,
201+
MessageExecutorAddress: protocol.UnknownAddress(proto.ExecutorAddress),
202+
SourceChainBlockTimestamp: time.UnixMilli(proto.SourceChainBlockTimestamp),
201203
}
202204
record.SetTimestampFromMillis(time.Now().UnixMilli())
203205

@@ -228,10 +230,11 @@ func CommitVerificationRecordToProto(record *CommitVerificationRecord) *pb.Commi
228230
}
229231

230232
proto := &pb.CommitteeVerifierNodeResult{
231-
CcvVersion: record.CCVVersion,
232-
Signature: record.Signature,
233-
CcvAddresses: ccvAddresses,
234-
ExecutorAddress: []byte(record.MessageExecutorAddress),
233+
CcvVersion: record.CCVVersion,
234+
Signature: record.Signature,
235+
CcvAddresses: ccvAddresses,
236+
ExecutorAddress: []byte(record.MessageExecutorAddress),
237+
SourceChainBlockTimestamp: record.SourceChainBlockTimestamp.UnixMilli(),
235238
}
236239

237240
if record.Message != nil {

aggregator/pkg/storage/postgres/database_storage.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ func (d *DatabaseStorage) SaveCommitVerification(ctx context.Context, record *mo
107107
stmt := `INSERT INTO commit_verification_records
108108
(message_id, signer_address,
109109
signature_r, signature_s, aggregation_key,
110-
ccv_version, signature, message_ccv_addresses, message_executor_address, message_data)
111-
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
110+
ccv_version, signature, message_ccv_addresses, message_executor_address, message_data,
111+
source_chain_block_timestamp)
112+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
112113
ON CONFLICT (message_id, signer_address, aggregation_key)
113114
DO NOTHING
114115
RETURNING id`
@@ -125,6 +126,7 @@ func (d *DatabaseStorage) SaveCommitVerification(ctx context.Context, record *mo
125126
params["message_ccv_addresses"],
126127
params["message_executor_address"],
127128
params["message_data"],
129+
params["source_chain_block_timestamp"],
128130
)
129131
if err != nil {
130132
if err == sql.ErrNoRows {
@@ -237,6 +239,7 @@ func (d *DatabaseStorage) QueryAggregatedReports(ctx context.Context, sinceSeque
237239
&verRow.MessageExecutorAddress,
238240
&verRow.MessageData,
239241
&verRow.ID,
242+
&verRow.SourceChainBlockTimestamp,
240243
&verRow.CreatedAt,
241244
)
242245
if err != nil {
@@ -355,6 +358,7 @@ func (d *DatabaseStorage) GetCCVData(ctx context.Context, messageID model.Messag
355358
&verRow.MessageExecutorAddress,
356359
&verRow.MessageData,
357360
&verRow.ID,
361+
&verRow.SourceChainBlockTimestamp,
358362
&verRow.CreatedAt,
359363
)
360364
if err != nil {
@@ -456,6 +460,7 @@ func (d *DatabaseStorage) GetBatchCCVData(ctx context.Context, messageIDs []mode
456460
&verRow.MessageExecutorAddress,
457461
&verRow.MessageData,
458462
&verRow.ID,
463+
&verRow.SourceChainBlockTimestamp,
459464
&verRow.CreatedAt,
460465
)
461466
if err != nil {

aggregator/pkg/storage/postgres/database_storage_mapper.go

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ import (
1313
)
1414

1515
type commitVerificationRecordRow struct {
16-
ID int64 `db:"id"`
17-
SeqNum int64 `db:"seq_num"`
18-
MessageID string `db:"message_id"`
19-
SignerAddress string `db:"signer_address"`
20-
SignatureR []byte `db:"signature_r"`
21-
SignatureS []byte `db:"signature_s"`
22-
AggregationKey string `db:"aggregation_key"`
23-
CCVVersion []byte `db:"ccv_version"`
24-
Signature []byte `db:"signature"`
25-
MessageCCVAddresses pq.StringArray `db:"message_ccv_addresses"`
26-
MessageExecutorAddress string `db:"message_executor_address"`
27-
MessageData []byte `db:"message_data"`
28-
CreatedAt time.Time `db:"created_at"`
16+
ID int64 `db:"id"`
17+
SeqNum int64 `db:"seq_num"`
18+
MessageID string `db:"message_id"`
19+
SignerAddress string `db:"signer_address"`
20+
SignatureR []byte `db:"signature_r"`
21+
SignatureS []byte `db:"signature_s"`
22+
AggregationKey string `db:"aggregation_key"`
23+
CCVVersion []byte `db:"ccv_version"`
24+
Signature []byte `db:"signature"`
25+
MessageCCVAddresses pq.StringArray `db:"message_ccv_addresses"`
26+
MessageExecutorAddress string `db:"message_executor_address"`
27+
MessageData []byte `db:"message_data"`
28+
SourceChainBlockTimestamp time.Time `db:"source_chain_block_timestamp"`
29+
CreatedAt time.Time `db:"created_at"`
2930
}
3031

3132
func rowToCommitVerificationRecord(row *commitVerificationRecordRow) (*model.CommitVerificationRecord, error) {
@@ -68,13 +69,14 @@ func rowToCommitVerificationRecord(row *commitVerificationRecordRow) (*model.Com
6869
}
6970

7071
record := &model.CommitVerificationRecord{
71-
MessageID: messageID,
72-
Message: &message,
73-
CCVVersion: row.CCVVersion,
74-
Signature: row.Signature,
75-
MessageCCVAddresses: messageCCVAddresses,
76-
MessageExecutorAddress: messageExecutorAddress,
77-
IdentifierSigner: identifierSigner,
72+
MessageID: messageID,
73+
Message: &message,
74+
CCVVersion: row.CCVVersion,
75+
Signature: row.Signature,
76+
MessageCCVAddresses: messageCCVAddresses,
77+
MessageExecutorAddress: messageExecutorAddress,
78+
SourceChainBlockTimestamp: row.SourceChainBlockTimestamp,
79+
IdentifierSigner: identifierSigner,
7880
}
7981
record.SetTimestampFromMillis(row.CreatedAt.UnixMilli())
8082
return record, nil
@@ -109,28 +111,29 @@ func recordToInsertParams(record *model.CommitVerificationRecord, aggregationKey
109111
messageExecutorAddressHex := record.MessageExecutorAddress.String()
110112

111113
params := map[string]any{
112-
"message_id": messageIDHex,
113-
"signer_address": signerAddressHex,
114-
"signature_r": record.IdentifierSigner.SignatureR[:],
115-
"signature_s": record.IdentifierSigner.SignatureS[:],
116-
"aggregation_key": aggregationKey,
117-
"ccv_version": record.CCVVersion,
118-
"signature": record.Signature,
119-
"message_ccv_addresses": pq.Array(messageCCVAddressesHex),
120-
"message_executor_address": messageExecutorAddressHex,
121-
"message_data": messageDataJSON,
114+
"message_id": messageIDHex,
115+
"signer_address": signerAddressHex,
116+
"signature_r": record.IdentifierSigner.SignatureR[:],
117+
"signature_s": record.IdentifierSigner.SignatureS[:],
118+
"aggregation_key": aggregationKey,
119+
"ccv_version": record.CCVVersion,
120+
"signature": record.Signature,
121+
"message_ccv_addresses": pq.Array(messageCCVAddressesHex),
122+
"message_executor_address": messageExecutorAddressHex,
123+
"message_data": messageDataJSON,
124+
"source_chain_block_timestamp": record.SourceChainBlockTimestamp,
122125
}
123126

124127
return params, nil
125128
}
126129

127130
const allVerificationRecordColumns = `message_id, signer_address,
128131
signature_r, signature_s, aggregation_key,
129-
ccv_version, signature, message_ccv_addresses, message_executor_address, message_data, id, created_at`
132+
ccv_version, signature, message_ccv_addresses, message_executor_address, message_data, id, source_chain_block_timestamp, created_at`
130133

131134
const allVerificationRecordColumnsQualified = `cvr.message_id, cvr.signer_address,
132135
cvr.signature_r, cvr.signature_s, cvr.aggregation_key,
133-
cvr.ccv_version, cvr.signature, cvr.message_ccv_addresses, cvr.message_executor_address, cvr.message_data, cvr.id, cvr.created_at`
136+
cvr.ccv_version, cvr.signature, cvr.message_ccv_addresses, cvr.message_executor_address, cvr.message_data, cvr.id, cvr.source_chain_block_timestamp, cvr.created_at`
134137

135138
func mustParseUint64(s string) uint64 {
136139
var result uint64

build/devenv/config.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
DefaultAnvilKey = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
3535
DefaultLokiURL = "http://localhost:3030/loki/api/v1/push"
3636
DefaultTempoURL = "http://localhost:4318/v1/traces"
37+
DefaultPromURL = "http://localhost:9099"
3738
)
3839

3940
var L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.InfoLevel)
@@ -101,23 +102,24 @@ func LoadOutput[T any](outputPath string) (*T, error) {
101102
}
102103

103104
// Load addresses into the datastore so that tests can query them appropriately.
104-
if c, ok := any(config).(*Cfg); ok {
105-
if len(c.CLDF.Addresses) > 0 {
106-
ds := datastore.NewMemoryDataStore()
107-
for _, addrRefJSON := range c.CLDF.Addresses {
108-
var addrs []datastore.AddressRef
109-
if err := json.Unmarshal([]byte(addrRefJSON), &addrs); err != nil {
110-
return nil, fmt.Errorf("failed to unmarshal addresses from config: %w", err)
111-
}
112-
for _, addr := range addrs {
113-
if err := ds.Addresses().Add(addr); err != nil {
114-
return nil, fmt.Errorf("failed to set address in datastore: %w", err)
115-
}
116-
}
105+
c, ok := any(config).(*Cfg)
106+
if !ok || len(c.CLDF.Addresses) == 0 {
107+
return config, nil
108+
}
109+
110+
ds := datastore.NewMemoryDataStore()
111+
for _, addrRefJSON := range c.CLDF.Addresses {
112+
var addrs []datastore.AddressRef
113+
if err := json.Unmarshal([]byte(addrRefJSON), &addrs); err != nil {
114+
return nil, fmt.Errorf("failed to unmarshal addresses from config: %w", err)
115+
}
116+
for _, addr := range addrs {
117+
if err := ds.Addresses().Add(addr); err != nil {
118+
return nil, fmt.Errorf("failed to set address in datastore: %w", err)
117119
}
118-
c.CLDF.DataStore = ds.Seal()
119120
}
120121
}
122+
c.CLDF.DataStore = ds.Seal()
121123

122124
return config, nil
123125
}

build/devenv/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ require (
3333
github.com/go-resty/resty/v2 v2.16.5
3434
github.com/google/uuid v1.6.0
3535
github.com/gorilla/websocket v1.5.3
36+
github.com/prometheus/common v1.20.99
3637
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20251127040717-30244f57ea7a
3738
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment v0.0.0-20251127040717-30244f57ea7a
3839
github.com/smartcontractkit/chainlink-ccv v0.0.0-00010101000000-000000000000
3940
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250826201006-c81344a26fc3
40-
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/go v0.0.0-20251126123859-d079d6815edb
41+
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/go v0.0.0-20251127174315-8ee658a4af6a
4142
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.51.1
4243
google.golang.org/grpc v1.76.0
4344
)
@@ -302,7 +303,6 @@ require (
302303
github.com/pressly/goose/v3 v3.26.0 // indirect
303304
github.com/prometheus/alertmanager v0.28.0 // indirect
304305
github.com/prometheus/client_model v0.6.2 // indirect
305-
github.com/prometheus/common v1.20.99 // indirect
306306
github.com/prometheus/exporter-toolkit v0.13.2 // indirect
307307
github.com/prometheus/procfs v0.16.1 // indirect
308308
github.com/prometheus/prometheus v0.302.0 // indirect

build/devenv/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,8 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.66.0 h1:tJvjPiQsC
10711071
github.com/smartcontractkit/chainlink-deployments-framework v0.66.0/go.mod h1:8EXTqTr/5T5WLZpWg6npDvmcR3/wLl1A8eculNCn5GA=
10721072
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250826201006-c81344a26fc3 h1:mJP6yJq2woOZchX0KvhLiKxDPaS0Vy4vTDFH4nnFkXs=
10731073
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250826201006-c81344a26fc3/go.mod h1:3Lsp38qxen9PABVF+O5eocveQev+hyo9HLAgRodBD4Q=
1074-
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/go v0.0.0-20251126123859-d079d6815edb h1:vGLgImXYmzK8eow7kShHGZO948818NAI3FPihEH1v7c=
1075-
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/go v0.0.0-20251126123859-d079d6815edb/go.mod h1:KJkb85Mfxr/2vjPvAWWpq0/QJMAP1Bts1wMWWhRn4/E=
1074+
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/go v0.0.0-20251127174315-8ee658a4af6a h1:vGPF2Tlg1SBcCBPUP51m/PTO9IokKBuSaTjRV3CKyQ0=
1075+
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/go v0.0.0-20251127174315-8ee658a4af6a/go.mod h1:KJkb85Mfxr/2vjPvAWWpq0/QJMAP1Bts1wMWWhRn4/E=
10761076
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2 h1:1/KdO5AbUr3CmpLjMPuJXPo2wHMbfB8mldKLsg7D4M8=
10771077
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q=
10781078
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4=

0 commit comments

Comments
 (0)