web3j icon indicating copy to clipboard operation
web3j copied to clipboard

EIP1559 Transactions sent to blockchain with gas price 0, won't be mined

Open cristianberbecaru opened this issue 5 years ago • 16 comments

Hi,

I am unable to send transactions. They are successfully sent to blockchain, but with gas price 0, so the transactions won't be mined. I am using Geth 1.10.4.

I tried the following code:

RawTransaction transaction1559 = RawTransaction.createEtherTransaction( ChainId.ROPSTEN, BigInteger.valueOf(4L), Transfer.GAS_LIMIT, transfer.getRecipientAddress(), amountInWei, DefaultGasProvider.GAS_LIMIT, DefaultGasProvider.GAS_PRICE ); EthSendTransaction ethSendTransaction = manager.signAndSend(transaction1559);

cristianberbecaru avatar Jul 13 '21 13:07 cristianberbecaru

what version of web3j are you using ?

AlexandrouR avatar Jul 13 '21 13:07 AlexandrouR

what version of web3j are you using ?

I am using 4.8.5. I manually compiled it.

cristianberbecaru avatar Jul 13 '21 14:07 cristianberbecaru

do you have the same result if you do it through the Transfer sendFundsEIP1559 ?

AlexandrouR avatar Jul 13 '21 14:07 AlexandrouR

Yep. I've tested again now and the same result with sendFundsEIP1559.

https://ropsten.etherscan.io/tx/0xcf82267a5f6da86040dc8bbc101968a54f0512ab652e1f6e6bb5f60603bc47ae

cristianberbecaru avatar Jul 13 '21 15:07 cristianberbecaru

thank you i will investigate this issue

AlexandrouR avatar Jul 13 '21 15:07 AlexandrouR

Hi @cristianberbecaru, can you post parameter used for sendFundsEIP1559?

yasseralaa avatar Jul 15 '21 11:07 yasseralaa

Here

        RemoteCall<TransactionReceipt> eip1559receipt = Transfer.sendFundsEIP1559(
                  rpc.connect(),
                  credentials,
                  transfer.getRecipientAddress(),
                  BigDecimal.valueOf(0.003),
                  Convert.Unit.ETHER,
                  Transfer.GAS_LIMIT,
                  Convert.toWei("1", Convert.Unit.GWEI).toBigInteger(),
                  Convert.toWei("150", Convert.Unit.GWEI).toBigInteger());
    TransactionReceipt t = eip1559receipt.send();

cristianberbecaru avatar Jul 15 '21 17:07 cristianberbecaru

Hi,

@AlexandrouR any updates on this?

cristianberbecaru avatar Jul 19 '21 12:07 cristianberbecaru

@cristianberbecaru not sure if 0 price transaction is valid unless Geth itself configured or running with the miner.gasPrice=0? is this how is it currently configured?

mohamedelshami avatar Jul 19 '21 13:07 mohamedelshami

@mohamedelshami Geth version is 1.10.5 and I'm using the Ropsten Network. What do you mean by 0 price transaction? I'm not sending any fee with 0.

cristianberbecaru avatar Jul 19 '21 13:07 cristianberbecaru

I have recreated this issue using geth:- $geth --rpcapi personal,db,eth,net,web3 --rpc --ropsten --syncmode "light" https://ropsten.etherscan.io/tx/0xcd48e1dea9c9a17b66e938120348eeb8fa53e18100543a49fa7553ed20bd55b2

also tried using infura's network and it worked fine: https://ropsten.etherscan.io/tx/0x5d674d189a7427effd77008bdcdf967077a7b3ac2f80bf43ab538833754312b7

yasseralaa avatar Jul 21 '21 12:07 yasseralaa

@yasseralaa can you show me the code that you have used, please?

cristianberbecaru avatar Jul 21 '21 14:07 cristianberbecaru

@cristianberbecaru used the same code you posted:- RemoteCall eip1559receipt = Transfer.sendFundsEIP1559( web3j, credentials, "toAddress", BigDecimal.valueOf(0.003), Convert.Unit.ETHER, Transfer.GAS_LIMIT, Convert.toWei("1", Convert.Unit.GWEI).toBigInteger(), Convert.toWei("150", Convert.Unit.GWEI).toBigInteger()); TransactionReceipt t = eip1559receipt.send();

yasseralaa avatar Jul 21 '21 14:07 yasseralaa

@cristianberbecaru can you make another transaction with this code again, It worked with me even that transaction was pending yesterday worked well:-

$geth --rpcapi personal,db,eth,net,web3 --rpc --ropsten --syncmode "light"

https://ropsten.etherscan.io/tx/0xcd48e1dea9c9a17b66e938120348eeb8fa53e18100543a49fa7553ed20bd55b2

can you give it a try?

yasseralaa avatar Jul 22 '21 11:07 yasseralaa

@yasseralaa it worked. I can see all my past transactions are mined one by one. I think the problem is with Ropsten. I tried now another one on Ropsten and it is still pending, with 0 gas price, but on Rinkeby it worked instantly.

Thank you for the help. With geth v1.10.5 it's all good.

cristianberbecaru avatar Jul 22 '21 12:07 cristianberbecaru

@cristianberbecaru great to know that.

closing issue.

yasseralaa avatar Jul 22 '21 12:07 yasseralaa