Skip to content

Commit c6aa153

Browse files
committed
Shorten param name
1 parent 92c526d commit c6aa153

File tree

4 files changed

+154
-154
lines changed

4 files changed

+154
-154
lines changed

cmd/livepeer/starter/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func NewLivepeerConfig(fs *flag.FlagSet) LivepeerConfig {
100100
cfg.MaxTotalEV = fs.String("maxTotalEV", *cfg.MaxTotalEV, "The maximum acceptable expected value for one PM payment")
101101
// Broadcaster deposit multiplier to determine max acceptable ticket faceValue
102102
cfg.DepositMultiplier = fs.Int("depositMultiplier", *cfg.DepositMultiplier, "The deposit multiplier used to determine max acceptable faceValue for PM tickets")
103-
cfg.IgnoreSenderReserveRequirements = fs.Bool("ignoreSenderReserveRequirements", *cfg.IgnoreSenderReserveRequirements, "Skip sender reserve validation and rely solely on broadcaster deposits covering ticket face value (unsafe)")
103+
cfg.IgnoreSenderReserve = fs.Bool("IgnoreSenderReserve", *cfg.IgnoreSenderReserve, "Skip sender reserve validation and rely solely on broadcaster deposits covering ticket face value (unsafe)")
104104
// Orchestrator base pricing info
105105
cfg.PricePerUnit = fs.String("pricePerUnit", "0", "The price per 'pixelsPerUnit' amount pixels. Can be specified in wei or a custom currency in the format <price><currency> (e.g. 0.50USD). When using a custom currency, a corresponding price feed must be configured with -priceFeedAddr")
106106
// Unit of pixels for both O's pricePerUnit and B's maxPricePerUnit

cmd/livepeer/starter/starter.go

Lines changed: 148 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -80,113 +80,113 @@ const (
8080
)
8181

8282
type LivepeerConfig struct {
83-
Network *string
84-
RtmpAddr *string
85-
CliAddr *string
86-
HttpAddr *string
87-
ServiceAddr *string
88-
Nodes *string
89-
OrchAddr *string
90-
VerifierURL *string
91-
EthController *string
92-
VerifierPath *string
93-
LocalVerify *bool
94-
HttpIngest *bool
95-
Orchestrator *bool
96-
Transcoder *bool
97-
AIServiceRegistry *bool
98-
AIWorker *bool
99-
Gateway *bool
100-
Broadcaster *bool
101-
OrchSecret *string
102-
TranscodingOptions *string
103-
AIModels *string
104-
MaxAttempts *int
105-
SelectRandWeight *float64
106-
SelectStakeWeight *float64
107-
SelectPriceWeight *float64
108-
SelectPriceExpFactor *float64
109-
OrchPerfStatsURL *string
110-
Region *string
111-
MaxPricePerUnit *string
112-
MaxPricePerCapability *string
113-
IgnoreMaxPriceIfNeeded *bool
114-
MinPerfScore *float64
115-
DiscoveryTimeout *time.Duration
116-
ExtraNodes *int
117-
MaxSessions *string
118-
CurrentManifest *bool
119-
Nvidia *string
120-
Netint *string
121-
HevcDecoding *bool
122-
TestTranscoder *bool
123-
GatewayHost *string
124-
EthAcctAddr *string
125-
EthPassword *string
126-
EthKeystorePath *string
127-
EthOrchAddr *string
128-
EthUrl *string
129-
TxTimeout *time.Duration
130-
MaxTxReplacements *int
131-
GasLimit *int
132-
MinGasPrice *int64
133-
MaxGasPrice *int
134-
InitializeRound *bool
135-
InitializeRoundMaxDelay *time.Duration
136-
TicketEV *string
137-
MaxFaceValue *string
138-
MaxTicketEV *string
139-
MaxTotalEV *string
140-
DepositMultiplier *int
141-
IgnoreSenderReserveRequirements *bool
142-
PricePerUnit *string
143-
PixelsPerUnit *string
144-
PriceFeedAddr *string
145-
AutoAdjustPrice *bool
146-
PricePerGateway *string
147-
PricePerBroadcaster *string
148-
BlockPollingInterval *int
149-
Redeemer *bool
150-
RedeemerAddr *string
151-
Reward *bool
152-
Monitor *bool
153-
MetricsPerStream *bool
154-
MetricsExposeClientIP *bool
155-
MetadataQueueUri *string
156-
MetadataAmqpExchange *string
157-
MetadataPublishTimeout *time.Duration
158-
Datadir *string
159-
AIModelsDir *string
160-
Objectstore *string
161-
Recordstore *string
162-
FVfailGsBucket *string
163-
FVfailGsKey *string
164-
AuthWebhookURL *string
165-
LiveAIAuthWebhookURL *string
166-
LiveAITrickleHostForRunner *string
167-
OrchWebhookURL *string
168-
OrchBlacklist *string
169-
OrchMinLivepeerVersion *string
170-
TestOrchAvail *bool
171-
AIRunnerImage *string
172-
AIRunnerImageOverrides *string
173-
AIVerboseLogs *bool
174-
AIProcessingRetryTimeout *time.Duration
175-
AIRunnerContainersPerGPU *int
176-
AIMinRunnerVersion *string
177-
KafkaBootstrapServers *string
178-
KafkaUsername *string
179-
KafkaPassword *string
180-
KafkaGatewayTopic *string
181-
MediaMTXApiPassword *string
182-
LiveAIAuthApiKey *string
183-
LiveAIHeartbeatURL *string
184-
LiveAIHeartbeatHeaders *string
185-
LiveAIHeartbeatInterval *time.Duration
186-
LivePaymentInterval *time.Duration
187-
LiveOutSegmentTimeout *time.Duration
188-
LiveAICapRefreshModels *string
189-
LiveAISaveNSegments *int
83+
Network *string
84+
RtmpAddr *string
85+
CliAddr *string
86+
HttpAddr *string
87+
ServiceAddr *string
88+
Nodes *string
89+
OrchAddr *string
90+
VerifierURL *string
91+
EthController *string
92+
VerifierPath *string
93+
LocalVerify *bool
94+
HttpIngest *bool
95+
Orchestrator *bool
96+
Transcoder *bool
97+
AIServiceRegistry *bool
98+
AIWorker *bool
99+
Gateway *bool
100+
Broadcaster *bool
101+
OrchSecret *string
102+
TranscodingOptions *string
103+
AIModels *string
104+
MaxAttempts *int
105+
SelectRandWeight *float64
106+
SelectStakeWeight *float64
107+
SelectPriceWeight *float64
108+
SelectPriceExpFactor *float64
109+
OrchPerfStatsURL *string
110+
Region *string
111+
MaxPricePerUnit *string
112+
MaxPricePerCapability *string
113+
IgnoreMaxPriceIfNeeded *bool
114+
MinPerfScore *float64
115+
DiscoveryTimeout *time.Duration
116+
ExtraNodes *int
117+
MaxSessions *string
118+
CurrentManifest *bool
119+
Nvidia *string
120+
Netint *string
121+
HevcDecoding *bool
122+
TestTranscoder *bool
123+
GatewayHost *string
124+
EthAcctAddr *string
125+
EthPassword *string
126+
EthKeystorePath *string
127+
EthOrchAddr *string
128+
EthUrl *string
129+
TxTimeout *time.Duration
130+
MaxTxReplacements *int
131+
GasLimit *int
132+
MinGasPrice *int64
133+
MaxGasPrice *int
134+
InitializeRound *bool
135+
InitializeRoundMaxDelay *time.Duration
136+
TicketEV *string
137+
MaxFaceValue *string
138+
MaxTicketEV *string
139+
MaxTotalEV *string
140+
DepositMultiplier *int
141+
IgnoreSenderReserve *bool
142+
PricePerUnit *string
143+
PixelsPerUnit *string
144+
PriceFeedAddr *string
145+
AutoAdjustPrice *bool
146+
PricePerGateway *string
147+
PricePerBroadcaster *string
148+
BlockPollingInterval *int
149+
Redeemer *bool
150+
RedeemerAddr *string
151+
Reward *bool
152+
Monitor *bool
153+
MetricsPerStream *bool
154+
MetricsExposeClientIP *bool
155+
MetadataQueueUri *string
156+
MetadataAmqpExchange *string
157+
MetadataPublishTimeout *time.Duration
158+
Datadir *string
159+
AIModelsDir *string
160+
Objectstore *string
161+
Recordstore *string
162+
FVfailGsBucket *string
163+
FVfailGsKey *string
164+
AuthWebhookURL *string
165+
LiveAIAuthWebhookURL *string
166+
LiveAITrickleHostForRunner *string
167+
OrchWebhookURL *string
168+
OrchBlacklist *string
169+
OrchMinLivepeerVersion *string
170+
TestOrchAvail *bool
171+
AIRunnerImage *string
172+
AIRunnerImageOverrides *string
173+
AIVerboseLogs *bool
174+
AIProcessingRetryTimeout *time.Duration
175+
AIRunnerContainersPerGPU *int
176+
AIMinRunnerVersion *string
177+
KafkaBootstrapServers *string
178+
KafkaUsername *string
179+
KafkaPassword *string
180+
KafkaGatewayTopic *string
181+
MediaMTXApiPassword *string
182+
LiveAIAuthApiKey *string
183+
LiveAIHeartbeatURL *string
184+
LiveAIHeartbeatHeaders *string
185+
LiveAIHeartbeatInterval *time.Duration
186+
LivePaymentInterval *time.Duration
187+
LiveOutSegmentTimeout *time.Duration
188+
LiveAICapRefreshModels *string
189+
LiveAISaveNSegments *int
190190
}
191191

192192
// DefaultLivepeerConfig creates LivepeerConfig exactly the same as when no flags are passed to the livepeer process.
@@ -264,7 +264,7 @@ func DefaultLivepeerConfig() LivepeerConfig {
264264
defaultMaxPricePerUnit := "0"
265265
defaultMaxPricePerCapability := ""
266266
defaultIgnoreMaxPriceIfNeeded := false
267-
defaultIgnoreSenderReserveRequirements := false
267+
defaultIgnoreSenderReserve := false
268268
defaultPixelsPerUnit := "1"
269269
defaultPriceFeedAddr := "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612" // ETH / USD price feed address on Arbitrum Mainnet
270270
defaultAutoAdjustPrice := true
@@ -363,41 +363,41 @@ func DefaultLivepeerConfig() LivepeerConfig {
363363
LiveAIHeartbeatInterval: &defaultLiveAIHeartbeatInterval,
364364

365365
// Onchain:
366-
EthAcctAddr: &defaultEthAcctAddr,
367-
EthPassword: &defaultEthPassword,
368-
EthKeystorePath: &defaultEthKeystorePath,
369-
EthOrchAddr: &defaultEthOrchAddr,
370-
EthUrl: &defaultEthUrl,
371-
TxTimeout: &defaultTxTimeout,
372-
MaxTxReplacements: &defaultMaxTxReplacements,
373-
GasLimit: &defaultGasLimit,
374-
MaxGasPrice: &defaultMaxGasPrice,
375-
EthController: &defaultEthController,
376-
InitializeRound: &defaultInitializeRound,
377-
InitializeRoundMaxDelay: &defaultInitializeRoundMaxDelay,
378-
TicketEV: &defaultTicketEV,
379-
MaxFaceValue: &defaultMaxFaceValue,
380-
MaxTicketEV: &defaultMaxTicketEV,
381-
MaxTotalEV: &defaultMaxTotalEV,
382-
DepositMultiplier: &defaultDepositMultiplier,
383-
IgnoreSenderReserveRequirements: &defaultIgnoreSenderReserveRequirements,
384-
MaxPricePerUnit: &defaultMaxPricePerUnit,
385-
MaxPricePerCapability: &defaultMaxPricePerCapability,
386-
IgnoreMaxPriceIfNeeded: &defaultIgnoreMaxPriceIfNeeded,
387-
PixelsPerUnit: &defaultPixelsPerUnit,
388-
PriceFeedAddr: &defaultPriceFeedAddr,
389-
AutoAdjustPrice: &defaultAutoAdjustPrice,
390-
PricePerGateway: &defaultPricePerGateway,
391-
PricePerBroadcaster: &defaultPricePerBroadcaster,
392-
BlockPollingInterval: &defaultBlockPollingInterval,
393-
Redeemer: &defaultRedeemer,
394-
RedeemerAddr: &defaultRedeemerAddr,
395-
Monitor: &defaultMonitor,
396-
MetricsPerStream: &defaultMetricsPerStream,
397-
MetricsExposeClientIP: &defaultMetricsExposeClientIP,
398-
MetadataQueueUri: &defaultMetadataQueueUri,
399-
MetadataAmqpExchange: &defaultMetadataAmqpExchange,
400-
MetadataPublishTimeout: &defaultMetadataPublishTimeout,
366+
EthAcctAddr: &defaultEthAcctAddr,
367+
EthPassword: &defaultEthPassword,
368+
EthKeystorePath: &defaultEthKeystorePath,
369+
EthOrchAddr: &defaultEthOrchAddr,
370+
EthUrl: &defaultEthUrl,
371+
TxTimeout: &defaultTxTimeout,
372+
MaxTxReplacements: &defaultMaxTxReplacements,
373+
GasLimit: &defaultGasLimit,
374+
MaxGasPrice: &defaultMaxGasPrice,
375+
EthController: &defaultEthController,
376+
InitializeRound: &defaultInitializeRound,
377+
InitializeRoundMaxDelay: &defaultInitializeRoundMaxDelay,
378+
TicketEV: &defaultTicketEV,
379+
MaxFaceValue: &defaultMaxFaceValue,
380+
MaxTicketEV: &defaultMaxTicketEV,
381+
MaxTotalEV: &defaultMaxTotalEV,
382+
DepositMultiplier: &defaultDepositMultiplier,
383+
IgnoreSenderReserve: &defaultIgnoreSenderReserve,
384+
MaxPricePerUnit: &defaultMaxPricePerUnit,
385+
MaxPricePerCapability: &defaultMaxPricePerCapability,
386+
IgnoreMaxPriceIfNeeded: &defaultIgnoreMaxPriceIfNeeded,
387+
PixelsPerUnit: &defaultPixelsPerUnit,
388+
PriceFeedAddr: &defaultPriceFeedAddr,
389+
AutoAdjustPrice: &defaultAutoAdjustPrice,
390+
PricePerGateway: &defaultPricePerGateway,
391+
PricePerBroadcaster: &defaultPricePerBroadcaster,
392+
BlockPollingInterval: &defaultBlockPollingInterval,
393+
Redeemer: &defaultRedeemer,
394+
RedeemerAddr: &defaultRedeemerAddr,
395+
Monitor: &defaultMonitor,
396+
MetricsPerStream: &defaultMetricsPerStream,
397+
MetricsExposeClientIP: &defaultMetricsExposeClientIP,
398+
MetadataQueueUri: &defaultMetadataQueueUri,
399+
MetadataAmqpExchange: &defaultMetadataAmqpExchange,
400+
MetadataPublishTimeout: &defaultMetadataPublishTimeout,
401401

402402
// Ingest:
403403
HttpIngest: &defaultHttpIngest,
@@ -1018,10 +1018,10 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
10181018
defer sm.Stop()
10191019

10201020
tcfg := pm.TicketParamsConfig{
1021-
EV: ev,
1022-
RedeemGas: redeemGas,
1023-
TxCostMultiplier: txCostMultiplier,
1024-
IgnoreSenderReserveRequirements: *cfg.IgnoreSenderReserveRequirements,
1021+
EV: ev,
1022+
RedeemGas: redeemGas,
1023+
TxCostMultiplier: txCostMultiplier,
1024+
IgnoreSenderReserve: *cfg.IgnoreSenderReserve,
10251025
}
10261026
n.Recipient, err = pm.NewRecipient(
10271027
recipientAddr,
@@ -1036,7 +1036,7 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
10361036
glog.Errorf("Error setting up PM recipient: %v", err)
10371037
return
10381038
}
1039-
if *cfg.IgnoreSenderReserveRequirements {
1039+
if *cfg.IgnoreSenderReserve {
10401040
glog.Warning("Sender reserve requirements disabled; relying on broadcaster deposit to cover ticket face value. Double-spend protection is reduced.")
10411041
}
10421042
mfv, _ := new(big.Int).SetString(*cfg.MaxFaceValue, 10)

pm/recipient.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ type TicketParamsConfig struct {
7070
// cost for redemption
7171
TxCostMultiplier int
7272

73-
// IgnoreSenderReserveRequirements instructs the recipient to skip sender reserve checks and accept tickets as long as the computed face value meets EV requirements
74-
IgnoreSenderReserveRequirements bool
73+
// IgnoreSenderReserve instructs the recipient to skip sender reserve checks and accept tickets as long as the computed face value meets EV requirements
74+
IgnoreSenderReserve bool
7575
}
7676

7777
// GasPriceMonitor defines methods for monitoring gas prices
@@ -275,7 +275,7 @@ func (r *recipient) faceValue(sender ethcommon.Address) (*big.Int, error) {
275275
}
276276

277277
var maxFloat *big.Int
278-
if !r.cfg.IgnoreSenderReserveRequirements {
278+
if !r.cfg.IgnoreSenderReserve {
279279
// Fetch current max float for sender
280280
var err error
281281
maxFloat, err = r.sm.MaxFloat(sender)

pm/recipient_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ func TestTicketParams(t *testing.T) {
531531
assert.EqualError(err, errInsufficientSenderReserve.Error())
532532

533533
// Test ignoring sender reserve requirements bypasses maxFloat enforcement
534-
cfg.IgnoreSenderReserveRequirements = true
534+
cfg.IgnoreSenderReserve = true
535535
sm.maxFloat = big.NewInt(100)
536536
sm.deposit = new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)
537537
rIgnore := NewRecipientWithSecret(recipient, b, v, gm, sm, tm, secret, cfg)
@@ -543,7 +543,7 @@ func TestTicketParams(t *testing.T) {
543543
sm.deposit = new(big.Int).Sub(paramsIgnore.FaceValue, big.NewInt(1))
544544
_, err = rIgnore.TicketParams(sender, big.NewRat(1, 1))
545545
assert.EqualError(err, errInsufficientSenderReserve.Error())
546-
cfg.IgnoreSenderReserveRequirements = false
546+
cfg.IgnoreSenderReserve = false
547547

548548
// Test faceValue < txCostWithGasPrice(current gasPrice) and faceValue > txCostWithGasPrice(avg gasPrice)
549549
// Set current gasPrice higher than avg gasPrice

0 commit comments

Comments
 (0)