Choosing the order in which operations are applied is a privilege of the baker. So yes, frontrunning is possible on Tezos and can either be done by setting high fees (the default baker strategy is to apply transactions with high fees first) or by the bakers themselves when they build their blocks. The simplest protection against frontrunning is to run your ...
What are you doing to reduce gas costs?
The first thing to do is to do algorithmic optimisation, without worrying about Michelson's own constraints.
Then, to make additional savings, lower level optimisations can be done :
• organise the stack so as to reduce the number of stack operations,
• In a complex contract where the optimisation of one entry ...
The only thing that can trigger a FAILWITH error is the execution of the FAILWITH instruction. You might however get a gas exhaustion error during the interpretation of a FAILWITH instruction, this can happen for example if the value that is thrown by FAILWITH is large because it will be costly to serialize.
Florence gas optimizations are only about the Michelson interpreter.
During a call to a smart contract, gas is charged for the following things:
checking the signature of the operation
account management (debiting the caller and crediting the smart contract)
fetching the script and the storage of the contract from disk
conversion from a byte sequence to an ...
The answer given by Raphael Cauderlier in the gitlab issue helped solve the issue:
"I have tried to reproduce this in sandbox (well, actually in mockup client); I think your problem is that 100 extra gas units are not enough to empty an account, apparently this consumes 400 gas units.
Here is what I did (mockup_client is an alias for tezos-client --mode ...