kowala-tech / kcoin

A stable cryptocurrency that algorithmically targets $1 USD using the Kowala Protocol
https://www.kowala.tech/
Other
18 stars 16 forks source link

feature/deprecate dynamic gas price; review gas concept/mechanism #740

Open rgeraldes opened 6 years ago

rgeraldes commented 6 years ago

txpool:

miner:

user:

smart contracts:

all:

Closes #24

JekaMas commented 6 years ago

Is a fixed price safe from dos attack, when melicious user spams a network with huge number of transactions? Maybe we need to do some research about it and other possible security issues.

@rgeraldes @yourheropaul

rgeraldes commented 6 years ago

@JekaMas it's the same model. If the user posts a transaction he pays for it - we just need to make sure that the network can handle the load and maybe make sure that the fee is not extremely low. Worst case scenario, the node's tx pool will not accept more transactions until there's some room for new transactions.

JekaMas commented 6 years ago

@rgeraldes ethereum model prevents dos attack by increasing gas price: the more someone spam the network the more the price of each transaction and whole attack, so we can be sure that at some point the price will be so high that it'd be impossible to continue the attack.

If the price is constant, someone can spam the network paying suitable price, afaik.

I'm only thinking that we should calculate does our gas model have same or even better gaurantees as Ethereum gas model.

rgeraldes commented 6 years ago

"price will be so high that it'd be impossible to continue the attack" - depletes your account balance faster but the attack can continue. Most of Ethereum's problems arise from the fact that they have a slow network > network congestion - it's a totally different scenario for us but some of the problems remain:

For simple kUSD transfers the cost of launching an attack is expensive (15 minutes ~ $10000 given 1000 tx/s) and even if there's an attack you cannot prioritise transactions, which means that the other users' transactions are still going to be accepted anyway as there's a limit of transactions per account on the tx pool (https://github.com/ethereum/go-ethereum/blob/master/core/tx_pool.go#L134). With sharding the price to attack will be much higher simply because you will have a higher tx throughput (think current payment networks).

For contracts it's a different scenario - this part of the code is still a mistery because we are dealing with 1 second confirmations and we're also enforcing a minimum hardware setup (higher gas limit which we don't know yet). With that said, the contracts part is still raw in relation to our use cases but there are several ways of preventing ddos attacks. (caches, higher fees, etc..)

Overall the goal is to make it easier for everyone to use crypto currencies (think bank transfer).

rgeraldes commented 5 years ago

Post: add an issue - fixed compute unit price per currency

jmatosp commented 5 years ago

@rgeraldes you need to rebase this PR