If the transaction executes your on-chain function, which you obviously have 100% confidence of for not spending an excessive amount of gas, then the only drawback is that the gas limit that you set may exceed the block gas limit, in which case your transaction will not be executed.
If the transaction executes someone else's on-chain function, whose gas consumption you are possibly unaware of, then another drawback is that it might cost you a lot more then you anticipate.
In short, the gas-limit parameter is designated in order for you to protect yourself when executing someone else's code.
UPDATE:
There is yet another drawback in setting the gas limit too high.
As it gets higher, miners become more reluctant to execute the transaction.
I'm not sure about the general mining algorithm, but I believe that it opts for the highest gas price and the lowest gas limit (the reason for the highest gas price is obvious, the reason for the lowest gas limit is that more transactions can be squeezed into the same block).
I learned that out of bitter experience, when I set the gas limit to the maximum (i.e., the block gas limit), and noticed that it took forever for the transaction to execute.
Best Answer
Wow this is such an interesting question! TL;DR: the transaction size limit, at the time of writing, is about 780kB (about 3 million gas). But read on.
There is no direct or fixed limit, neither for transaction sizes nor for block sizes. This is a strength of the Ethereum network, it does scale.
That does not mean that there are no limits. There is the block gas limit of currently 3,141,592 gas which can be spent maximum per block.
That means, in theory, you could create a single transaction which consumes all the gas of a single block.
Let's try to send 256kB random data with a contract:
That would consume almost 9 million gas, which is not available currently. Mist tries to create the transaction but it will be invalid.
Let's try to create something close to the gas limit, 44,444 random bytes:
That transaction went through, here is an explorer link. Hash:
So, I just added 44kB to the blockchain in block 967163.
And now, the scaling magic of Ethereum starts to kick in. In block 967164, the network reacts to the high gas consumption and increases the block gas limit to 3,142,967!
So, if there is a continuous request in high gas consumption, the gas limit can be increased by plus/minus
1/1024
, which is around0.09%
. See yellow paper equations 40-42.In short, limit: yes, at the time of writing about 780kB for a tx full of zero bytes, or 46kB for a tx full of non-zero bytes. Fixed limits (like in Bitcoin): no.