Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

offchain - explicit initialisations #219

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/services/ocr2/plugins/ccip/commit_reporting_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func NewCommitReportingPluginFactory(config CommitPluginStaticConfig) *CommitRep
return &CommitReportingPluginFactory{
config: config,
readersMu: &sync.Mutex{},

// the fields below are initially empty and populated on demand
destPriceRegReader: nil,
destPriceRegAddr: common.Address{},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func NewExecutionReportingPluginFactory(config ExecutionPluginStaticConfig) *Exe
return &ExecutionReportingPluginFactory{
config: config,
readersMu: &sync.Mutex{},

// the fields below are initially empty and populated on demand
destPriceRegReader: nil,
destPriceRegAddr: common.Address{},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,5 +352,10 @@ func NewCommitStoreV1_0_0(lggr logger.Logger, addr common.Address, ec client.Cli
reportAcceptedSig: eventSig,
// offset || priceUpdatesOffset || minSeqNum || maxSeqNum || merkleRoot
reportAcceptedMaxSeqIndex: 3,
configMu: sync.RWMutex{},

// The fields below are initially empty and set on ChangeConfig method
offchainConfig: CommitOffchainConfig{},
gasPriceEstimator: prices.ExecGasPriceEstimator{},
}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,10 @@ func NewCommitStoreV1_2_0(lggr logger.Logger, addr common.Address, ec client.Cli
reportAcceptedSig: eventSig,
// offset || priceUpdatesOffset || minSeqNum || maxSeqNum || merkleRoot
reportAcceptedMaxSeqIndex: 3,
configMu: sync.RWMutex{},

// The fields below are initially empty and set on ChangeConfig method
offchainConfig: CommitOffchainConfig{},
gasPriceEstimator: prices.DAGasPriceEstimator{},
}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ type LogPollerReader struct {

func NewLogPollerReader(lp logpoller.LogPoller, lggr logger.Logger, client evmclient.Client) *LogPollerReader {
return &LogPollerReader{
lp: lp,
lggr: lggr,
client: client,
lp: lp,
lggr: lggr,
client: client,
dependencyCache: sync.Map{},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,11 @@ func NewOffRampV1_0_0(lggr logger.Logger, addr common.Address, ec client.Client,
executionReportArgs: executionReportArgs,
eventSig: ExecutionStateChangedEventV1_0_0,
eventIndex: executionStateChangedSequenceNumberIndex,
configMu: sync.RWMutex{},

// values set on the fly after ChangeConfig is called
gasPriceEstimator: prices.ExecGasPriceEstimator{},
offchainConfig: ExecOffchainConfig{},
onchainConfig: ExecOnchainConfig{},
}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,11 @@ func NewOffRampV1_2_0(lggr logger.Logger, addr common.Address, ec client.Client,
OffRampV1_0_0: v100,
offRamp: offRamp,
executionReportArgs: executionReportArgs,
configMu: sync.RWMutex{},

// values set on the fly after ChangeConfig is called
gasPriceEstimator: prices.ExecGasPriceEstimator{},
offchainConfig: ExecOffchainConfig{},
onchainConfig: ExecOnchainConfig{},
}, nil
}