Skip to content

Commit e48efa3

Browse files
authored
chore: pull in latest snapchain protos and release new versions (#2656)
## Why is this change needed? Pull in latest snapchain protos for storage lending backfill. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview This PR primarily updates the versioning of several packages, introduces a new request interface for on-chain events migration, and enhances the `ShardInfo` structure by adding a `numOnchainEvents` field. It also updates dependencies across various packages. ### Detailed summary - Updated `@farcaster/core` version to `0.18.9` and other package versions accordingly. - Added `numOnchainEvents` field to `ShardInfo` in multiple generated files. - Introduced `RunOnchainEventsMigrationRequest` interface in `admin_rpc.ts`. - Added RPC methods for `getAllLendStorageMessagesByFid` and `runOnchainEventsMigration`. - Updated changelogs for `core`, `hub-web`, `hub-nodejs`, and `shuttle` packages. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent f1f2b4c commit e48efa3

File tree

18 files changed

+404
-13
lines changed

18 files changed

+404
-13
lines changed

.changeset/short-berries-look.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

generate-protos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PROTO_REPO=https://github.com/farcasterxyz/snapchain
22
PROTO_PATH=src/proto
3-
PROTO_REV=32fa4b1fa7e5ed32e271777d6854ee637678f4a9 # Update this if you want to generate off updated snapchain protos
3+
PROTO_REV=e634aa8789fa8196446ce1d68b459864b93a8780 # Update this if you want to generate off updated snapchain protos
44

55
TMPDIR=tmp-protogen
66
git clone $PROTO_REPO $TMPDIR

packages/core/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @farcaster/core
22

3+
## 0.18.9
4+
5+
### Patch Changes
6+
7+
- 7e602dc9: chore: pull in latest snapchain protos
8+
39
## 0.18.8
410

511
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@farcaster/core",
3-
"version": "0.18.8",
3+
"version": "0.18.9",
44
"main": "./dist/index.js",
55
"module": "./dist/index.mjs",
66
"types": "./dist/index.d.ts",

packages/core/src/protobufs/generated/admin_rpc.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export interface UploadSnapshotRequest {
2424
shardIndexes: number[];
2525
}
2626

27+
export interface RunOnchainEventsMigrationRequest {
28+
shardId: number;
29+
}
30+
2731
function createBaseEmpty(): Empty {
2832
return {};
2933
}
@@ -355,6 +359,66 @@ export const UploadSnapshotRequest = {
355359
},
356360
};
357361

362+
function createBaseRunOnchainEventsMigrationRequest(): RunOnchainEventsMigrationRequest {
363+
return { shardId: 0 };
364+
}
365+
366+
export const RunOnchainEventsMigrationRequest = {
367+
encode(message: RunOnchainEventsMigrationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
368+
if (message.shardId !== 0) {
369+
writer.uint32(8).uint64(message.shardId);
370+
}
371+
return writer;
372+
},
373+
374+
decode(input: _m0.Reader | Uint8Array, length?: number): RunOnchainEventsMigrationRequest {
375+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
376+
let end = length === undefined ? reader.len : reader.pos + length;
377+
const message = createBaseRunOnchainEventsMigrationRequest();
378+
while (reader.pos < end) {
379+
const tag = reader.uint32();
380+
switch (tag >>> 3) {
381+
case 1:
382+
if (tag != 8) {
383+
break;
384+
}
385+
386+
message.shardId = longToNumber(reader.uint64() as Long);
387+
continue;
388+
}
389+
if ((tag & 7) == 4 || tag == 0) {
390+
break;
391+
}
392+
reader.skipType(tag & 7);
393+
}
394+
return message;
395+
},
396+
397+
fromJSON(object: any): RunOnchainEventsMigrationRequest {
398+
return { shardId: isSet(object.shardId) ? Number(object.shardId) : 0 };
399+
},
400+
401+
toJSON(message: RunOnchainEventsMigrationRequest): unknown {
402+
const obj: any = {};
403+
message.shardId !== undefined && (obj.shardId = Math.round(message.shardId));
404+
return obj;
405+
},
406+
407+
create<I extends Exact<DeepPartial<RunOnchainEventsMigrationRequest>, I>>(
408+
base?: I,
409+
): RunOnchainEventsMigrationRequest {
410+
return RunOnchainEventsMigrationRequest.fromPartial(base ?? {});
411+
},
412+
413+
fromPartial<I extends Exact<DeepPartial<RunOnchainEventsMigrationRequest>, I>>(
414+
object: I,
415+
): RunOnchainEventsMigrationRequest {
416+
const message = createBaseRunOnchainEventsMigrationRequest();
417+
message.shardId = object.shardId ?? 0;
418+
return message;
419+
},
420+
};
421+
358422
declare var self: any | undefined;
359423
declare var window: any | undefined;
360424
declare var global: any | undefined;

