From 186d6bef7d6c6ed0debc6957d8df1b1b7fad3512 Mon Sep 17 00:00:00 2001 From: chray-zhang Date: Fri, 6 Dec 2024 13:18:45 +0800 Subject: [PATCH] Matched G++ Configs --- .../common/gauntlet_plus_plus_common.go | 15 +----- integration-tests/common/test_common.go | 6 +-- ops/test_helpers.go | 47 +++++++++++-------- 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/integration-tests/common/gauntlet_plus_plus_common.go b/integration-tests/common/gauntlet_plus_plus_common.go index e0dafe71..8086b0ae 100644 --- a/integration-tests/common/gauntlet_plus_plus_common.go +++ b/integration-tests/common/gauntlet_plus_plus_common.go @@ -61,11 +61,7 @@ func (m *OCRv2TestState) fundNodesWithGPP() ([]string, error) { } func (m *OCRv2TestState) deployAccessControllerWithGpp() error { - err := m.Clients.GauntletClient.InstallDependencies() - if err != nil { - return err - } - err = m.Clients.GauntletPPClient.DeclareAccessControllerContract() + err := m.Clients.GauntletPPClient.DeclareAccessControllerContract() if err != nil { return err } @@ -81,15 +77,6 @@ func (m *OCRv2TestState) deployAccessControllerWithGpp() error { return nil } -func (m *OCRv2TestState) declareLinkToken() error { - err := m.Clients.GauntletPPClient.DeclareLinkTokenContract() - if err != nil { - return err - } - - return nil -} - func (m *OCRv2TestState) deployLinkTokenWithGpp() error { var err error m.Contracts.LinkTokenAddr, err = m.Clients.GauntletPPClient.DeployLinkTokenContract(m.Account.Account) diff --git a/integration-tests/common/test_common.go b/integration-tests/common/test_common.go index 7a6138c0..a28c46b9 100644 --- a/integration-tests/common/test_common.go +++ b/integration-tests/common/test_common.go @@ -269,8 +269,9 @@ func (m *OCRv2TestState) LoadOCR2Config() (*ops.OCR2Config, error) { var cfgKeys []string for i, key := range m.Clients.ChainlinkClient.NKeys { // need to remove the prefix since legacy gauntlet did it pre op - // https://github.com/smartcontractkit/chainlink-starknet/blob/develop/packages-ts/starknet-gauntlet-ocr2/src/commands/ocr2/setConfig.ts#L124 - offChaiNKeys = append(offChaiNKeys, m.removeOCR2PrefixAndAddPrefix(key.OCR2Key.Data.Attributes.OffChainPublicKey, "ocr2off_starknet_", "")) + // In G++ only signers have prefix removed + // https://github.com/smartcontractkit/gauntlet-plus-plus/blob/main/packages-starknet/operations-data-feeds/tests/fixtures/offchain-config.fixture.ts + offChaiNKeys = append(offChaiNKeys, key.OCR2Key.Data.Attributes.OffChainPublicKey) peerIDs = append(peerIDs, key.PeerID) txKeys = append(txKeys, m.Clients.ChainlinkClient.AccountAddresses[i]) onChaiNKeys = append(onChaiNKeys, m.removeOCR2PrefixAndAddPrefix(key.OCR2Key.Data.Attributes.OnChainPublicKey, "ocr2on_starknet_", "0x")) @@ -287,7 +288,6 @@ func (m *OCRv2TestState) LoadOCR2Config() (*ops.OCR2Config, error) { } func (m *OCRv2TestState) removeOCR2PrefixAndAddPrefix(k string, prefix string, newPrefix string) string { - // Print k for debugging before the modification if strings.HasPrefix(k, prefix) { return newPrefix + k[len(prefix):] } diff --git a/ops/test_helpers.go b/ops/test_helpers.go index 2fc70a16..76310baa 100644 --- a/ops/test_helpers.go +++ b/ops/test_helpers.go @@ -32,11 +32,14 @@ type OffchainConfig struct { } type ReportingPluginConfig struct { - AlphaReportInfinite bool `json:"alphaReportInfinite"` - AlphaReportPpb int `json:"alphaReportPpb"` - AlphaAcceptInfinite bool `json:"alphaAcceptInfinite"` - AlphaAcceptPpb int `json:"alphaAcceptPpb"` - DeltaCNanoseconds int `json:"deltaCNanoseconds"` + SourceFinalityDepth int `json:"sourceFinalityDepth"` + DestFinalityDepth int `json:"destFinalityDepth"` + MaxGasPrice string `json:"maxGasPrice"` + RelativeBoostPerWaitHour string `json:"relativeBoostPerWaitHour"` + InflightCacheExpiry string `json:"inflightCacheExpiry"` + RootSnoozeTime string `json:"rootSnoozeTime"` + DestOptimisticConfirmations int `json:"DestOptimisticConfirmations"` + BatchGasLimit int `json:"batchGasLimit"` } var TestOCR2Config = OCR2Config{ @@ -44,29 +47,33 @@ var TestOCR2Config = OCR2Config{ // Signers: onChainKeys, // user defined // Transmitters: txKeys, // user defined OnchainConfig: "", + // https://github.com/smartcontractkit/gauntlet-plus-plus/blob/main/packages-starknet/operations-data-feeds/tests/fixtures/offchain-config.fixture.ts OffchainConfig: &OffchainConfig{ // todo: increase delta round but decrease delta stage - DeltaProgress: "120s", // 120s - DeltaResend: "150s", // 150s - DeltaRound: "90s", // 90s - DeltaGrace: "5s", // 5s - DeltaStage: "20s", // 20s + DeltaProgress: "120000000000ns", // 120s + DeltaResend: "5000000000ns", // 150s + DeltaRound: "60000000000ns", // 90s + DeltaGrace: "5000000000ns", // 5s + DeltaStage: "180000000000ns", // 20s RMax: 5, S: []int{1, 1}, // Needs to array with length of transmitting nodes // OffchainPublicKeys: offChainKeys, // user defined // PeerIDs: peerIds, // user defined ReportingPluginConfig: &ReportingPluginConfig{ - AlphaReportInfinite: false, - AlphaReportPpb: 0, - AlphaAcceptInfinite: false, - AlphaAcceptPpb: 0, - DeltaCNanoseconds: 1000000000, + SourceFinalityDepth: 5, + DestFinalityDepth: 15, + MaxGasPrice: "300000000000", + RelativeBoostPerWaitHour: "300000000000", + InflightCacheExpiry: "3m0s", + RootSnoozeTime: "3m0s", + DestOptimisticConfirmations: 1, + BatchGasLimit: 1, }, - MaxDurationQuery: "20s", - MaxDurationObservation: "10s", - MaxDurationReport: "20s", - MaxDurationShouldAcceptFinalizedReport: "20s", - MaxDurationShouldTransmitAcceptedReport: "20s", + MaxDurationQuery: "100000000ns", + MaxDurationObservation: "35000000000ns", + MaxDurationReport: "10000000000ns", + MaxDurationShouldAcceptFinalizedReport: "5000000000ns", + MaxDurationShouldTransmitAcceptedReport: "10000000000ns", // ConfigPublicKeys: cfgKeys, // user defined // https://github.com/smartcontractkit/gauntlet-plus-plus/blob/5faf35e1d372e3ae5388c295554aa4f87bc0ece0/packages-starknet/operations-data-feeds/tests/fixtures/offchain-config.fixture.ts#L23 ConfigEncodingSecret: "abandon ability able about above absent absorb abstract absurd abuse access accident",