7

I'm having an issue where sending a single transaction work but sending multiple doesn't.

I'm attempting to Seed my contract with data using using web3.js and it works fine.

mycontractinstance.foofunction(1,2,3)

But as soon as i'm trying to send multiple transaction in a row it run out of gas at some point and everything is reverted back.

mycontractinstance.foofunction(1,2,4)
mycontractinstance.foofunction(1,3,3)
mycontractinstance.foofunction(4,2,3)
mycontractinstance.foofunction(1,2,1)

Is there a proper way to do this ? Should i wait for the confirmation of the first transaction to send the second ? etc.

Ok so I'll provide the geth log for both scenario :

mycontractinstance.foofunction(1,2,3)

-

I0212 19:37:07.399271   67496 worker.go:349] 🔨  Mined block (#1018 / 4b46bd0b). Wait 5 blocks for confirmation
I0212 19:37:07.399730   67496 worker.go:570] commit new work on block 1019 with 0 txs & 0 uncles. Took 419.499µs
I0212 19:37:07.400184   67496 worker.go:570] commit new work on block 1019 with 0 txs & 0 uncles. Took 390.426µs
VM STAT 161 OPs
PC 00000000: PUSH1 GAS: 978149 COST: 3
STACK = 0
MEM = 0
STORAGE = 0

PC 00000002: PUSH1 GAS: 978146 COST: 3
STACK = 1
0000: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 0
STORAGE = 0

PC 00000004: MSTORE GAS: 978134 COST: 12
STACK = 2
0000: 0000000000000000000000000000000000000000000000000000000000000040
0001: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
STORAGE = 0

PC 00000005: CALLDATASIZE GAS: 978132 COST: 2
STACK = 0
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0


PC 00001269: SWAP1 GAS: 917536 COST: 3
STACK = 7
0000: 0000000000000000000000000000000000000000000000000000000000000066
0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e387
0004: 0000000000000000000000000000000000000000000000000000000000000005
0005: 00000000000000000000000000000000000000000000000000000000000000b9
0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001270: SWAP3 GAS: 917533 COST: 3
STACK = 7
0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0001: 0000000000000000000000000000000000000000000000000000000000000066
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e387
0004: 0000000000000000000000000000000000000000000000000000000000000005
0005: 00000000000000000000000000000000000000000000000000000000000000b9
0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001271: SSTORE GAS: 897533 COST: 20000
STACK = 7
0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e387
0001: 0000000000000000000000000000000000000000000000000000000000000066
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0004: 0000000000000000000000000000000000000000000000000000000000000005
0005: 00000000000000000000000000000000000000000000000000000000000000b9
0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001272: PUSH1 GAS: 897530 COST: 3
STACK = 5
0000: 0000000000000000000000000000000000000000000000000000000000000006
0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0002: 0000000000000000000000000000000000000000000000000000000000000005
0003: 00000000000000000000000000000000000000000000000000000000000000b9
0004: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001274: SWAP2 GAS: 897527 COST: 3
STACK = 6
0000: 0000000000000000000000000000000000000000000000000000000000000004
0001: 0000000000000000000000000000000000000000000000000000000000000006
0002: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0003: 0000000000000000000000000000000000000000000000000000000000000005
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001275: SWAP1 GAS: 897524 COST: 3
STACK = 6
0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0001: 0000000000000000000000000000000000000000000000000000000000000006
0002: 0000000000000000000000000000000000000000000000000000000000000004
0003: 0000000000000000000000000000000000000000000000000000000000000005
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001276: SWAP2 GAS: 897521 COST: 3
STACK = 6
0000: 0000000000000000000000000000000000000000000000000000000000000006
0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0002: 0000000000000000000000000000000000000000000000000000000000000004
0003: 0000000000000000000000000000000000000000000000000000000000000005
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001277: ADD GAS: 897518 COST: 3
STACK = 6
0000: 0000000000000000000000000000000000000000000000000000000000000004
0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e384
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: 0000000000000000000000000000000000000000000000000000000000000005
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001278: DUP1 GAS: 897515 COST: 3
STACK = 5
0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388
0001: 0000000000000000000000000000000000000000000000000000000000000006
0002: 0000000000000000000000000000000000000000000000000000000000000005
0003: 00000000000000000000000000000000000000000000000000000000000000b9
0004: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001279: SLOAD GAS: 897465 COST: 50
STACK = 6
0000: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388
0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: 0000000000000000000000000000000000000000000000000000000000000005
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0