packages/core/src/protobufs/generated/request_response.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export interface ShardInfo {
134134
approxSize: number;
135135
blockDelay: number;
136136
mempoolSize: number;
137+
numOnchainEvents: number;
137138
}
138139

139140
export interface GetInfoRequest {
@@ -806,6 +807,7 @@ function createBaseShardInfo(): ShardInfo {
806807
approxSize: 0,
807808
blockDelay: 0,
808809
mempoolSize: 0,
810+
numOnchainEvents: 0,
809811
};
810812
}
811813

@@ -832,6 +834,9 @@ export const ShardInfo = {
832834
if (message.mempoolSize !== 0) {
833835
writer.uint32(56).uint64(message.mempoolSize);
834836
}
837+
if (message.numOnchainEvents !== 0) {
838+
writer.uint32(64).uint64(message.numOnchainEvents);
839+
}
835840
return writer;
836841
},
837842

@@ -891,6 +896,13 @@ export const ShardInfo = {
891896

892897
message.mempoolSize = longToNumber(reader.uint64() as Long);
893898
continue;
899+
case 8:
900+
if (tag != 64) {
901+
break;
902+
}
903+
904+
message.numOnchainEvents = longToNumber(reader.uint64() as Long);
905+
continue;
894906
}
895907
if ((tag & 7) == 4 || tag == 0) {
896908
break;
@@ -909,6 +921,7 @@ export const ShardInfo = {
909921
approxSize: isSet(object.approxSize) ? Number(object.approxSize) : 0,
910922
blockDelay: isSet(object.blockDelay) ? Number(object.blockDelay) : 0,
911923
mempoolSize: isSet(object.mempoolSize) ? Number(object.mempoolSize) : 0,
924+
numOnchainEvents: isSet(object.numOnchainEvents) ? Number(object.numOnchainEvents) : 0,
912925
};
913926
},
914927

@@ -921,6 +934,7 @@ export const ShardInfo = {
921934
message.approxSize !== undefined && (obj.approxSize = Math.round(message.approxSize));
922935
message.blockDelay !== undefined && (obj.blockDelay = Math.round(message.blockDelay));
923936
message.mempoolSize !== undefined && (obj.mempoolSize = Math.round(message.mempoolSize));
937+
message.numOnchainEvents !== undefined && (obj.numOnchainEvents = Math.round(message.numOnchainEvents));
924938
return obj;
925939
},
926940

@@ -937,6 +951,7 @@ export const ShardInfo = {
937951
message.approxSize = object.approxSize ?? 0;
938952
message.blockDelay = object.blockDelay ?? 0;
939953
message.mempoolSize = object.mempoolSize ?? 0;
954+
message.numOnchainEvents = object.numOnchainEvents ?? 0;
940955
return message;
941956
},
942957
};

packages/hub-nodejs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @farcaster/hub-nodejs
22

3+
## 0.15.9
4+
5+
### Patch Changes
6+
7+
- 7e602dc9: chore: pull in latest snapchain protos
8+
- Updated dependencies [7e602dc9]
9+
- @farcaster/core@0.18.9
10+
311
## 0.15.8
412

513
### Patch Changes

