Global Feed Post Login
Replying to Avatar Mike Dilger ☑️

GOSSIP:

I have basic spam filtering via script working on a development branch. I'll need to optimize it and make pages for editing your script. But basically you create a script like this:

fn filter() {

if content.contains("AirDrop") {

0

} else if content.contains("Ukraine") {

0

} else {

1

}

}

0 means deny, 1 means allow, and 2 means "mute the author". The data available to the script (as scoped variables) inlcudes 'id' (hex string) 'pubkey' (hex string) 'kind' (integer) and 'content' (string). I may pass in 'now' (integer) too. The scripting language is pretty extensive. If people come up with good filtering ideas and need more variables passed in, I can enhance it.

I'm having a hard time figuring out how to spam block messages from random new pubkeys with randomized content. What is the algorithm to stop that? Maybe I should make an entropy calculation function, if the entropy is high it is probably not a human readable language.

72
nobody 2y ago

What has the performance penalty looked like so far?

Reply to this note

Please Login to reply.

Discussion

Avatar
Mike Dilger ☑️ 2y ago

Even without pre-compiling the AST, the performance is negligable. Waiting for the network for events to flow in is the gating factor by far. Most of the time gossip isn't doing anything. But I want to pre-compile the AST.

Thread collapsed