I understand that the gas limit is there so that we don't lose all our ETH when something goes wrong. The gas price is there to define how much 1 gas costs. But the fee is always gas price * gas limit, so why doesn't the Ethereum blockchain simply ask for a fee cost limit?
For example, I could set:
Gas limit to 10^6 and gas price to 10^9 Wei.
Gas limit to 10^9 and gas price to 10^6 Wei.
Gas limit to 10^10 and gas price to 10^5 Wei.
It all ends up in the same transaction fee: 10^15 Wei. So when we send an ETH transaction to the blockchain, instead of
txData = {
nonce: 20,
gasPrice: 1000000000,
gasLimit: 1000000,
to: '0x8f2b163fd3a871ce',
value: 10^18,
data: '0x'
};
why wasn't it built like this:
txData = {
nonce: 20,
feeLimit: 10^15,
to: '0x8f2b163fd3a871ce',
value: 10^18,
data: '0x'
};
Finally, 1 gas is paid for each line of code, so that would mean a gas limit of 1 and a gas price of 10^15 wouldn't work. In this situation wouldn't it also be handier for the blockchain to automatically calculate the fee by dividing the fee limit (10^15) by the amount of lines so users don't have to gamble on gas price and gas limit?