-
Notifications
You must be signed in to change notification settings - Fork 57
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
WIP: minimum data request reward to collateral percentage #2229
WIP: minimum data request reward to collateral percentage #2229
Conversation
Hi, so we haven't made any changes to the
We could, but the main benefit of having it in Regarding the TransactionsPool::default, you cannot use the consensus constants to set the default value because consensus constants are loaded at runtime from the witnet.toml file. A simple workaround is to do the same as the Regarding tests I think most of them will fail because the collateral and value fields are set to dummy values, so the fix is to increase the value. Maybe you can set The |
Yes, I was also thinking that TAPI may work for this. The magic number that is broadcasted and checked could probably be guarded in some
I assumed that was the solution and it's basically how I implemented it, albeit at 1%. I was just wondering if it could be set by
Yeah, basically all tests initially fail because transactions don't get inserted in the
It is certainly possible to do this in a separate patch. However, for your average miner it does not make sense to have a non-zero |
2b93e2e
to
6fe5973
Compare
Implemented WIP0022-guards around the relevant code. Made sure that all tests pass when the ratio is not activated by setting the accepted ratio to All tests can be run with WIP0022 activated by uncommenting the active_wips insertions at lines 51 and 65 in I am not quite sure how I can modify the |
6b3142a
to
9781266
Compare
I rebased this PR and fixed the missing parts here: #2337 Let me know if I missed anything, closing. |
Following this discussion, I started with a PoC implementation for the minimum reward to collateral mechanism. In summary, there are two main changes to the code:
Introduction of a
minimum_reward_collateral_percentage
configuration variable which can freely be set by miners (as long as the value is higher than the related consensus constant). Essentially, this variable will dictate if a miner inserts a newly received data request into his local transaction pool.Introduction of a
required_reward_collateral_percentage
consensus constant which is used for data request validation whenever a block is received or a new data request is created.I currently am facing three issues and could use some insight into how to tackle them:
I doubt I can just add a new consensus constant given that it is used everywhere (e.g., in the communication between nodes). I did this anyway to make the PoC, but for the actual deployment I probably need to change this? How would adding a consensus constant need to be handled? Could we just make this a non-consensus, but fixed, parameter somewhere? People can obviously still change it and recompile the node, but as long as the majority of node operators does not, it's probably safe to not be a consensus constant.
Provided we can add a new consensus constant, in the Default implementation of TransactionsPool, I would like to set the
required_reward_collateral_percentage
using the consensus parameter, but I don't quite know how to achieve that? Granted, there are other parts of the code where consensus constants are hard coded, but if possible, it seems sensible to minimize hard coding them.This patch essentially breaks every test where a data request is involved. I started changing some of them, but in total there are probably a couple hundred of tests that require changing, so I first wanted to check what the best way forward is? The only thing I currently changed in this patch is making sure the test code correctly compiles.