提升 @anti-phishing 反钓鱼机器人响应速度 / 最新块以及不可回退块

in #anti-phishing7 years ago

在之前的文章中,我介绍了我新上线的反钓鱼机器人

hacker-1944688_960_720.jpg

响应速度的重要性

机器人上线后,很负责任,昨天又监测到诈骗账户的一系列帖子并予以处理。

我看了一下处理记录,基本上在一分钟左右处理的,比如最下边的一条记录

  • 诈骗账户发文时间为:2017-10-27 09:02:48
  • @anti-phishing差评时间为:2017-10-27T09:04:00

中间耗时为1分钟12秒。

我们很高兴看到 @cheetah 以及 @steemcleaners 都行动了起来。
但是略为遗憾的是 @steemcleaners 的差评落后了近 50分钟,这个时间差,足已让很多人上当了。

但是 @anti-phishing 落后一分钟,就不存在问题吗?显然不是,处理的时间越晚,别人被骗的概率越高。所以如何提升响应速度,对于 @anti-phishing 反钓鱼机器人而言,有重要的意义。

如何提升响应速度

说到如何提升响应速度,我们需要先了解一下最新区块以及不可回退的区块

顾名思义,最新区块 就是steem 区块链上最新的区块(好像是废话啊?)不可回退的区块,就是对应区块里的操作都不可回退。(哎,太技术的我解释不清楚,就这么回事吧)

https://steemd.com/ 首页右侧,我们可以看到

(最新区块的数值为:16,715,679)


(最后一个不可回退块的数值为:16,715,662)

不可回退块 比 最新区块落后了 17个块,这个数值不是固定的,但是一般情况是20个块左右。

steem区块间隔是3秒(STEEMIT_BLOCK_INTERVAL),如果20个块,那么就是落后一分钟。

如果用于交易充值确认,那么我们当然要使用不可回退的块。如果用于点赞机器人等,因为30分钟内有早鸟惩罚,所以在文章发布一两分钟内就急着点赞没什么特别的好处。所以无论怎么看,用不可回退块来处理点赞什么的都没问题,除了用于反钓鱼机器人

用于反钓鱼机器人,我们没必要纠结是否是不可回退块,读取最新块即可。

所以读取区块时,我们应该使用head_block_number 而不是 last_irreversible_block_num

响应速度

按照上述思路,我对 @anti-phishing 代码进行了更新。

更新后,牺牲我的 @oflyhigh.test ID进行测试。

回复创建时间为:2017-10-28 03:44:39

@anti-phishing 差评时间为: @2017-10-28T03:44:45

耗时仅为6秒,相比之前的1分钟12秒,快了12倍 😀

完全符合我的预期。
superhero-534120_960_720.jpg
(图源 :pixabay)

更进一步

尽管 @anti-phishing 提前了,但是 @oflyhigh@anti-phishing 落后了三秒(下一个块)
回复的提示内容,比 @oflyhigh 还要落后九秒

如何提升这个速度也是个问题。比如,如果把这些操作都打包到一个块中,或许会更加合理。

不过这个留给之后改进吧。

(封面图源 :pixabay)

Sort:  

Hey dear @oflyhigh wonderful post. Keep it up

very nice post @oflyhigh i enjoy your photos..keep it up..

Hello & Cheers!! I'm a content detection and information bot. You are receiving this reply because a short link or links have been detected in your post/comment. The purpose of this message is to inform your readers and yourself about the use of and dangers of short links.

To the readers of the post: Short links are provided by url shortening services. The short links they provide can be useful in some cases. Generally their use is benign. But as with all useful tools there are dangers. Short links can be used to hide all sorts of things. Quite frequently they are used to hide referral links for instance. While not dangerous this can be deceptive. They can also be used to hide dangerous links such as links to phishing sites, sites loaded with malware, scam sites, etc. You should always be extremely cautious before clicking on one. If you don't know and trust the poster don't click. Even if you do you should still be cautious and wary of any site you are sent to. It's always better to visit the site directly and not through a short link.

To the author of the post: While short links may be useful on some sites they are not needed on steemit. You can use markdown to format your links such as this link to steemit. It's as simple as [steemit](https://steemit.com) Unlike short links this allows the reader to see where they are going by simply hovering over the link before they click on it.

This message was created by a bot. It is part of the ongoing fight against spam and phishing attacks on steemit. If you did not use short links in your post and feel you have received this message in error you can contact @fubar-bdhr on discord or @fubar.bdhr on steemit chat to report the issue.

赞! 现在是单纯的根据监控名单踩还是说会分析一下回复内容? 万一这些作者偶尔几次发布的不是钓鱼信息呢..

根据名单
和钓鱼者不用客气,发啥都踩 😀

i resteem your post

Learn from your post. Thank you so much.

@oflyhigh你好!感谢你作为cn小伙伴的一员。我是cn区点赞机器人 @cnbuddy,旨在团结cn区成员,提供cn区动态和助力cn区发展。请关注我的主页和我们成员动态。

that's very helpful post!!
thank you..

Twinkledrop 這戶口很可惜,現在淪為惡賊的工具🤦🏻‍♂️🤦🏻‍♂️🤦🏻‍♂️要靠反釣魚機械人幫忙保護用戶!❤️❤️❤️

闪电侠,速度快我就服o哥。

额,感觉有点方

防止詐騙橫行,速度的確很重要。好佩服你們會寫程式的人,可以做出好多貢獻哪!

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 64202.90
ETH 3439.10
USDT 1.00
SBD 2.59