Skip to content

Commit

Permalink
CR: config renaming/comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Nov 8, 2023
1 parent 8c4c28b commit eb977e2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,12 @@ type Local struct {
// TxBacklogAppTxPerSecondRate determines a target app per second rate for the app tx rate limiter
TxBacklogAppTxPerSecondRate int `version[32]:"100"`

// TxBacklogRateLimitingCongestionRatio determines the backlog filling threashold in percents at which app limiter kicks in
// TxBacklogRateLimitingCongestionRatio determines the backlog filling threshold percentage at which the app limiter kicks in
// or the tx backlog rate limiter kicks off.
TxBacklogRateLimitingCongestionPct int `version[32]:"50"`

// EnableAppTxBacklogRateLimiting controls if an app rate limiter should be attached to the tx backlog enqueue process
EnableAppTxBacklogRateLimiting bool `version[32]:"true"`
// EnableTxBacklogAppRateLimiting controls if an app rate limiter should be attached to the tx backlog enqueue process
EnableTxBacklogAppRateLimiting bool `version[32]:"true"`

// EnableTxBacklogRateLimiting controls if a rate limiter and congestion manager should be attached to the tx backlog enqueue process
// if enabled, the over-all TXBacklog Size will be larger by MAX_PEERS*TxBacklogReservedCapacityPerPeer
Expand Down
2 changes: 1 addition & 1 deletion config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ var defaultLocal = Local{
EnableAccountUpdatesStats: false,
EnableAgreementReporting: false,
EnableAgreementTimeMetrics: false,
EnableAppTxBacklogRateLimiting: true,
EnableAssembleStats: false,
EnableBlockService: false,
EnableBlockServiceFallbackToArchiver: false,
Expand All @@ -82,6 +81,7 @@ var defaultLocal = Local{
EnableRequestLogger: false,
EnableRuntimeMetrics: false,
EnableTopAccountsReporting: false,
EnableTxBacklogAppRateLimiting: true,
EnableTxBacklogRateLimiting: true,
EnableTxnEvalTracer: false,
EnableUsageLog: false,
Expand Down
6 changes: 3 additions & 3 deletions data/txHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ func MakeTxHandler(opts TxHandlerOpts) (*TxHandler, error) {
handler.txCanonicalCache = makeDigestCache(int(opts.Config.TxIncomingFilterMaxSize))
}

if opts.Config.EnableTxBacklogRateLimiting || opts.Config.EnableAppTxBacklogRateLimiting {
if opts.Config.EnableTxBacklogRateLimiting || opts.Config.EnableTxBacklogAppRateLimiting {
if opts.Config.TxBacklogRateLimitingCongestionPct > 100 || opts.Config.TxBacklogRateLimitingCongestionPct < 0 {
return nil, fmt.Errorf("invalid value for TxBacklogRateLimitingCongestionPct: %d", opts.Config.TxBacklogRateLimitingCongestionPct)

Check warning on line 186 in data/txHandler.go

View check run for this annotation

Codecov / codecov/patch

data/txHandler.go#L186

Added line #L186 was not covered by tests
}
if opts.Config.EnableAppTxBacklogRateLimiting && opts.Config.TxBacklogAppTxRateLimiterMaxSize == 0 {
if opts.Config.EnableTxBacklogAppRateLimiting && opts.Config.TxBacklogAppTxRateLimiterMaxSize == 0 {
return nil, fmt.Errorf("invalid value for TxBacklogAppTxRateLimiterMaxSize: %d. App rate limiter enabled with zero size", opts.Config.TxBacklogAppTxRateLimiterMaxSize)

Check warning on line 189 in data/txHandler.go

View check run for this annotation

Codecov / codecov/patch

data/txHandler.go#L189

Added line #L189 was not covered by tests
}
handler.backlogCongestionThreshold = float64(opts.Config.TxBacklogRateLimitingCongestionPct) / 100
Expand All @@ -197,7 +197,7 @@ func MakeTxHandler(opts TxHandlerOpts) (*TxHandler, error) {
txBacklogDroppedCongestionManagement,
)
}
if opts.Config.EnableAppTxBacklogRateLimiting {
if opts.Config.EnableTxBacklogAppRateLimiting {
handler.appLimiter = makeAppRateLimiter(
opts.Config.TxBacklogAppTxRateLimiterMaxSize,
uint64(opts.Config.TxBacklogAppTxPerSecondRate),
Expand Down
6 changes: 3 additions & 3 deletions data/txHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@ func TestTxHandlerAppRateLimiterERLEnabled(t *testing.T) {

func() {
cfg.EnableTxBacklogRateLimiting = false
cfg.EnableAppTxBacklogRateLimiting = false
cfg.EnableTxBacklogAppRateLimiting = false
handler, err := makeTestTxHandler(l, cfg)
require.NoError(t, err)
defer handler.txVerificationPool.Shutdown()
Expand All @@ -2545,7 +2545,7 @@ func TestTxHandlerAppRateLimiterERLEnabled(t *testing.T) {

func() {
cfg.EnableTxBacklogRateLimiting = true
cfg.EnableAppTxBacklogRateLimiting = false
cfg.EnableTxBacklogAppRateLimiting = false
handler, err := makeTestTxHandler(l, cfg)
require.NoError(t, err)
defer handler.txVerificationPool.Shutdown()
Expand All @@ -2556,7 +2556,7 @@ func TestTxHandlerAppRateLimiterERLEnabled(t *testing.T) {
}()

cfg.EnableTxBacklogRateLimiting = true
cfg.EnableAppTxBacklogRateLimiting = true
cfg.EnableTxBacklogAppRateLimiting = true
handler, err := makeTestTxHandler(l, cfg)
require.NoError(t, err)
defer handler.txVerificationPool.Shutdown()
Expand Down
2 changes: 1 addition & 1 deletion installer/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"EnableAccountUpdatesStats": false,
"EnableAgreementReporting": false,
"EnableAgreementTimeMetrics": false,
"EnableAppTxBacklogRateLimiting": true,
"EnableAssembleStats": false,
"EnableBlockService": false,
"EnableBlockServiceFallbackToArchiver": false,
Expand All @@ -61,6 +60,7 @@
"EnableRequestLogger": false,
"EnableRuntimeMetrics": false,
"EnableTopAccountsReporting": false,
"EnableTxBacklogAppRateLimiting": true,
"EnableTxBacklogRateLimiting": true,
"EnableTxnEvalTracer": false,
"EnableUsageLog": false,
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v32.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"EnableAccountUpdatesStats": false,
"EnableAgreementReporting": false,
"EnableAgreementTimeMetrics": false,
"EnableAppTxBacklogRateLimiting": true,
"EnableAssembleStats": false,
"EnableBlockService": false,
"EnableBlockServiceFallbackToArchiver": false,
Expand All @@ -61,6 +60,7 @@
"EnableRequestLogger": false,
"EnableRuntimeMetrics": false,
"EnableTopAccountsReporting": false,
"EnableTxBacklogAppRateLimiting": true,
"EnableTxBacklogRateLimiting": true,
"EnableTxnEvalTracer": false,
"EnableUsageLog": false,
Expand Down

0 comments on commit eb977e2

Please sign in to comment.