0

What will make a transaction more likely to win the following smart contract ?

function win( address player, unit bet ) constant returns(bool) {
    if( now < gameStartTime) return false;
    if( endgame == true  ) return false;

    if( bet == theanswer ) 
    {
        endgame = true; 
        return true;
    }
    else {
        return false;
    }
}

assuming that gas price is the same for all senders. and all transaction are sent at the same time.

Will a miner have better a chance if they sign their own transaction and send it ?

Will a sender have a better chance if they send transaction simultaneously from multiple nodes ?

Does it matter if the sender is running full vs light node ?

2

Usually transactions are sorted by gas price first and then by nonce, see also What is the default ordering of transactions during mining, in e.g. geth?. Keep in mind that this is not part of the specifications and hence you cannot rely on it. In the end it is at the miners discretion what transactions to include in a block and which transactions to leave out. The ultimate version of that is miner front-running which we have already seen happening and which is particularly important during ICOs (miner keeping everyones tx out in order to bring their own investment in).

  • Sounds like if front-running is done by multiple miner for the same tx, they are guaranteed ( not only have advantage ) to go through. How about sending the same transaction from multiple nodes, will that give the user any advantage ? – Nabil Sham Sep 14 '17 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.