Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Apr 26, 2024
1 parent 5f8896f commit 530b53a
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .changeset/sour-jars-cross.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Add configurability to mercury transmitter

```toml
[Mercury.Transmitter]
MaxTransmitQueueSize = 10_000 # Default
TransmitQueueMaxSize = 10_000 # Default
TransmitTimeout = "5s" # Default
```
4 changes: 2 additions & 2 deletions core/config/docs/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,13 @@ CertFile = "/path/to/client/certs.pem" # Example

# Mercury.Transmitter controls settings for the mercury transmitter
[Mercury.Transmitter]
# MaxTransmitQueueSize controls the size of the transmit queue. This is scoped
# TransmitQueueMaxSize controls the size of the transmit queue. This is scoped
# per OCR instance. If the queue is full, the transmitter will start dropping
# the oldest messages in order to make space.
#
# This is useful if mercury server goes offline and the nop needs to buffer
# transmissions.
MaxTransmitQueueSize = 10_000 # Default
TransmitQueueMaxSize = 10_000 # Default
# TransmitTimeout controls how long the transmitter will wait for a response
# when sending a message to the mercury server, before aborting and considering
# the transmission to be failed.
Expand Down
2 changes: 1 addition & 1 deletion core/config/mercury_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type MercuryTLS interface {
}

type MercuryTransmitter interface {
MaxTransmitQueueSize() uint32
TransmitQueueMaxSize() uint32
TransmitTimeout() commonconfig.Duration
}

Expand Down
6 changes: 3 additions & 3 deletions core/config/toml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1313,13 +1313,13 @@ func (m *MercuryTLS) ValidateConfig() (err error) {
}

type MercuryTransmitter struct {
MaxTransmitQueueSize *uint32
TransmitQueueMaxSize *uint32
TransmitTimeout *commonconfig.Duration
}

func (m *MercuryTransmitter) setFrom(f *MercuryTransmitter) {
if v := f.MaxTransmitQueueSize; v != nil {
m.MaxTransmitQueueSize = v
if v := f.TransmitQueueMaxSize; v != nil {
m.TransmitQueueMaxSize = v
}
if v := f.TransmitTimeout; v != nil {
m.TransmitTimeout = v
Expand Down
4 changes: 2 additions & 2 deletions core/services/chainlink/config_mercury.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type mercuryTransmitterConfig struct {
c toml.MercuryTransmitter
}

func (m *mercuryTransmitterConfig) MaxTransmitQueueSize() uint32 {
return *m.c.MaxTransmitQueueSize
func (m *mercuryTransmitterConfig) TransmitQueueMaxSize() uint32 {
return *m.c.TransmitQueueMaxSize
}

func (m *mercuryTransmitterConfig) TransmitTimeout() commonconfig.Duration {
Expand Down
4 changes: 2 additions & 2 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ func TestConfig_Marshal(t *testing.T) {
CertFile: ptr("/path/to/cert.pem"),
},
Transmitter: toml.MercuryTransmitter{
MaxTransmitQueueSize: ptr(uint32(123)),
TransmitQueueMaxSize: ptr(uint32(123)),
TransmitTimeout: commoncfg.MustNewDuration(234 * time.Second),
},
}
Expand Down Expand Up @@ -1171,7 +1171,7 @@ LatestReportDeadline = '1m42s'
CertFile = '/path/to/cert.pem'
[Mercury.Transmitter]
MaxTransmitQueueSize = 123
TransmitQueueMaxSize = 123
TransmitTimeout = '3m54s'
`},
{"full", full, fullTOML},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ LatestReportDeadline = '1m42s'
CertFile = '/path/to/cert.pem'

[Mercury.Transmitter]
MaxTransmitQueueSize = 123
TransmitQueueMaxSize = 123
TransmitTimeout = '3m54s'

[Capabilities]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
8 changes: 4 additions & 4 deletions core/services/relay/evm/mercury/transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type TransmitterReportDecoder interface {
var _ Transmitter = (*mercuryTransmitter)(nil)

type TransmitterConfig interface {
MaxTransmitQueueSize() uint32
TransmitQueueMaxSize() uint32
TransmitTimeout() commonconfig.Duration
}

Expand Down Expand Up @@ -280,14 +280,14 @@ func NewTransmitter(lggr logger.Logger, cfg TransmitterConfig, clients map[strin
servers := make(map[string]*server, len(clients))
for serverURL, client := range clients {
cLggr := lggr.Named(serverURL).With("serverURL", serverURL)
pm := NewPersistenceManager(cLggr, serverURL, orm, jobID, int(cfg.MaxTransmitQueueSize()), flushDeletesFrequency, pruneFrequency)
pm := NewPersistenceManager(cLggr, serverURL, orm, jobID, int(cfg.TransmitQueueMaxSize()), flushDeletesFrequency, pruneFrequency)
servers[serverURL] = &server{
cLggr,
cfg.TransmitTimeout().Duration(),
client,
pm,
NewTransmitQueue(cLggr, serverURL, feedIDHex, int(cfg.MaxTransmitQueueSize()), pm),
make(chan *pb.TransmitRequest, int(cfg.MaxTransmitQueueSize())),
NewTransmitQueue(cLggr, serverURL, feedIDHex, int(cfg.TransmitQueueMaxSize()), pm),
make(chan *pb.TransmitRequest, int(cfg.TransmitQueueMaxSize())),
transmitSuccessCount.WithLabelValues(feedIDHex, serverURL),
transmitDuplicateCount.WithLabelValues(feedIDHex, serverURL),
transmitConnectionErrorCount.WithLabelValues(feedIDHex, serverURL),
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/mercury/transmitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

type mockCfg struct{}

func (m mockCfg) MaxTransmitQueueSize() uint32 {
func (m mockCfg) TransmitQueueMaxSize() uint32 {
return 10_000
}

Expand Down
2 changes: 1 addition & 1 deletion core/web/resolver/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ LatestReportDeadline = '1m42s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 123
TransmitQueueMaxSize = 123
TransmitTimeout = '3m54s'

[Capabilities]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
8 changes: 4 additions & 4 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1701,16 +1701,16 @@ CertFile is the path to a PEM file of trusted root certificate authority certifi
## Mercury.Transmitter
```toml
[Mercury.Transmitter]
MaxTransmitQueueSize = 10_000 # Default
TransmitQueueMaxSize = 10_000 # Default
TransmitTimeout = "5s" # Default
```
Mercury.Transmitter controls settings for the mercury transmitter

### MaxTransmitQueueSize
### TransmitQueueMaxSize
```toml
MaxTransmitQueueSize = 10_000 # Default
TransmitQueueMaxSize = 10_000 # Default
```
MaxTransmitQueueSize controls the size of the transmit queue. This is scoped
TransmitQueueMaxSize controls the size of the transmit queue. This is scoped
per OCR instance. If the queue is full, the transmitter will start dropping
the oldest messages in order to make space.

Expand Down
2 changes: 1 addition & 1 deletion testdata/scripts/node/validate/default.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion testdata/scripts/node/validate/disk-based-logging.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion testdata/scripts/node/validate/invalid-ocr-p2p.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion testdata/scripts/node/validate/invalid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion testdata/scripts/node/validate/valid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down
2 changes: 1 addition & 1 deletion testdata/scripts/node/validate/warnings.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ LatestReportDeadline = '5s'
CertFile = ''

[Mercury.Transmitter]
MaxTransmitQueueSize = 10000
TransmitQueueMaxSize = 10000
TransmitTimeout = '5s'

[Capabilities]
Expand Down

0 comments on commit 530b53a

Please sign in to comment.