Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

feat: Packet-level filtering#275

Merged
webmaster128 merged 6 commits into
confio:mainfrom
clockworkgr:feat/packet-filtering
Nov 29, 2023
Merged

feat: Packet-level filtering#275
webmaster128 merged 6 commits into
confio:mainfrom
clockworkgr:feat/packet-filtering

Conversation

@clockworkgr

Copy link
Copy Markdown
Contributor

This PR adds the option to only relay specific packets that are of interest to the app developer.

In order to avoid unnecessary development and maintenance overhead, the filtering mechanism is left entirely to the app developer.

This is achieved by defining a new function type: PacketFilter that takes a Packet as an argument and returns true if it should be relayed and false if it should be ignored.

Implementation of this function is left to the application developer and can be used by setting it via link.setFilter(packetFilter: PacketFilter) on the Link instance.

This PR also includes the complementary Link.clearFilter() method.

@changeset-bot

changeset-bot Bot commented Nov 28, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2835b3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@confio/relayer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@webmaster128 webmaster128 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering looks good to me, just the newline

Comment thread src/lib/link.ts
@clockworkgr clockworkgr force-pushed the feat/packet-filtering branch from 82371e8 to 9075249 Compare November 29, 2023 09:44
@webmaster128 webmaster128 merged commit 85ac504 into confio:main Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants