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
Introduce minimum fees configured by machines #1827
Introduce minimum fees configured by machines #1827
Conversation
2d5b4ed
to
6bb3025
Compare
6bb3025
to
803b74b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an integration test with the scenario below:
- Node A's minimum fee for a pay transaction is 100CCC
- Node B's minimum fee for a pay transaction is 200CCC
- Node A creates a Block with a transaction whose fee is 140CCC.
- Node B verifies the block successfully.
c9def02
to
7bc179c
Compare
I implemented the integration test you commented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've added codechain binary here: remove it from the repository. 811ab50
a9461e6
to
0cd8de2
Compare
Thank you, I removed it from the commit. |
@@ -781,17 +770,18 @@ impl MemPool { | |||
origin: TxOrigin, | |||
client_account: &AccountDetails, | |||
) -> Result<(), Error> { | |||
if origin != TxOrigin::Local && tx.fee < self.minimal_fee { | |||
let action_min_fee = self.minimum_fees.min_cost(&tx.action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why origin != TxOrigin::Local
condition is dropped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I think that's the correct behavior. Some services let users send their transactions via RPC directly to the nodes. In this case, I think the mem pool minimum fees should be applied to such transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. The spec is changed. okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should remain the original behavior. RPC should not be open to the internet. We didn't consider any safety in RPC. All the people who want to send a transaction should have its own CodeChain instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about discussing this with other team members?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok then, I'll summary it and make a conversation. Until now, the mem pool's minimal fee is always set to zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the behavior not to reject local transactions despite low fees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, local transaction should be mined if its fee is low.
5806f5e
to
1dbc363
Compare
d697014
to
f510c01
Compare
It enables validators to customize fee thresholds for transactions to be included in their mempools.
f510c01
to
0defbce
Compare
0defbce
to
5d51a5c
Compare
Transactions whose fees are below the minimum fees configured by the mem pool should be rejected.
5d51a5c
to
faf9f22
Compare
The mem pool minimum fees should not affect to the block verifications.
faf9f22
to
74549e7
Compare
It resolves #1758
It enables validators to customize fee thresholds for transactions to be included in their mem pools.