packages/hub-nodejs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@farcaster/hub-nodejs",
3-
"version": "0.15.8",
3+
"version": "0.15.9",
44
"main": "./dist/index.js",
55
"module": "./dist/index.mjs",
66
"types": "./dist/index.d.ts",
@@ -20,7 +20,7 @@
2020
"url": "https://github.com/farcasterxyz/hub-monorepo/blob/main/packages/hub-nodejs"
2121
},
2222
"dependencies": {
23-
"@farcaster/core": "0.18.8",
23+
"@farcaster/core": "0.18.9",
2424
"@grpc/grpc-js": "~1.11.1",
2525
"@noble/hashes": "^1.3.0",
2626
"neverthrow": "^6.0.0"

packages/hub-nodejs/src/generated/admin_rpc.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export interface UploadSnapshotRequest {
3838
shardIndexes: number[];
3939
}
4040

41+
export interface RunOnchainEventsMigrationRequest {
42+
shardId: number;
43+
}
44+
4145
function createBaseEmpty(): Empty {
4246
return {};
4347
}
@@ -369,6 +373,66 @@ export const UploadSnapshotRequest = {
369373
},
370374
};
371375

376+
function createBaseRunOnchainEventsMigrationRequest(): RunOnchainEventsMigrationRequest {
377+
return { shardId: 0 };
378+
}
379+
380+
export const RunOnchainEventsMigrationRequest = {
381+
encode(message: RunOnchainEventsMigrationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
382+
if (message.shardId !== 0) {
383+
writer.uint32(8).uint64(message.shardId);
384+
}
385+
return writer;
386+
},
387+
388+
decode(input: _m0.Reader | Uint8Array, length?: number): RunOnchainEventsMigrationRequest {
389+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
390+
let end = length === undefined ? reader.len : reader.pos + length;
391+
const message = createBaseRunOnchainEventsMigrationRequest();
392+
while (reader.pos < end) {
393+
const tag = reader.uint32();
394+
switch (tag >>> 3) {
395+
case 1:
396+
if (tag != 8) {
397+
break;
398+
}
399+
400+
message.shardId = longToNumber(reader.uint64() as Long);
401+
continue;
402+
}
403+
if ((tag & 7) == 4 || tag == 0) {
404+
break;
405+
}
406+
reader.skipType(tag & 7);
407+
}
408+
return message;
409+
},
410+
411+
fromJSON(object: any): RunOnchainEventsMigrationRequest {
412+
return { shardId: isSet(object.shardId) ? Number(object.shardId) : 0 };
413+
},
414+
415+
toJSON(message: RunOnchainEventsMigrationRequest): unknown {
416+
const obj: any = {};
417+
message.shardId !== undefined && (obj.shardId = Math.round(message.shardId));
418+
return obj;
419+
},
420+
421+
create<I extends Exact<DeepPartial<RunOnchainEventsMigrationRequest>, I>>(
422+
base?: I,
423+
): RunOnchainEventsMigrationRequest {
424+
return RunOnchainEventsMigrationRequest.fromPartial(base ?? {});
425+
},
426+
427+
fromPartial<I extends Exact<DeepPartial<RunOnchainEventsMigrationRequest>, I>>(
428+
object: I,
429+
): RunOnchainEventsMigrationRequest {
430+
const message = createBaseRunOnchainEventsMigrationRequest();
431+
message.shardId = object.shardId ?? 0;
432+
return message;
433+
},
434+
};
435+
372436
export type AdminServiceService = typeof AdminServiceService;
373437
export const AdminServiceService = {
374438
submitOnChainEvent: {
@@ -417,6 +481,16 @@ export const AdminServiceService = {
417481
responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()),
418482
responseDeserialize: (value: Buffer) => Empty.decode(value),
419483
},
484+
runOnchainEventsMigration: {
485+
path: "/AdminService/RunOnchainEventsMigration",
486+
requestStream: false,
487+
responseStream: false,
488+
requestSerialize: (value: RunOnchainEventsMigrationRequest) =>
489+
Buffer.from(RunOnchainEventsMigrationRequest.encode(value).finish()),
490+
requestDeserialize: (value: Buffer) => RunOnchainEventsMigrationRequest.decode(value),
491+
responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()),
492+
responseDeserialize: (value: Buffer) => Empty.decode(value),
493+
},
420494
} as const;
421495

