@nosana/node 1.1.19 → 1.1.20-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosana/node",
3
- "version": "1.1.19",
3
+ "version": "1.1.20-rc",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "nosana-node": "./dist/src/index.js"
@@ -15,10 +15,11 @@ export type RequestMarketResult = Pick<RequestMarketResponse, "status" | "market
15
15
  };
16
16
  benchmarkId?: string;
17
17
  nextTestAt?: string;
18
+ session?: string;
18
19
  };
19
20
  export declare class HostManager {
20
21
  static register(email: string, discord?: string, twitter?: string): Promise<void>;
21
- static requestMarket(market?: string): Promise<RequestMarketResult>;
22
+ static requestMarket(market?: string, session?: string): Promise<RequestMarketResult>;
22
23
  static submitBenchmarkResults(benchmarkId: string, body: SubmitBenchmarkBody): Promise<import("openapi-typescript-helpers").SuccessResponse<{
23
24
  200: {
24
25
  headers: {
@@ -12,11 +12,12 @@ export class HostManager {
12
12
  throw new Error(`Error registering node${error ? `: ${error}` : ""}`);
13
13
  }
14
14
  }
15
- static async requestMarket(market) {
15
+ static async requestMarket(market, session) {
16
16
  const { data, error, response } = await hostManagerClientSelector().GET("/nodes/request-market", {
17
17
  params: {
18
18
  query: {
19
- market
19
+ market,
20
+ session
20
21
  }
21
22
  }
22
23
  });
@@ -45,9 +46,11 @@ export class HostManager {
45
46
  sftTx: data.market.sftTx ?? undefined,
46
47
  };
47
48
  }
48
- const nextTestAt = data.nextTestAt;
49
- if (typeof nextTestAt === "string") {
50
- result.nextTestAt = nextTestAt;
49
+ if (data.nextTestAt) {
50
+ result.nextTestAt = data.nextTestAt;
51
+ }
52
+ if (data.session) {
53
+ result.session = data.session;
51
54
  }
52
55
  return result;
53
56
  }
@@ -15,7 +15,7 @@ export declare class MarketHandler {
15
15
  clear(): void;
16
16
  isInMarket(): boolean;
17
17
  setInMarket(): void;
18
- request(requestedMarket?: string): Promise<Market>;
18
+ request(requestedMarket?: string, session?: string): Promise<Market>;
19
19
  private logFeedbackReport;
20
20
  private logLatestMeasurements;
21
21
  check(market: string): Promise<Market>;
@@ -24,8 +24,8 @@ export class MarketHandler {
24
24
  setInMarket() {
25
25
  this.inMarket = true;
26
26
  }
27
- async request(requestedMarket) {
28
- const result = await HostManager.requestMarket(requestedMarket);
27
+ async request(requestedMarket, session) {
28
+ const result = await HostManager.requestMarket(requestedMarket, session);
29
29
  // Not registered - caller will handle registration and retry
30
30
  if (result.notRegistered) {
31
31
  throw new NodeNotRegisteredError();
@@ -38,7 +38,9 @@ export class MarketHandler {
38
38
  if (result.jobDefinition) {
39
39
  const benchmark = new Benchmark(result.benchmarkId ?? result.jobDefinition.id, result.jobDefinition, this.sdk, this.provider, this.repository);
40
40
  await benchmark.run();
41
- return await this.request(requestedMarket);
41
+ // Re-poll within the same request-market cycle, echoing the session the
42
+ // host issued so lifecycle metrics aren't re-requested on the retry.
43
+ return await this.request(requestedMarket, result.session ?? session);
42
44
  }
43
45
  // Sign and send SFT mint/burn transaction if provided
44
46
  if (result.market?.sftTx) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@nosana/node",
3
- "version": "1.1.19",
3
+ "version": "1.1.20-rc",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@nosana/node",
9
- "version": "1.1.19",
9
+ "version": "1.1.20-rc",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@coral-xyz/anchor": "^0.28.1-beta.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosana/node",
3
- "version": "1.1.19",
3
+ "version": "1.1.20-rc",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "nosana-node": "./dist/src/index.js"