Skip to content

Commit

Permalink
TRASH test debug logging for config poller in staging
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Dec 19, 2024
1 parent 72fd6a4 commit efb3b9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/services/relay/evm/llo/config_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ func newConfigPoller(lggr logger.Logger, lp LogPoller, cc ConfigCache, addr comm
Name: "LLOConfigPoller",
}.NewServiceEngine(logger.Sugared(lggr).Named(string(instanceType)).With("instanceType", instanceType))

lggr.Debugw("TRASH New ConfigPoller", "donID", donID, "addr", addr, "instanceType", instanceType, "fromBlock", fromBlock)

return cp
}

Expand Down Expand Up @@ -144,6 +146,7 @@ func (cp *configPoller) latestConfig(ctx context.Context, fromBlock, toBlock int
}
switch log.EventSig {
case ProductionConfigSet:
cp.eng.SugaredLogger.Debugw("TRASH ProductionConfigSet", "log", log, "instanceType", cp.instanceType)
event, err := DecodeProductionConfigSetLog(log.Data)
if err != nil {
return latestConfig, log, fmt.Errorf("failed to unpack ProductionConfigSet log data: %w", err)
Expand All @@ -154,6 +157,7 @@ func (cp *configPoller) latestConfig(ctx context.Context, fromBlock, toBlock int
}

isProduction := (cp.instanceType != InstanceTypeBlue) == event.IsGreenProduction
cp.eng.SugaredLogger.Debugw("TRASH ProductionConfigSet", "isProduction", isProduction, "instanceType", cp.instanceType, "event.IsGreenProduction", event.IsGreenProduction)
if isProduction {
latestLog = log
latestConfig, err = FullConfigFromProductionConfigSet(event)
Expand All @@ -162,6 +166,7 @@ func (cp *configPoller) latestConfig(ctx context.Context, fromBlock, toBlock int
}
}
case StagingConfigSet:
cp.eng.SugaredLogger.Debugw("TRASH StagingConfigSet", "log", log, "instanceType", cp.instanceType)
event, err := DecodeStagingConfigSetLog(log.Data)
if err != nil {
return latestConfig, latestLog, fmt.Errorf("failed to unpack ProductionConfigSet log data: %w", err)
Expand All @@ -172,6 +177,7 @@ func (cp *configPoller) latestConfig(ctx context.Context, fromBlock, toBlock int
}

isProduction := (cp.instanceType != InstanceTypeBlue) == event.IsGreenProduction
cp.eng.SugaredLogger.Debugw("TRASH StagingConfigSet", "isProduction", isProduction, "instanceType", cp.instanceType, "event.IsGreenProduction", event.IsGreenProduction)
if !isProduction {
latestLog = log
latestConfig, err = FullConfigFromStagingConfigSet(event)
Expand All @@ -194,6 +200,9 @@ func (cp *configPoller) LatestConfig(ctx context.Context, changedInBlock uint64)
if err != nil {
return ocrtypes.ContractConfig{}, fmt.Errorf("failed to get latest config: %w", err)
}
if cfg.donID > 0 {
cp.eng.SugaredLogger.Debugw("TRASH returning config", "cfg", cfg, "instanceType", cp.instanceType, "donID", cfg.donID)
}
return cfg.ContractConfig, nil
}

Expand Down
1 change: 1 addition & 0 deletions core/services/relay/evm/llo_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func (p *lloProvider) ContractConfigTrackers() (cps []ocrtypes.ContractConfigTra
for i, cp := range p.cps {
cps[i] = cp
}
p.eng.SugaredLogger.Debugw("TRASH ContractConfigTrackers", "cps", cps)
return
}

Expand Down

0 comments on commit efb3b9f

Please sign in to comment.