Skip to content

Commit dafc48b

Browse files
committed
Improvements:
- Transmission telemetry for OCR2 and OCR3. To enable it, be sure to set LocalConfig.EnableTransmissionTelemetry - Further OCR3.1 work. Note that this release is only compatible (on the wire) with libocr release c907169 or newer - Various logging and documentation improvements Based on 478f9240ece50a87dba40b2985d1e27a22daf896
1 parent 61c382d commit dafc48b

File tree

30 files changed

+2103
-451
lines changed

30 files changed

+2103
-451
lines changed

offchainreporting/internal/protocol/observation/observation.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ func (o Observation) GoEthereumValue() *big.Int { return o.v }
5858

5959
func (o Observation) Deviates(old Observation, thresholdPPB uint64) bool {
6060
if old.v.Cmp(i(0)) == 0 {
61-
//nolint:gosimple
6261
if o.v.Cmp(i(0)) == 0 {
6362
return false // Both values are zero; no deviation
6463
}

offchainreporting/internal/serialization/serialization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func finalToProtoMessage(v protocol.MessageFinal) *protobuf.MessageFinal {
389389
Signatures: make([][]byte, len(v.Report.Signatures)),
390390
},
391391
}
392-
for i, sig := range v.Report.Signatures { //nolint:gosimple
392+
for i, sig := range v.Report.Signatures { //nolint:staticcheck
393393
pm.Report.Signatures[i] = sig
394394
}
395395
return pm

offchainreporting2/reportingplugin/median/median.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func (fac NumericalMedianFactory) NewReportingPlugin(ctx context.Context, config
337337

338338
func DefaultDeviationFunc(_ context.Context, thresholdPPB uint64, old *big.Int, new *big.Int) (bool, error) {
339339
if old.Cmp(i(0)) == 0 {
340-
if new.Cmp(i(0)) == 0 { //nolint:gosimple
340+
if new.Cmp(i(0)) == 0 {
341341
return false, nil // Both values are zero; no deviation
342342
}
343343
return true, nil // Any deviation from 0 is significant

offchainreporting2plus/internal/config/ocr2config/public_config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ import (
1212
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
1313
)
1414

15-
// PublicConfig is the configuration disseminated through the smart contract
16-
// It's public, because anybody can read it from the blockchain
15+
// PublicConfig is the configuration disseminated through the smart contract.
16+
// It's public, because anybody can read it from the blockchain.
17+
// The various parameters (e.g. Delta*, MaxDuration*) have some dependencies
18+
// on each other, so be sure to consider the holistic impact of changes to them.
1719
type PublicConfig struct {
1820
// If an epoch (driven by a leader) fails to achieve progress (generate a
1921
// report) after DeltaProgress, we enter a new epoch. This parameter must be

offchainreporting2plus/internal/config/ocr3config/public_config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import (
1313
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
1414
)
1515

16-
// PublicConfig is the configuration disseminated through the smart contract
17-
// It's public, because anybody can read it from the blockchain
16+
// PublicConfig is the configuration disseminated through the smart contract.
17+
// It's public, because anybody can read it from the blockchain.
18+
// The various parameters (e.g. Delta*, MaxDuration*) have some dependencies
19+
// on each other, so be sure to consider the holistic impact of changes to them.
1820
type PublicConfig struct {
1921
// If an epoch (driven by a leader) fails to achieve progress (generate a
2022
// report) after DeltaProgress, we enter a new epoch. This parameter must be

offchainreporting2plus/internal/managed/limits/ocr3_limits.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ func ocr3limits(cfg ocr3config.PublicConfig, pluginLimits ocr3types.ReportingPlu
6161
maxLenMsgNewEpoch := overhead
6262
maxLenMsgEpochStartRequest := add(maxLenCertifiedPrepareOrCommit, overhead)
6363
maxLenMsgEpochStart := add(maxLenCertifiedPrepareOrCommit, mul(2*(ed25519.SignatureSize+sigOverhead), cfg.ByzQuorumSize()), overhead)
64-
maxLenMsgRoundStart := add(pluginLimits.MaxQueryLength, overhead)
64+
maxLenMsgRoundStart := add(pluginLimits.MaxQueryLength, ed25519.SignatureSize+sigOverhead, overhead)
6565
maxLenMsgObservation := add(pluginLimits.MaxObservationLength, overhead)
66-
maxLenMsgProposal := add(mul(add(pluginLimits.MaxObservationLength, ed25519.SignatureSize+sigOverhead), cfg.N()), overhead)
66+
maxLenMsgProposal := add(mul(add(pluginLimits.MaxObservationLength, ed25519.SignatureSize+sigOverhead), cfg.N()), ed25519.SignatureSize+sigOverhead, overhead)
6767
maxLenMsgPrepare := overhead
6868
maxLenMsgCommit := overhead
6969
maxLenMsgReportSignatures := add(mul(add(maxSigLen, sigOverhead), pluginLimits.MaxReportCount), overhead)

offchainreporting2plus/internal/managed/managed_mercury_oracle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func RunManagedMercuryOracle(
229229
offchainKeyring,
230230
ocr3OnchainKeyring,
231231
shim.LimitCheckOCR3ReportingPlugin[mercuryshim.MercuryReportInfo]{reportingPlugin, reportingPluginLimits},
232-
shim.NewOCR3TelemetrySender(chTelemetrySend, childLogger),
232+
shim.NewOCR3TelemetrySender(chTelemetrySend, childLogger, localConfig.EnableTransmissionTelemetry),
233233
)
234234

235235
return nil, false

offchainreporting2plus/internal/managed/managed_ocr2_oracle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func RunManagedOCR2Oracle(
237237
onchainKeyring,
238238
shim.LimitCheckReportingPlugin{reportingPlugin, reportingPluginInfo.Limits},
239239
reportQuorum,
240-
shim.NewOCR2TelemetrySender(chTelemetrySend, childLogger),
240+
shim.NewOCR2TelemetrySender(chTelemetrySend, childLogger, localConfig.EnableTransmissionTelemetry),
241241
)
242242

243243
return nil, false

offchainreporting2plus/internal/managed/managed_ocr3_oracle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func RunManagedOCR3Oracle[RI any](
208208
offchainKeyring,
209209
onchainKeyring,
210210
shim.LimitCheckOCR3ReportingPlugin[RI]{reportingPlugin, reportingPluginInfo.Limits},
211-
shim.NewOCR3TelemetrySender(chTelemetrySend, childLogger),
211+
shim.NewOCR3TelemetrySender(chTelemetrySend, childLogger, localConfig.EnableTransmissionTelemetry),
212212
)
213213

214214
return nil, false

offchainreporting2plus/internal/ocr2/protocol/oracle.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ func (o *oracleState) run() {
202202
o.localConfig,
203203
o.logger,
204204
o.reportingPlugin,
205+
o.telemetrySender,
205206
o.contractTransmitter,
206207
)
207208
})

0 commit comments

Comments
 (0)