These are chat archives for Nethereum/Nethereum

1st
Feb 2019
Dave Whiffin
@Dave-Whiffin
Feb 01 10:01
@clovermebitcoin Hi - what is {Dropped & Replaced}?
Psilon
@Pzixel
Feb 01 11:20
hey @juanfranblanco
I'm trying to deploy a contract and it throws a ContractDeploymentException
but contract is actually successfully created
in latest master I see transactionReceipt.Status.Value != 1 check
and it's false in my case so I get receipt regularely
but in latest nethereum 3.0.0 from nuget there is no check
Juan Blanco
@juanfranblanco
Feb 01 13:19
hi @Pzixel there is a race issue condition with parity, mainly the receipt is returned before the contract is stored, so the check before hand was to validate if the code has been stored
using getCode
I should be deploying a new version next week
Psilon
@Pzixel
Feb 01 13:20
yep, I've got it
I debugged 2 hours to see why this check doesn't pass
and suddenly I realised that actual code in master is not a version in nuget
you probably should do some feature branching to make sure master is consistent with nuget
it helped me implement it myself nonetheless, so thanks
Juan Blanco
@juanfranblanco
Feb 01 13:42
@Pzixel just use the release
Psilon
@Pzixel
Feb 01 13:43
?
I wrote small helper method
protected static async Task<TransactionReceipt> DeployAsync(Web3 web3, string abi, string contractByteCode, params object[] values)
{
    try
    {
        var receipt = await web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync(
                          abi,
                          contractByteCode,
                          web3.TransactionManager.Account.Address,
                          Constant.MaxDeployGas,
                          values: values);
        return receipt;
    }
    catch (ContractDeploymentException ex) when (ex.TransactionReceipt.Status.Value == 1)
    {
        return ex.TransactionReceipt;
    }
}
That I'm going to use until it appears in nuget
Juan Blanco
@juanfranblanco
Feb 01 14:00
oh i mean you can use the releases to go to a previous version / branch
ok you can also use the ci nuget if you want
Psilon
@Pzixel
Feb 01 14:13
It's not about previous one, I had inftrastructure which changed
and I started to get this exception
i don't need the previous one, I need the non-released)
but I'm currently fine with this workaround
cloverme
@clovermebitcoin
Feb 01 14:18
@Dave-Whiffin another transaction that replaces the first with a different txid. example: https://etherscan.io/tx/0x160a45f1ef1813aeb7c2cacffe7419e352971d397484d36077462e243cff7b3f
Dave Whiffin
@Dave-Whiffin
Feb 01 14:30
@clovermebitcoin I see - apologies, I thought the gitter client might have incorrectly parsed what you typed and put a placeholder of some type in there! Yes, the orphaned transaction thing - that's one reason why when blockchain processing I tend to stay within a 6 block confirmation limit. @juanfranblanco may be able to offer some suitable advice for dealing with the dropped and replaced situation?
Juan Blanco
@juanfranblanco
Feb 01 15:27
@clovermebitcoin a replaced transaction it is mainly due to the initiator replacing it, so in those scenarios if you initiated the transaction and replace it (same nonce and other values + increased gas price), you should know the txnid of the replaced transaction
@Pzixel yes I was referring to your comment of master vs released code before hand
Kevin Small
@KevinSmall
Feb 01 15:52
@juanfranblanco the replaced transaction scenario can only happen within the same block, right? When the block comes to be mined then this happens. It could never happen across blocks.
cloverme
@clovermebitcoin
Feb 01 16:35
@juanfranblanco Yes, what happened is that i was processing a dozen send transactions and waiting (via a loop) that "receipt" wasn't null on a [receipt = await GetTransactionReceipt.SendRequestAsync(txhash)] request. Another process kicked off with a higher gas price and replaced the tx. However, after the transaction was replaced, receipt was still null for some reason, is that the intended behavior for GetTransactionReceipt?
Juan Blanco
@juanfranblanco
Feb 01 16:44
@clovermebitcoin yes that will be the case as it wouldn't be mined
cloverme
@clovermebitcoin
Feb 01 17:04
Got it, thanks. Since I'm often sending multiple transactions to the same destination address in a queue, I've been waiting to make sure the transaction gets mined before processing another one. I was reading in the past here that a few people had similar issues and that was a good solution.