From 4bc81041f8ee9b54e82387ce6f311efcf58bc6fc Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Wed, 30 Oct 2024 02:43:26 -0400 Subject: [PATCH 1/5] fix(ui): update route IDs for non-nested validator routes Auto-generated updates to non-nested route IDs in `routeTree.gen.ts` and `validators_.$validatorId.tsx` after upgrading `@tanstack/react-router` from v1.56.5 to v1.63.2. Routes are generated/processed when the UI's `dev` or `start` scripts are run. --- ui/src/routeTree.gen.ts | 16 ++++++++++------ ui/src/routes/validators_.$validatorId.tsx | 8 ++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ui/src/routeTree.gen.ts b/ui/src/routeTree.gen.ts index 5f6ee4ca..ab40b05b 100644 --- a/ui/src/routeTree.gen.ts +++ b/ui/src/routeTree.gen.ts @@ -19,21 +19,25 @@ import { Route as ValidatorsValidatorIdImport } from './routes/validators_.$vali // Create/Update Routes const ValidatorsRoute = ValidatorsImport.update({ + id: '/validators', path: '/validators', getParentRoute: () => rootRoute, } as any) const AddRoute = AddImport.update({ + id: '/add', path: '/add', getParentRoute: () => rootRoute, } as any) const IndexRoute = IndexImport.update({ + id: '/', path: '/', getParentRoute: () => rootRoute, } as any) const ValidatorsValidatorIdRoute = ValidatorsValidatorIdImport.update({ + id: '/validators_/$validatorId', path: '/validators/$validatorId', getParentRoute: () => rootRoute, } as any) @@ -63,8 +67,8 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ValidatorsImport parentRoute: typeof rootRoute } - '/validators/$validatorId': { - id: '/validators/$validatorId' + '/validators_/$validatorId': { + id: '/validators_/$validatorId' path: '/validators/$validatorId' fullPath: '/validators/$validatorId' preLoaderRoute: typeof ValidatorsValidatorIdImport @@ -94,7 +98,7 @@ export interface FileRoutesById { '/': typeof IndexRoute '/add': typeof AddRoute '/validators': typeof ValidatorsRoute - '/validators/$validatorId': typeof ValidatorsValidatorIdRoute + '/validators_/$validatorId': typeof ValidatorsValidatorIdRoute } export interface FileRouteTypes { @@ -102,7 +106,7 @@ export interface FileRouteTypes { fullPaths: '/' | '/add' | '/validators' | '/validators/$validatorId' fileRoutesByTo: FileRoutesByTo to: '/' | '/add' | '/validators' | '/validators/$validatorId' - id: '__root__' | '/' | '/add' | '/validators' | '/validators/$validatorId' + id: '__root__' | '/' | '/add' | '/validators' | '/validators_/$validatorId' fileRoutesById: FileRoutesById } @@ -135,7 +139,7 @@ export const routeTree = rootRoute "/", "/add", "/validators", - "/validators/$validatorId" + "/validators_/$validatorId" ] }, "/": { @@ -147,7 +151,7 @@ export const routeTree = rootRoute "/validators": { "filePath": "validators.tsx" }, - "/validators/$validatorId": { + "/validators_/$validatorId": { "filePath": "validators_.$validatorId.tsx" } } diff --git a/ui/src/routes/validators_.$validatorId.tsx b/ui/src/routes/validators_.$validatorId.tsx index 42921019..bce656b7 100644 --- a/ui/src/routes/validators_.$validatorId.tsx +++ b/ui/src/routes/validators_.$validatorId.tsx @@ -1,6 +1,3 @@ -import { useQuery, useSuspenseQuery } from '@tanstack/react-query' -import { ErrorComponent, createFileRoute } from '@tanstack/react-router' -import { useWallet } from '@txnlab/use-wallet-react' import { ValidatorNotFoundError } from '@/api/contracts' import { constraintsQueryOptions, stakesQueryOptions, validatorQueryOptions } from '@/api/queries' import { Loading } from '@/components/Loading' @@ -8,8 +5,11 @@ import { Meta } from '@/components/Meta' import { PageMain } from '@/components/PageMain' import { ValidatorDetails } from '@/components/ValidatorDetails' import { DetailsHeader } from '@/components/ValidatorDetails/DetailsHeader' +import { useQuery, useSuspenseQuery } from '@tanstack/react-query' +import { ErrorComponent, createFileRoute } from '@tanstack/react-router' +import { useWallet } from '@txnlab/use-wallet-react' -export const Route = createFileRoute('/validators/$validatorId')({ +export const Route = createFileRoute('/validators_/$validatorId')({ beforeLoad: () => { return { validatorQueryOptions, From 3962f9f9ef24c20dd24d2e52b7aeec03874df956 Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Wed, 30 Oct 2024 02:57:43 -0400 Subject: [PATCH 2/5] chore: fix import order --- ui/src/routes/validators_.$validatorId.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/routes/validators_.$validatorId.tsx b/ui/src/routes/validators_.$validatorId.tsx index bce656b7..487b8668 100644 --- a/ui/src/routes/validators_.$validatorId.tsx +++ b/ui/src/routes/validators_.$validatorId.tsx @@ -1,3 +1,6 @@ +import { useQuery, useSuspenseQuery } from '@tanstack/react-query' +import { ErrorComponent, createFileRoute } from '@tanstack/react-router' +import { useWallet } from '@txnlab/use-wallet-react' import { ValidatorNotFoundError } from '@/api/contracts' import { constraintsQueryOptions, stakesQueryOptions, validatorQueryOptions } from '@/api/queries' import { Loading } from '@/components/Loading' @@ -5,9 +8,6 @@ import { Meta } from '@/components/Meta' import { PageMain } from '@/components/PageMain' import { ValidatorDetails } from '@/components/ValidatorDetails' import { DetailsHeader } from '@/components/ValidatorDetails/DetailsHeader' -import { useQuery, useSuspenseQuery } from '@tanstack/react-query' -import { ErrorComponent, createFileRoute } from '@tanstack/react-router' -import { useWallet } from '@txnlab/use-wallet-react' export const Route = createFileRoute('/validators_/$validatorId')({ beforeLoad: () => { From 4004d3fa68f0dca64c90fdaefa66972a9d2b6494 Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Wed, 30 Oct 2024 03:11:41 -0400 Subject: [PATCH 3/5] fix(vscode): remove auto-organize imports setting --- .vscode/settings.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5857e4b7..a7ef377e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,6 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit", - "source.organizeImports": "explicit" - }, + "source.fixAll.eslint": "explicit" + } } From a2a552fd7e2fabe5c97b210ddf2267ef8e82a966 Mon Sep 17 00:00:00 2001 From: Patrick Bennett Date: Wed, 30 Oct 2024 22:50:01 -0400 Subject: [PATCH 4/5] chore(nodemgr): small logging adjustments * 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) --- contracts/__test__/contracts.test.ts | 4 ++++ nodemgr/app.go | 2 +- nodemgr/daemon.go | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/contracts/__test__/contracts.test.ts b/contracts/__test__/contracts.test.ts index 0a3f0a4a..4ec08b24 100644 --- a/contracts/__test__/contracts.test.ts +++ b/contracts/__test__/contracts.test.ts @@ -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 diff --git a/nodemgr/app.go b/nodemgr/app.go index f35e1578..45969b65 100644 --- a/nodemgr/app.go +++ b/nodemgr/app.go @@ -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, diff --git a/nodemgr/daemon.go b/nodemgr/daemon.go index 743bc59e..c84cf1df 100644 --- a/nodemgr/daemon.go +++ b/nodemgr/daemon.go @@ -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) @@ -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) } } } @@ -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 } From 685b2ebb4bfc60f2b9aa261c8893396b58788509 Mon Sep 17 00:00:00 2001 From: Patrick Bennett Date: Wed, 30 Oct 2024 22:50:31 -0400 Subject: [PATCH 5/5] chore: v0.11.8 --- contracts/bootstrap/package.json | 2 +- contracts/package.json | 2 +- ui/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/bootstrap/package.json b/contracts/bootstrap/package.json index e2146526..74c284e9 100644 --- a/contracts/bootstrap/package.json +++ b/contracts/bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap", - "version": "0.11.7", + "version": "0.11.8", "description": "", "main": "index.ts", "scripts": { diff --git a/contracts/package.json b/contracts/package.json index a14972aa..ec5230c2 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,6 +1,6 @@ { "name": "reti-contracts", - "version": "0.11.7", + "version": "0.11.8", "license": "MIT", "scripts": { "generate-client": "pnpx @algorandfoundation/algokit-client-generator@4.0.0-beta.5 generate -a contracts/artifacts/StakingPool.arc56_draft.json -o contracts/clients/StakingPoolClient.ts && pnpx @algorandfoundation/algokit-client-generator@4.0.0-beta.5 generate -a contracts/artifacts/ValidatorRegistry.arc56_draft.json -o contracts/clients/ValidatorRegistryClient.ts && ./update_contract_artifacts.sh", diff --git a/ui/package.json b/ui/package.json index 83b44212..666c4b16 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "reti-ui", - "version": "0.11.7", + "version": "0.11.8", "private": true, "type": "module", "engines": {