Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

手续费方案插件化 #1022

Open
vipwzw opened this issue Mar 25, 2021 · 0 comments
Open

手续费方案插件化 #1022

vipwzw opened this issue Mar 25, 2021 · 0 comments
Milestone

Comments

@vipwzw
Copy link
Collaborator

vipwzw commented Mar 25, 2021

扣除手续费的方案目前是写死的,需要插件化. 并且实现下面的手续费方案:

交易手续费计算规则:

  1. 每笔交易都有个基础手续费,叫做 feebase , 这个手续费是不管这笔交易多大,都要收取的手续费。

  2. 交易的大小会占用空间,我们用 1K 来表示一个计费单位,比如一笔交易有10.1K , 那么计费会是11K,只要比10 多一点点,就会多一个计费单位。feesize . 那么如果一笔 10.1 k 的交易,需要 feebase + feesize * 11 这样的手续费

  3. 现在我们添加了一些key的读取列表,这个列表首先会占用空间,这部分会再2中计费,同时,每个key还需要交付一定的读取费用。我们叫做feeread,比如有10个key的读取,那么需要 feebase + feesize * 11 + feeread * 10

  4. 写数据库的计费,和我们的这个专利没有关系,但是他也是计费的,计费规则是:

    feewritesize * writesize + feewritecount * writecount

    也就是写数据库,每个字节的费用,加上写的key的数量的费用。

整个交易的费用构成:

feebase + txsize * feesize + feeread * readcount + feewritesize * writesize + feewritecount * writecount

@vipwzw vipwzw added this to the Unplanned milestone Mar 25, 2021
@vipwzw vipwzw changed the title 手续费方案插件华 手续费方案插件化 Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant