Skip to content

Commit

Permalink
chore(nodemgr): small logging adjustments
Browse files Browse the repository at this point in the history
* Changed log level of average block time message to debug for less noisy logs.
* log message when new algod version is detected that differs from pool (and showing pool was updated)
  • Loading branch information
pbennett committed Oct 31, 2024
1 parent 5d03293 commit a2a552f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions contracts/__test__/contracts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ describe('reti', () => {
const composer = validatorMasterClient
.newGroup()
.initStakingContract({ args: { approvalProgramSize: stakingApprovalProgram.length } })
// simple sanity check for checking on contract sizes
consoleLogger.info(
`registry size:${result.compiledApproval?.compiledBase64ToBytes.length}, pool size:${stakingApprovalProgram.length}`,
)

// load the StakingPool contract into box storage of the validator
// call loadStakingContractData - chunking the data from approvalCompiled 2000 bytes at a time
Expand Down
2 changes: 1 addition & 1 deletion nodemgr/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func initApp() *RetiApp {
logger = slog.New(misc.NewMinimalHandler(os.Stdout,
misc.MinimalHandlerOptions{SlogOpts: slog.HandlerOptions{Level: logLevel, AddSource: true}}))
} else {
// not on console - output as json, but change json key names to be more compatibl w/ what google logging
// not on console - output as json, but change json key names to be more compatible w/ what google logging
// expects
opts := &slog.HandlerOptions{
AddSource: true,
Expand Down
5 changes: 3 additions & 2 deletions nodemgr/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (d *Daemon) updatePoolVersions(ctx context.Context) {
}
versString = fmt.Sprintf("%s : %s", versString, getVersionInfo())

for _, poolAppId := range App.retiClient.Info().LocalPools {
for poolId, poolAppId := range App.retiClient.Info().LocalPools {
algodVer, err := App.retiClient.GetAlgodVer(poolAppId)
if err != nil && !errors.Is(err, algo.ErrStateKeyNotFound) {
misc.Errorf(d.logger, "unable to fetch algod version from staking pool app id:%d, err:%v", poolAppId, err)
Expand All @@ -250,6 +250,7 @@ func (d *Daemon) updatePoolVersions(ctx context.Context) {
misc.Errorf(d.logger, "unable to update algod version in staking pool app id:%d, err:%v", poolAppId, err)
return
}
misc.Infof(d.logger, "new algod version detected. Updated to:%s in pool:%d", versString, poolId)
}
}
}
Expand All @@ -273,7 +274,7 @@ func (d *Daemon) setAverageBlockTime(ctx context.Context) error {
d.Lock()
d.avgBlockTime = blockTime
d.Unlock()
misc.Infof(d.logger, "average block time set to:%v", d.AverageBlockTime())
misc.Debugf(d.logger, "average block time set to:%v", d.AverageBlockTime())
return nil
}

Expand Down

0 comments on commit a2a552f

Please sign in to comment.