PC 00001289: AND GAS: 25017 COST: 3
STACK = 7
0000: ffffffffffffffffffffffff0000000000000000000000000000000000000000
0001: 0000000000000000000000000000000000000000000000000000000000000000
0002: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388
0003: 0000000000000000000000000000000000000000000000000000000000000006
0004: 0000000000000000000000000000000000000000000000000000000000000005
0005: 00000000000000000000000000000000000000000000000000000000000000b9
0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001290: CALLER GAS: 25015 COST: 2
STACK = 6
0000: 0000000000000000000000000000000000000000000000000000000000000000
0001: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: 0000000000000000000000000000000000000000000000000000000000000005
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001291: OR GAS: 25012 COST: 3
STACK = 7
0000: 000000000000000000000000957a1a87d653ea2218742aeea5a05f637b6509c4
0001: 0000000000000000000000000000000000000000000000000000000000000000
0002: b98b78633099fa36ed8b8680c4f8092689e1e04080eb9cbb077ca38a14d7e388
0003: 0000000000000000000000000000000000000000000000000000000000000006
0004: 0000000000000000000000000000000000000000000000000000000000000005
0005: 00000000000000000000000000000000000000000000000000000000000000b9
0006: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0


PC 00001295: JUMP GAS: 1 COST: 8
STACK = 2
0000: 00000000000000000000000000000000000000000000000000000000000000b9
0001: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00000185: JUMPDEST GAS: 0 COST: 1
STACK = 1
0000: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00000186: STOP GAS: 0 COST: 0
STACK = 1
0000: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

I0212 19:37:35.228514   67496 worker.go:570] commit new work on block 1020 with 1 txs & 0 uncles. Took 35.393252ms
I0212 19:37:39.911673   67496 worker.go:349] 🔨  Mined block (#1020 / 20866eb5). Wait 5 blocks for confirmation
I0212 19:37:39.913851   67496 worker.go:570] commit new work on block 1021 with 0 txs & 0 uncles. Took 2.123783ms
I0212 19:37:39.914405   67496 worker.go:570] commit new work on block 1021 with 0 txs & 0 uncles. Took 468.437µs

Then for multiple Transactions ( note that in an attempt to fix the issue i'm now doing 2 batch of 5 transac with a delay in between but it still fails) :

mycontractinstance.foofunction(1,2,4)
mycontractinstance.foofunction(1,3,3)
mycontractinstance.foofunction(4,2,3)
mycontractinstance.foofunction(1,2,1)

(here i've removed 5k lines for readability)

I0212 19:30:10.378653   67085 worker.go:570] commit new work on block 1005 with 0 txs & 0 uncles. Took 351.149µs
I0212 19:30:10.378958   67085 worker.go:570] commit new work on block 1005 with 0 txs & 0 uncles. Took 257.975µs
I0212 19:30:12.600042   67085 worker.go:349] 🔨  Mined block (#1005 / 3a254ec6). Wait 5 blocks for confirmation
I0212 19:30:12.600616   67085 worker.go:570] commit new work on block 1006 with 0 txs & 0 uncles. Took 505.262µs
I0212 19:30:12.601124   67085 worker.go:570] commit new work on block 1006 with 0 txs & 0 uncles. Took 406.985µs
I0212 19:30:23.393724   67085 xeth.go:1028] Tx(0x53f7bd7602527142ff3491e630c9f51ce0bb5ca09f067eaa94431372e25e4e40) to: 0xb910402db16bd488562ed5e40b781282b8db4e86
I0212 19:30:23.397823   67085 xeth.go:1028] Tx(0x294b9c651c258278ebb13e6d4f2d96e02a026019adb94f7f25b3114d919eb870) to: 0xb910402db16bd488562ed5e40b781282b8db4e86
I0212 19:30:23.400484   67085 xeth.go:1028] Tx(0x6af44846a0dadadfa58a68d878457a737c8e4dbae25dbd9587b30bfb814a3a50) to: 0xb910402db16bd488562ed5e40b781282b8db4e86
I0212 19:30:23.401611   67085 xeth.go:1028] Tx(0x7013b9272764a295ebce818741344bae96ad19b3922a4ed39b22807d2501d675) to: 0xb910402db16bd488562ed5e40b781282b8db4e86
I0212 19:30:23.416332   67085 xeth.go:1028] Tx(0x1d1086c3f0700a7a902772d2155c644a6ca7076d3bafc81f4ec4cddff3f54e56) to: 0xb910402db16bd488562ed5e40b781282b8db4e86
VM STAT 195 OPs
PC 00000000: PUSH1 GAS: 49978597 COST: 3
STACK = 0
MEM = 0
STORAGE = 0

PC 00000002: PUSH1 GAS: 49978594 COST: 3
STACK = 1
0000: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 0
STORAGE = 0

PC 00000004: MSTORE GAS: 49978582 COST: 12
STACK = 2
0000: 0000000000000000000000000000000000000000000000000000000000000040
0001: 0000000000000000000000000000000000000000000000000000000000000060
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
STORAGE = 0

