Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7455ad8
feat: implement LightPush v3 protocol support
adklempner Jul 22, 2025
bab89ea
feat: handle both light push protocols
adklempner Jul 22, 2025
038f930
fix: unsubscribe test
adklempner Jul 23, 2025
4574613
feat: consolidate lpv2/v3 types
adklempner Jul 24, 2025
fec84c3
feat(tests): bump nwaku to 0.36.0
adklempner Jul 24, 2025
5f88887
fix: remove extraneous exports
adklempner Jul 25, 2025
6f309d9
fix: add delay to tests
adklempner Jul 25, 2025
f5cedc9
fix: remove protocol result types
adklempner Jul 29, 2025
20a7e3b
feat: consolidate light push codec branching
adklempner Jul 30, 2025
4979bf3
fix: revert nwaku image
adklempner Aug 1, 2025
7b84615
fix: remove multicodec
adklempner Aug 5, 2025
169fbf0
fix: remove protocolversion
adklempner Aug 9, 2025
d31c974
feat: simplify v2/v3 branching logic to use two stream managers
adklempner Aug 9, 2025
e296ac9
fix: remove unused utils
adklempner Aug 10, 2025
988bb4c
fix: remove comments
adklempner Aug 10, 2025
f9eaa2a
fix: revert store test
adklempner Aug 10, 2025
9ae3589
fix: cleanup lightpush sdk
adklempner Aug 10, 2025
df8cf88
fix: remove unused util
adklempner Aug 11, 2025
4f091e0
fix: remove unused exports
adklempner Aug 12, 2025
801b899
fix: rename file from public to protocol_handler
adklempner Aug 12, 2025
aa68533
fix: use proper type for sdk result
adklempner Aug 13, 2025
11879ba
fix: update return types in filter
adklempner Aug 13, 2025
dd27869
fix: rebase against latest master
adklempner Aug 13, 2025
e2ddac8
fix: use both lightpush codecs when waiting for peer
adklempner Aug 13, 2025
93ef27b
fix: handle both lp codecs
adklempner Aug 13, 2025
a536f61
fix: remove unused code
adklempner Aug 14, 2025
3735ec1
feat: use array for multicodec fields
adklempner Aug 14, 2025
406563a
fix: add timestamp if missing in v3 rpc
adklempner Aug 18, 2025
7896ba4
fix: resolve on either lp codec when waiting for peer
adklempner Aug 18, 2025
74682b7
fix: remove unused util
adklempner Aug 19, 2025
6c58606
fix: remove unnecessary abstraction
adklempner Aug 19, 2025
857e12c
feat: accept nwaku docker image as arg, test lp backwards compat
adklempner Aug 20, 2025
3ecaa13
fix: revert filter error
adklempner Aug 20, 2025
cc7d648
feat: add legacy flag to enable lightpushv2 only
adklempner Aug 22, 2025
c0ee9ec
Revert "feat: accept nwaku docker image as arg, test lp backwards com…
adklempner Aug 22, 2025
9915ab6
fix: remove unused test
adklempner Aug 23, 2025
8d536d4
feat: improve lp3 (#2597)
weboko Aug 29, 2025
90bdf0d
merge with master
weboko Sep 1, 2025
24fe74c
fix v2 v3 condition
weboko Sep 1, 2025
adf8408
generate message package earlier
weboko Sep 2, 2025
5dd9002
add log, fix condition
weboko Sep 3, 2025
ca1ff37
Merge branch 'master' into feat/lp-v3-sdk
weboko Sep 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export * as waku_filter from "./lib/filter/index.js";
export { FilterCore, FilterCodecs } from "./lib/filter/index.js";

export * as waku_light_push from "./lib/light_push/index.js";
export { LightPushCodec, LightPushCore } from "./lib/light_push/index.js";
export {
LightPushCore,
Comment thread
adklempner marked this conversation as resolved.
LightPushCodec,
LightPushCodecV2
} from "./lib/light_push/index.js";

export * as waku_store from "./lib/store/index.js";
export { StoreCore, StoreCodec } from "./lib/store/index.js";
Expand Down
36 changes: 18 additions & 18 deletions packages/core/src/lib/filter/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { PeerId } from "@libp2p/interface";
import type { IncomingStreamData } from "@libp2p/interface-internal";
import {
type ContentTopic,
type CoreProtocolResult,
type FilterCoreResult,
FilterError,
type Libp2p,
ProtocolError,
type PubsubTopic
} from "@waku/interfaces";
import { WakuMessage } from "@waku/proto";
Expand Down Expand Up @@ -72,14 +72,14 @@ export class FilterCore {
pubsubTopic: PubsubTopic,
peerId: PeerId,
contentTopics: ContentTopic[]
): Promise<CoreProtocolResult> {
): Promise<FilterCoreResult> {
const stream = await this.streamManager.getStream(peerId);

if (!stream) {
return {
success: null,
failure: {
error: ProtocolError.NO_STREAM_AVAILABLE,
error: FilterError.NO_STREAM_AVAILABLE,
peerId: peerId
}
};
Expand Down Expand Up @@ -108,7 +108,7 @@ export class FilterCore {
return {
success: null,
failure: {
error: ProtocolError.GENERIC_FAIL,
error: FilterError.GENERIC_FAIL,
peerId: peerId
}
};
Expand All @@ -123,7 +123,7 @@ export class FilterCore {
);
return {
failure: {
error: ProtocolError.REMOTE_PEER_REJECTED,
error: FilterError.REMOTE_PEER_REJECTED,
peerId: peerId
},
success: null
Expand All @@ -140,15 +140,15 @@ export class FilterCore {
pubsubTopic: PubsubTopic,
peerId: PeerId,
contentTopics: ContentTopic[]
): Promise<CoreProtocolResult> {
): Promise<FilterCoreResult> {
const stream = await this.streamManager.getStream(peerId);

if (!stream) {
log.error(`Failed to get a stream for remote peer:${peerId.toString()}`);
return {
success: null,
failure: {
error: ProtocolError.NO_STREAM_AVAILABLE,
error: FilterError.NO_STREAM_AVAILABLE,
peerId: peerId
}
};
Expand All @@ -166,7 +166,7 @@ export class FilterCore {
return {
success: null,
failure: {
error: ProtocolError.GENERIC_FAIL,
error: FilterError.GENERIC_FAIL,
peerId: peerId
}
};
Expand All @@ -181,15 +181,15 @@ export class FilterCore {
public async unsubscribeAll(
pubsubTopic: PubsubTopic,
peerId: PeerId
): Promise<CoreProtocolResult> {
): Promise<FilterCoreResult> {
const stream = await this.streamManager.getStream(peerId);

if (!stream) {
log.error(`Failed to get a stream for remote peer:${peerId.toString()}`);
return {
success: null,
failure: {
error: ProtocolError.NO_STREAM_AVAILABLE,
error: FilterError.NO_STREAM_AVAILABLE,
peerId: peerId
}
};
Expand All @@ -208,7 +208,7 @@ export class FilterCore {
if (!res || !res.length) {
return {
failure: {
error: ProtocolError.NO_RESPONSE,
error: FilterError.NO_RESPONSE,
peerId: peerId
},
success: null
Expand All @@ -224,7 +224,7 @@ export class FilterCore {
);
return {
failure: {
error: ProtocolError.REMOTE_PEER_REJECTED,
error: FilterError.REMOTE_PEER_REJECTED,
peerId: peerId
},
success: null
Expand All @@ -237,15 +237,15 @@ export class FilterCore {
};
}

public async ping(peerId: PeerId): Promise<CoreProtocolResult> {
public async ping(peerId: PeerId): Promise<FilterCoreResult> {
const stream = await this.streamManager.getStream(peerId);

if (!stream) {
log.error(`Failed to get a stream for remote peer:${peerId.toString()}`);
return {
success: null,
failure: {
error: ProtocolError.NO_STREAM_AVAILABLE,
error: FilterError.NO_STREAM_AVAILABLE,
peerId: peerId
}
};
Expand All @@ -267,7 +267,7 @@ export class FilterCore {
return {
success: null,
failure: {
error: ProtocolError.GENERIC_FAIL,
error: FilterError.GENERIC_FAIL,
peerId: peerId
}
};
Expand All @@ -277,7 +277,7 @@ export class FilterCore {
return {
success: null,
failure: {
error: ProtocolError.NO_RESPONSE,
error: FilterError.NO_RESPONSE,
peerId: peerId
}
};
Expand All @@ -293,7 +293,7 @@ export class FilterCore {
return {
success: null,
failure: {
error: ProtocolError.REMOTE_PEER_REJECTED,
error: FilterError.REMOTE_PEER_REJECTED,
peerId: peerId
}
};
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/lib/light_push/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const CODECS = {
v2: "/vac/waku/lightpush/2.0.0-beta1",
v3: "/vac/waku/lightpush/3.0.0"
} as const;

export const LightPushCodecV2 = CODECS.v2;
export const LightPushCodec = CODECS.v3;
3 changes: 2 additions & 1 deletion packages/core/src/lib/light_push/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { LightPushCore, LightPushCodec, PushResponse } from "./light_push.js";
export { LightPushCore } from "./light_push.js";
export { LightPushCodec, LightPushCodecV2 } from "./constants.js";
Loading
Loading