Skip to content

Commit

Permalink
test with legacy gauntlet
Browse files Browse the repository at this point in the history
  • Loading branch information
chray-zhang committed Jan 6, 2025
1 parent b1c21b3 commit 0393ac0
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 25 deletions.
16 changes: 15 additions & 1 deletion integration-tests/common/gauntlet_plus_plus_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ func (m *OCRv2TestState) setConfigDetailsWithGpp(ocrAddress string) error {
return err
}

func (m *OCRv2TestState) setConfigDetails(ocrAddress string) error {
cfg, err := m.LoadOCR2Config()
if err != nil {
return err
}
var parsedConfig []byte
parsedConfig, err = json.Marshal(cfg)
if err != nil {
return err
}
_, err = m.Clients.GauntletClient.SetConfigDetails(string(parsedConfig), ocrAddress)
return err
}

func (m *OCRv2TestState) DeployGauntletPP(minSubmissionValue int64, maxSubmissionValue int64, decimals int, name string, observationPaymentGjuels int64, transmissionPaymentGjuels int64) error {
err := m.Clients.GauntletClient.InstallDependencies()
if err != nil {
Expand Down Expand Up @@ -158,6 +172,6 @@ func (m *OCRv2TestState) DeployGauntletPP(minSubmissionValue int64, maxSubmissio
return err
}

err = m.setConfigDetailsWithGpp(m.Contracts.OCRAddr)
err = m.setConfigDetails(m.Contracts.OCRAddr)
return err
}
4 changes: 4 additions & 0 deletions integration-tests/smoke/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func TestOCRBasic(t *testing.T) {
env map[string]string
}{
{name: "embedded"},
{name: "plugins", env: map[string]string{
"CL_MEDIAN_CMD": "chainlink-feeds",
"CL_SOLANA_CMD": "chainlink-solana",
}},
} {
config, err := tc.GetConfig("Smoke", tc.OCR2)
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions ops/gauntlet/gauntlet_starknet.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,15 @@ func (sg *StarknetGauntlet) MintLinkToken(token, to, amount string) (string, err
}
return sg.gr.Responses[0].Contract, nil
}

func (sg *StarknetGauntlet) SetConfigDetails(cfg string, ocrAddress string) (string, error) {
_, err := sg.G.ExecCommand([]string{"ocr2:set_config", "--input=" + cfg, ocrAddress}, *sg.options)
if err != nil {
return "", err
}
sg.gr, err = sg.FetchGauntletJSONOutput()
if err != nil {
return "", err
}
return sg.gr.Responses[0].Contract, nil
}
44 changes: 20 additions & 24 deletions ops/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@ type OCR2Config struct {
}

type OffchainConfig struct {
DeltaProgressNanoseconds string `json:"deltaProgress"`
DeltaResendNanoseconds string `json:"deltaResend"`
DeltaRoundNanoseconds string `json:"deltaRound"`
DeltaGraceNanoseconds string `json:"deltaGrace"`
DeltaStageNanoseconds string `json:"deltaStage"`
DeltaProgressNanoseconds int64 `json:"deltaProgressNanoseconds"`
DeltaResendNanoseconds int64 `json:"deltaResendNanoseconds"`
DeltaRoundNanoseconds int64 `json:"deltaRoundNanoseconds"`
DeltaGraceNanoseconds int `json:"deltaGraceNanoseconds"`
DeltaStageNanoseconds int64 `json:"deltaStageNanoseconds"`
RMax int `json:"rMax"`
S []int `json:"s"`
OffchainPublicKeys []string `json:"offchainPublicKeys"`
PeerIDs []string `json:"peerIds"`
ReportingPluginConfig *ReportingPluginConfig `json:"reportingPluginConfig"`
MaxDurationQueryNanoseconds string `json:"maxDurationQuery"`
MaxDurationObservationNanoseconds string `json:"maxDurationObservation"`
MaxDurationReportNanoseconds string `json:"maxDurationReport"`
MaxDurationShouldAcceptFinalizedReportNanoseconds string `json:"maxDurationShouldAcceptFinalizedReport"`
MaxDurationShouldTransmitAcceptedReportNanoseconds string `json:"maxDurationShouldTransmitAcceptedReport"`
MaxDurationQueryNanoseconds int `json:"maxDurationQueryNanoseconds"`
MaxDurationObservationNanoseconds int `json:"maxDurationObservationNanoseconds"`
MaxDurationReportNanoseconds int `json:"maxDurationReportNanoseconds"`
MaxDurationShouldAcceptFinalizedReportNanoseconds int `json:"maxDurationShouldAcceptFinalizedReportNanoseconds"`
MaxDurationShouldTransmitAcceptedReportNanoseconds int `json:"maxDurationShouldTransmitAcceptedReportNanoseconds"`
ConfigPublicKeys []string `json:"configPublicKeys"`
ConfigEncodingSecret string `json:"configEncodingSecret"`
SignerSecret string `json:"signerSecret"`
}

type ReportingPluginConfig struct {
Expand All @@ -47,11 +45,11 @@ var TestOCR2Config = OCR2Config{
OnchainConfig: "",
OffchainConfig: &OffchainConfig{
// todo: increase delta round but decrease delta stage
DeltaProgressNanoseconds: "150000000000ns", // 120s
DeltaResendNanoseconds: "150000000000ns", // 150s
DeltaRoundNanoseconds: "90000000000ns", // 90s
DeltaGraceNanoseconds: "5000000000ns", // 5s
DeltaStageNanoseconds: "30000000000ns", // 20s
DeltaProgressNanoseconds: 150000000000, // 120s
DeltaResendNanoseconds: 150000000000, // 150s
DeltaRoundNanoseconds: 90000000000, // 90s
DeltaGraceNanoseconds: 5000000000, // 5s
DeltaStageNanoseconds: 30000000000, // 20s
RMax: 5,
S: []int{1, 1}, // Needs to array with length of transmitting nodes
// OffchainPublicKeys: offChainKeys, // user defined
Expand All @@ -63,14 +61,12 @@ var TestOCR2Config = OCR2Config{
AlphaAcceptPpb: 0,
DeltaCNanoseconds: 1000000000,
},
MaxDurationQueryNanoseconds: "2000000000ns",
MaxDurationObservationNanoseconds: "1000000000ns",
MaxDurationReportNanoseconds: "2000000000ns",
MaxDurationShouldAcceptFinalizedReportNanoseconds: "2000000000ns",
MaxDurationShouldTransmitAcceptedReportNanoseconds: "2000000000ns",
MaxDurationQueryNanoseconds: 2000000000,
MaxDurationObservationNanoseconds: 1000000000,
MaxDurationReportNanoseconds: 2000000000,
MaxDurationShouldAcceptFinalizedReportNanoseconds: 2000000000,
MaxDurationShouldTransmitAcceptedReportNanoseconds: 2000000000,
// ConfigPublicKeys: cfgKeys, // user defined
ConfigEncodingSecret: "awe accuse polygon tonic depart acuity onyx inform bound gilbert expire",
SignerSecret: "awe accuse polygon tonic depart acuity onyx inform bound gilbert expire",
},
OffchainConfigVersion: 2,
Secret: "awe accuse polygon tonic depart acuity onyx inform bound gilbert expire",
Expand Down

0 comments on commit 0393ac0

Please sign in to comment.