PC 00000005: CALLDATASIZE GAS: 49978580 COST: 2
STACK = 0
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00000006: ISZERO GAS: 49978577 COST: 3
STACK = 1
0000: 0000000000000000000000000000000000000000000000000000000000000024
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00000007: PUSH2 GAS: 49978574 COST: 3
STACK = 1
0000: 0000000000000000000000000000000000000000000000000000000000000000
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001292: SWAP1 GAS: 17483 COST: 3
STACK = 6
0000: 000000000000000000000000957a1a87d653ea2218742aeea5a05f637b6509c4
0001: ee60d0579bcffd98e668647d59fec1ff86a7fb340ce572e844f234ae73a69193
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: 0000000000000000000000000000000000000000000000000000000000000004
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

PC 00001293: SSTORE GAS: 17483 COST: 20000 ERROR: Out of gas
STACK = 6
0000: ee60d0579bcffd98e668647d59fec1ff86a7fb340ce572e844f234ae73a69193
0001: 000000000000000000000000957a1a87d653ea2218742aeea5a05f637b6509c4
0002: 0000000000000000000000000000000000000000000000000000000000000006
0003: 0000000000000000000000000000000000000000000000000000000000000004
0004: 00000000000000000000000000000000000000000000000000000000000000b9
0005: 00000000000000000000000000000000000000000000000000000000a8d5eed5
MEM = 96
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04  ...............?
0032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02  ...............?
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60  ...............`
STORAGE = 0

I0212 19:31:02.514098   67085 worker.go:570] commit new work on block 1009 with 7 txs & 0 uncles. Took 245.468809ms
I0212 19:31:14.965310   67085 worker.go:349] 🔨  Mined block (#1009 / b1aa94c8). Wait 5 blocks for confirmation
I0212 19:31:14.965771   67085 worker.go:570] commit new work on block 1010 with 0 txs & 0 uncles. Took 419.15µs
I0212 19:31:14.965810   67085 worker.go:448] 🔨 🔗  Mined 5 blocks back: block #1004
I0212 19:31:14.966183   67085 worker.go:570] commit new work on block 1010 with 0 txs & 0 uncles. Took 328.43µs
I0212 19:31:29.928411   67085 worker.go:349] 🔨  Mined block (#1010 / dd0c16f4). Wait 5 blocks for confirmation
I0212 19:31:29.928910   67085 worker.go:570] commit new work on block 1011 with 0 txs & 0 uncles. Took 463.605µs
I0212 19:31:29.928971   67085 worker.go:448] 🔨 🔗  Mined 5 blocks back: block #1005
I0212 19:31:29.929456   67085 worker.go:570] commit new work on block 1011 with 0 txs & 0 uncles. Took 431.551µs

I'm wondering what i'm doing wrong because in browser solidity on the exact same app on the same contract at the same adress i can send 5time the same transaction and it works just fine, but from looking at geth it looks like he is queuing transaction and mine are sent all at once.

Another things to add is that i'm chaining :

FooInstance.Foofunction.sendTransaction(50,201,1, function(err, address) {
  if (!err)
    console.log(address); //
});

And i'm getting the transaction address for each call. It's just that nothing end up working. as if no transaction worked.

  • How many transactions does it take? There are two limits: The gasSent with each transaction and the blockGasLimit. The blockGasLimit is the total gas allowed for all transactions on a block, and if you are spamming these out all of the transactions are likely in one block. Check the log files of your miner. I haven't tested running into the blockGasLimit, not sure what it's set to. And to be honest, I'd like to hear from an expert, because I don't know what behavior multiple transactions on one contract on one block is. What kind of order behavior? Even allowed? – Paul S Feb 11 '16 at 2:05
  • The order of transactions in a block is up to the miner. Usually it is in order of receipt, prioritized by gas price. Miners will not include transactions such that the block gas limit is broken, so some of your transactions will make it into a block, and others will be held over to the next. Once a transaction is mined in a block, it will not be reverted unless there is a fork. – Tjaden Hess Feb 11 '16 at 14:43
  • Please clarify "it run out of gas at some point and everything is reverted back": if transaction1 works fine, transaction2 out of gas will not cause transaction1 to be reverted. Since there's been 3 comments here, you probably need to include more information, such as the looping code and possibly foofunction. – eth Feb 11 '16 at 18:35
  • It sounds like your contract requires varying amounts of gas based on arguments passed to the function and that the OOG when sending multiple transactions is a coincidence. – nessence Feb 12 '16 at 6:26
  • Yes it's seems related to the gas provided since it's working in browser-solidity. – jayD Feb 12 '16 at 19:05
5

I've finally found what i was doing wrong. You actually need to provide gas for each transaction or it doesn't work.

FooInstance.Foofunction.sendTransaction(var1,var2,varx,{from: web3.eth.accounts[0], gas:1000000});
FooInstance.Foofunction.sendTransaction(var3,var4,vary,{from: web3.eth.accounts[0], gas:1000000});

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.