When sending a TX, there's an optional gasPrice field. If I don't set it, what's it default to? Does it look at other TXs going on or is it a fixed value that only changes when web3 gets updated to a new version? Is there a way to get the default value so that I can, for example, add 1gwei to it? I'd like to ensure order of TXs in the same block by paying more for the first TX.
There is a
web3.eth.gasPrice function. From the documentation (https://web3js.readthedocs.io/en/1.0/web3-eth.html#eth-gasprice):
The gas price is determined by the last few blocks median gas price.
So the gas price defaults to this value. You can of course change it but it doesn't make sense to try to order the txs with the gas price. Besides there is no way to ensure that txs you send end up in the same block.