422496
export interface AdminServiceServer extends UntypedServiceImplementation {
@@ -425,6 +499,7 @@ export interface AdminServiceServer extends UntypedServiceImplementation {
425499
uploadSnapshot: handleUnaryCall<UploadSnapshotRequest, Empty>;
426500
retryOnchainEvents: handleUnaryCall<RetryOnchainEventsRequest, Empty>;
427501
retryFnameEvents: handleUnaryCall<RetryFnameRequest, Empty>;
502+
runOnchainEventsMigration: handleUnaryCall<RunOnchainEventsMigrationRequest, Empty>;
428503
}
429504

430505
export interface AdminServiceClient extends Client {
@@ -503,6 +578,21 @@ export interface AdminServiceClient extends Client {
503578
options: Partial<CallOptions>,
504579
callback: (error: ServiceError | null, response: Empty) => void,
505580
): ClientUnaryCall;
581+
runOnchainEventsMigration(
582+
request: RunOnchainEventsMigrationRequest,
583+
callback: (error: ServiceError | null, response: Empty) => void,
584+
): ClientUnaryCall;
585+
runOnchainEventsMigration(
586+
request: RunOnchainEventsMigrationRequest,
587+
metadata: Metadata,
588+
callback: (error: ServiceError | null, response: Empty) => void,
589+
): ClientUnaryCall;
590+
runOnchainEventsMigration(
591+
request: RunOnchainEventsMigrationRequest,
592+
metadata: Metadata,
593+
options: Partial<CallOptions>,
594+
callback: (error: ServiceError | null, response: Empty) => void,
595+
): ClientUnaryCall;
506596
}
507597

508598
export const AdminServiceClient = makeGenericClientConstructor(AdminServiceService, "AdminService") as unknown as {

packages/hub-nodejs/src/generated/request_response.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export interface ShardInfo {
134134
approxSize: number;
135135
blockDelay: number;
136136
mempoolSize: number;
137+
numOnchainEvents: number;
137138
}
138139

139140
export interface GetInfoRequest {
@@ -806,6 +807,7 @@ function createBaseShardInfo(): ShardInfo {
806807
approxSize: 0,
807808
blockDelay: 0,
808809
mempoolSize: 0,
810+
numOnchainEvents: 0,
809811
};
810812
}
811813

@@ -832,6 +834,9 @@ export const ShardInfo = {
832834
if (message.mempoolSize !== 0) {
833835
writer.uint32(56).uint64(message.mempoolSize);
834836
}
837+
if (message.numOnchainEvents !== 0) {
838+
writer.uint32(64).uint64(message.numOnchainEvents);
839+
}
835840
return writer;
836841
},
837842

@@ -891,6 +896,13 @@ export const ShardInfo = {
891896

892897
message.mempoolSize = longToNumber(reader.uint64() as Long);
893898
continue;
899+
case 8:
900+
if (tag != 64) {
901+
break;
902+
}
903+
904+
message.numOnchainEvents = longToNumber(reader.uint64() as Long);
905+
continue;
894906
}
895907
if ((tag & 7) == 4 || tag == 0) {
896908
break;
@@ -909,6 +921,7 @@ export const ShardInfo = {
909921
approxSize: isSet(object.approxSize) ? Number(object.approxSize) : 0,
910922
blockDelay: isSet(object.blockDelay) ? Number(object.blockDelay) : 0,
911923
mempoolSize: isSet(object.mempoolSize) ? Number(object.mempoolSize) : 0,
924+
numOnchainEvents: isSet(object.numOnchainEvents) ? Number(object.numOnchainEvents) : 0,
912925
};
913926
},
914927

@@ -921,6 +934,7 @@ export const ShardInfo = {
921934
message.approxSize !== undefined && (obj.approxSize = Math.round(message.approxSize));
922935
message.blockDelay !== undefined && (obj.blockDelay = Math.round(message.blockDelay));
923936
message.mempoolSize !== undefined && (obj.mempoolSize = Math.round(message.mempoolSize));
937+
message.numOnchainEvents !== undefined && (obj.numOnchainEvents = Math.round(message.numOnchainEvents));
924938
return obj;
925939
},
926940

@@ -937,6 +951,7 @@ export const ShardInfo = {
937951
message.approxSize = object.approxSize ?? 0;
938952
message.blockDelay = object.blockDelay ?? 0;
939953
message.mempoolSize = object.mempoolSize ?? 0;
954+
message.numOnchainEvents = object.numOnchainEvents ?? 0;
940955
return message;
941956
},
942957
};

0 commit comments

Comments
 (0)