Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier committed Jan 22, 2025
1 parent 5896f80 commit 078e8c1
Show file tree
Hide file tree
Showing 21 changed files with 88 additions and 85 deletions.
8 changes: 4 additions & 4 deletions core/config/docs/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ ListenAddresses = ['1.2.3.4:9999', '[a52d:0:a88:1274::abcd]:1337'] # Example

[Capabilities.RateLimit]
# GlobalRPS is the global rate limit for the dispatcher.
GlobalRPS = 800 # Default
GlobalRPS = 200 # Default
# GlobalBurst is the global burst limit for the dispatcher.
GlobalBurst = 1000 # Default
GlobalBurst = 200 # Default
# PerSenderRPS is the per-sender rate limit for the dispatcher.
PerSenderRPS = 10 # Default
PerSenderRPS = 100 # Default
# PerSenderBurst is the per-sender burst limit for the dispatcher.
PerSenderBurst = 50 # Default
PerSenderBurst = 100 # Default

[Capabilities.WorkflowRegistry]
# Address is the address for the workflow registry contract.
Expand Down
5 changes: 4 additions & 1 deletion core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,15 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
opts.CapabilitiesRegistry = capabilities.NewRegistry(globalLogger)
}

workflowRateLimiter, _ := ratelimiter.NewRateLimiter(ratelimiter.Config{
workflowRateLimiter, err := ratelimiter.NewRateLimiter(ratelimiter.Config{
GlobalRPS: cfg.Capabilities().RateLimit().GlobalRPS(),
GlobalBurst: cfg.Capabilities().RateLimit().GlobalBurst(),
PerSenderRPS: cfg.Capabilities().RateLimit().PerSenderRPS(),
PerSenderBurst: cfg.Capabilities().RateLimit().PerSenderBurst(),
})
if err != nil {
return nil, fmt.Errorf("could not instantiate workflow rate limiter: %w", err)
}

var gatewayConnectorWrapper *gatewayconnector.ServiceWrapper
if cfg.Capabilities().GatewayConnector().DonID() != "" {
Expand Down
8 changes: 4 additions & 4 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ func TestConfig_Marshal(t *testing.T) {
}
full.Capabilities = toml.Capabilities{
RateLimit: toml.EngineExecutionRateLimit{
GlobalRPS: ptr(800.0),
GlobalBurst: ptr(1000),
PerSenderRPS: ptr(10.0),
PerSenderBurst: ptr(50),
GlobalRPS: ptr(200.00),
GlobalBurst: ptr(200),
PerSenderRPS: ptr(100.0),
PerSenderBurst: ptr(100),
},
Peering: toml.P2P{
IncomingMessageBufferSize: ptr[int64](13),
Expand Down
8 changes: 4 additions & 4 deletions core/services/chainlink/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ TransmitConcurrency = 456

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions core/web/resolver/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ TransmitConcurrency = 456

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 13
Expand Down
8 changes: 4 additions & 4 deletions core/web/resolver/testdata/config-multi-chain-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
16 changes: 8 additions & 8 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1216,34 +1216,34 @@ but the host and port must be fully specified and cannot be empty. You can speci
## Capabilities.RateLimit
```toml
[Capabilities.RateLimit]
GlobalRPS = 800 # Default
GlobalBurst = 1000 # Default
PerSenderRPS = 10 # Default
PerSenderBurst = 50 # Default
GlobalRPS = 200 # Default
GlobalBurst = 200 # Default
PerSenderRPS = 100 # Default
PerSenderBurst = 100 # Default
```


### GlobalRPS
```toml
GlobalRPS = 800 # Default
GlobalRPS = 200 # Default
```
GlobalRPS is the global rate limit for the dispatcher.

### GlobalBurst
```toml
GlobalBurst = 1000 # Default
GlobalBurst = 200 # Default
```
GlobalBurst is the global burst limit for the dispatcher.

### PerSenderRPS
```toml
PerSenderRPS = 10 # Default
PerSenderRPS = 100 # Default
```
PerSenderRPS is the per-sender rate limit for the dispatcher.

### PerSenderBurst
```toml
PerSenderBurst = 50 # Default
PerSenderBurst = 100 # Default
```
PerSenderBurst is the per-sender burst limit for the dispatcher.

Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/config/merge_raw_configs.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/default.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/defaults-override.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ SupportedVersion = 1
ReceiverBufferSize = 10000

[Capabilities.Dispatcher.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.ExternalRegistry]
Address = ''
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/disk-based-logging.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/fallback-override.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/invalid-ocr-p2p.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/invalid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/valid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down
8 changes: 4 additions & 4 deletions testdata/scripts/node/validate/warnings.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ TransmitConcurrency = 100

[Capabilities]
[Capabilities.RateLimit]
GlobalRPS = 800.0
GlobalBurst = 1000
PerSenderRPS = 10.0
PerSenderBurst = 50
GlobalRPS = 200.0
GlobalBurst = 200
PerSenderRPS = 100.0
PerSenderBurst = 100

[Capabilities.Peering]
IncomingMessageBufferSize = 10
Expand Down

0 comments on commit 078e8c1

Please sign in to comment.