These are chat archives for Nethereum/Nethereum

5th
Jun 2018
Psilon
@Pzixel
Jun 05 2018 00:14

After updating to nethereum 2.5.0 I faced that this code:

            var receipt = await web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync(
                              Core.Abi.SeasonFactory,
                              Bin.SeasonFactory,
                              web3.TransactionManager.Account.Address,
                              new HexBigInteger(4600000));

fails with random message like Nethereum.JsonRpc.Client.RpcResponseException : Transaction cost exceeds current gas limit. Limit: 4700000, got: 12595270. Try decreasing supplied gas.

Juan Blanco
@juanfranblanco
Jun 05 2018 05:07
Speed up solidity that is a great question, i think the solidity guys with a sample might be able to help you better
@Pzixel also the upgrade will not affect the gas limit.. you could increase the gas limit
check the genesis entry on gaslimit
Psilon
@Pzixel
Jun 05 2018 08:06
@juanfranblanco no, it's due to upgrade
after I downgraded back to 2.4.0 The same code worked without problems
when I upgraded back it reproduced
With no changes in the code
so I believe it's related
Psilon
@Pzixel
Jun 05 2018 08:25
Another question: why I'm getting Nethereum.JsonRpc.Client.RpcResponseException: 'Transaction execution error.' on var estimated = await function.EstimateGasAsync(functionInput);
Juan Blanco
@juanfranblanco
Jun 05 2018 08:29
@Pzixel hmmm can you share the code?
Psilon
@Pzixel
Jun 05 2018 08:30
I was running it on core 2.1
I will try now on 2.0
Juan Blanco
@juanfranblanco
Jun 05 2018 08:30
ah interesting
Psilon
@Pzixel
Jun 05 2018 08:30
no, same here
    public static class XContractFunction
    {
        public static async Task<TransactionReceipt> SendDefaultTransactionAndWaitForReceiptAsync(this Function function,
                                                                                                  string accountAddress,
                                                                                                  params object[] functionInput)
        {
            var estimated = await function.EstimateGasAsync(functionInput);
            var result = await function.SendTransactionAndWaitForReceiptAsync(
                             accountAddress,
                             estimated,
                             new HexBigInteger(0),
                             functionInput: functionInput);

            if (result.Status.Value != BigInteger.One)
            {
                throw new TransactionFailedException(result);
            }

            return result;
        }
    }
Juan Blanco
@juanfranblanco
Jun 05 2018 08:31
oh I meant the other code
:)
the EstimateGasAsync might have failed on the transaction
Psilon
@Pzixel
Jun 05 2018 08:33
what code you want to see?
Solidity?
Juan Blanco
@juanfranblanco
Jun 05 2018 08:33
 var receipt = await web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync(
                              Core.Abi.SeasonFactory,
                              Bin.SeasonFactory,
                              web3.TransactionManager.Account.Address,
                              new HexBigInteger(4600000));
one step at a time :)
the other it is due to a failure estimating
so your code is failing
in the solidity

did you reset your chain after downgrading?
the cost should not have affected this..
Psilon
@Pzixel
Jun 05 2018 08:36
I didn't change chain in any way
I only change C# code
Juan Blanco
@juanfranblanco
Jun 05 2018 08:37
ok cool
Psilon
@Pzixel
Jun 05 2018 08:37
I say upgrade/downgrade relevant to .netcore 2.0/2.1
because 2.1 have some troubles
Juan Blanco
@juanfranblanco
Jun 05 2018 08:37
yeah..
Psilon
@Pzixel
Jun 05 2018 08:38
well
Here is my uber contract method which fails to get estimated gas
    function addSeason(address season) public onlyOwner {
        SeasonShim seasonShim = SeasonShim(season);
        require(seasonShim.owner() == owner);
        require(seasons.length == 0 || SeasonShim(seasons[seasons.length - 1]).end() < seasonShim.begin());

        seasons.push(seasonShim);
        emit SeasonCreated(seasonShim.begin(), seasonShim.end(), season);
    }
Juan Blanco
@juanfranblanco
Jun 05 2018 08:39
it might be due to the onlyowner?
is that passed as a from
Psilon
@Pzixel
Jun 05 2018 08:40
I perform all operations from one account
Juan Blanco
@juanfranblanco
Jun 05 2018 09:04
hmm let me fix the .netcore 2.1 i found the issue with a new overload
Juan Blanco
@juanfranblanco
Jun 05 2018 10:43
(.net core 2.1 overaload) :)
still testing
Trycoder
@Trycoder
Jun 05 2018 10:51
Hi juan
Im jgetting the following error when sending a transaction: Character 'h' at index '2' is not valid alphanumeric character.
Juan Blanco
@juanfranblanco
Jun 05 2018 11:52
@Trycoder have you got a snippet of the code?
Juan Blanco
@juanfranblanco
Jun 05 2018 12:25
@Pzixel released 2.5.1 can you check it with your .net core 2.1?
Psilon
@Pzixel
Jun 05 2018 12:29
I think I found my evil doer
image.png
It's about performance issue
about correctness with gas: will try a bit later, ty for update
Juan Blanco
@juanfranblanco
Jun 05 2018 12:30
nice :)
Trycoder
@Trycoder
Jun 05 2018 13:58
That was my mistake
I have got a new issue now
I have 60 ether in my ropsten account.when i try to send the transaction using the acc ,i get the following error ::Insufficient funds. The account you tried to send transaction from does not have enough funds. Required 10000000000000000 and got: 0.
Trycoder
@Trycoder
Jun 05 2018 14:04
Sometimes I get :nonce too low
Sometimes I get : Error occurred when trying to send rpc requests(s)
Juan Blanco
@juanfranblanco
Jun 05 2018 15:35
@Trycoder hmm is the privatekey the same for your account?
krishnanjk7
@krishnanjk7
Jun 05 2018 16:04
Yes
Trycoder
@Trycoder
Jun 05 2018 16:07
@juanfranblanco yes