piotr_n



Offline



Activity: 2040

Merit: 1062





aka tonikt







LegendaryActivity: 2040Merit: 1062aka tonikt 1hash pool just mined an invalid block again July 23, 2017, 09:06:08 AM #1



Well, not sure that kind of software 1hash pool uses, but they have just mined their second invalid block.



It's easy to find them these days, because nodes relay them before fully verifying.



The first invalid block they mined was #474294, with hash 00000000000000000182acdf5657c93a0769dc6f9004047496b2e15efc6a4232

The second one, just a few hours ago #477115, with hash 0000000000000000013ee4a86822d37a061732e04ee5f41fb77168f193363d1b



You can download both of them from here:

http://gocoin.pl/1hash/474294-00000000000000000182acdf5657c93a0769dc6f9004047496b2e15efc6a4232.bin

http://gocoin.pl/1hash/477115-0000000000000000013ee4a86822d37a061732e04ee5f41fb77168f193363d1b.bin



I haven't checked yet why exactly they are invalid, but I think the order of the transactions inside the block is screwed up.

They use an input from a tx that is only created later in the block.



I'm thinking they must be using come customised mining software which (sometimes) assembles the block incorrectly.

So I thought I'd let them know, before they mine the third broken block, still without anyone noticing Not sure if it is on any interest for anyone here, but I remember once, when a BU node mined an invalid block, people were shitting themselves all over the internet.Well, not sure that kind of software 1hash pool uses, but they have just mined their second invalid block.It's easy to find them these days, because nodes relay them before fully verifying.The first invalid block they mined was #474294, with hash 00000000000000000182acdf5657c93a0769dc6f9004047496b2e15efc6a4232The second one, just a few hours ago #477115, with hash 0000000000000000013ee4a86822d37a061732e04ee5f41fb77168f193363d1bYou can download both of them from here:I haven't checked yet why exactly they are invalid, but I think the order of the transactions inside the block is screwed up.They use an input from a tx that is only created later in the block.I'm thinking they must be using come customised mining software which (sometimes) assembles the block incorrectly.So I thought I'd let them know, before they mine the third broken block, still without anyone noticing Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.

PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E

achow101

Legendary





Offline



Activity: 2254

Merit: 3456





bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl







ModeratorLegendaryActivity: 2254Merit: 3456bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl Re: 1hash pool just mined an invalid block again July 23, 2017, 05:56:43 PM

Last edit: July 23, 2017, 06:18:32 PM by achow101 #2 Both blocks are invalid because they included a transaction without including its unconfirmed parent.



I checked block 474294 and it contained transaction a6655ca47c62ffcbf6d3dcba34bc1af24a1eb0bcea54d3099d36201a66aec2a0 but not its parent transaction b11a78c6c61af1cb37586f639050d74b95c2b0fd525623b6cb6a4bb4fba46a0e.



I'm still checking block 477115 for which transaction it is missing, but it triggered the same error message as 474294, so I believe it is caused by the same problem.



Update: Block 477115 is actually more interesting than 474294. It contains the transaction 7a122ef22468e4af16b010d7acf7aa81e5af3636423c613fd98246c179d79800 which is missing its parent 9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d. But the interesting part is that the parent transaction is actually lower down in the block. So the problem here is that the transactions are in the wrong order, which means that they are probably permuting the order of their transactions.



One thing to notice is that 477115 contains 256 transactions and 474294 contains 255 transactions, both of which are good numbers of transactions to have for asicboost. Furthermore, this problem could be caused by permuting transactions as would need to be done for asicboost.



Edit: corrected transaction counts GitHub | GPG Key Fingerprint 0x17565732E08E5E41 Bitcoin Core contributor | Tip Me!: bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl

piotr_n



Offline



Activity: 2040

Merit: 1062





aka tonikt







LegendaryActivity: 2040Merit: 1062aka tonikt Re: 1hash pool just mined an invalid block again July 23, 2017, 06:18:36 PM #4 Quote from: achow101 on July 23, 2017, 05:56:43 PM Both blocks are invalid because they included a transaction without including its unconfirmed parent.



For what I can see the transaction is there, but is placed later in the block.



See the 477115 one...



In this block, tx number 22 (while 0 is coinbase) is spending output 1 from txid 9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d



9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d is included in that block, but at index 90 - so too late.



I believe 474294 had a similar problem, because I think I was checking it back them when in happened.

For what I can see the transaction is there, but is placed later in the block.See the 477115 one...In this block, tx number 22 (while 0 is coinbase) is spending output 1 from txid 9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d is included in that block, but at index 90 - so too late.I believe 474294 had a similar problem, because I think I was checking it back them when in happened. Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.

PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E

piotr_n



Offline



Activity: 2040

Merit: 1062





aka tonikt







LegendaryActivity: 2040Merit: 1062aka tonikt Re: 1hash pool just mined an invalid block again July 24, 2017, 01:03:51 PM #8 Quote from: spin on July 24, 2017, 10:52:02 AM How do you analyse the block after the fact? I mean what tools do you use etc.



It's more of a process, rather than a tool.



E.g. for #477115



My node informed be that it rejected the block with a message like this:

Code: AcceptBlock: Unknown input TxID: 9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d

Looking into the code of the node, I see that this basically means that the block was trying to spend an input from an "non-existing" transaction (its ID is printed)



So I save the block on a disk in a separate file and then use a code like this:

Code: package main



import (

"fmt"

"io/ioutil"

"github.com/piotrnar/gocoin/lib/btc"

)



func main() {

d, _ := ioutil.ReadFile("477115-0000000000000000013ee4a86822d37a061732e04ee5f41fb77168f193363d1b.bin")

println(d)

bl, _ := btc.NewBlock(d)

println(bl)

bl.BuildTxList()

println(len(bl.Txs))

for i, tx := range bl.Txs {

fmt.Println(i, tx.Hash.String())

for ii, inp := range tx.TxIn {

fmt.Println(" ", ii, inp.Input.String())

}

}

}

... it will print all the TxID inside the block, as well as the inputs they are spending:



Browsing the results for the problematic TxID (9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d), I see it in two places:



Code: 22 7a122ef22468e4af16b010d7acf7aa81e5af3636423c613fd98246c179d79800

0 9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d-001



[...]



90 9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d

0 796c96815be92f9351cbdd0cb52df426d4af18504a3734a3a4a8f5352555c4f2-000

This means that tx number 22 was trying to spend output from tx number 90.

Meaning: invalid block.





As for the other block (#474294)

Looking for the missing tx (b11a78c6c61af1cb37586f639050d74b95c2b0fd525623b6cb6a4bb4fba46a0e), you don't find it inside the invalid block.

So you go to blockchain.info and look for it:

There you see that it was confirmed in (alternative) block #474294.

Which gets you to the conclusion that if (any) block #474294 was trying to spend it, while not including it, it obviously is the reason for it to be invalid. It's more of a process, rather than a tool.E.g. for #477115My node informed be that it rejected the block with a message like this:Looking into the code of the node, I see that this basically means that the block was trying to spend an input from an "non-existing" transaction (its ID is printed)So I save the block on a disk in a separate file and then use a code like this:... it will print all the TxID inside the block, as well as the inputs they are spending: https://pastebin.com/LtMKi8pC Browsing the results for the problematic TxID (9639dd073e67efc879abb1075fafa4fa23d5fa427c129b2b1dd4f5a5520b408d), I see it in two places:This means that tx number 22 was trying to spend output from tx number 90.Meaning: invalid block.As for the other block (#474294)Looking for the missing tx (b11a78c6c61af1cb37586f639050d74b95c2b0fd525623b6cb6a4bb4fba46a0e), you don't find it inside the invalid block.So you go to blockchain.info and look for it: https://blockchain.info/tx/b11a78c6c61af1cb37586f639050d74b95c2b0fd525623b6cb6a4bb4fba46a0e There you see that it was confirmed in (alternative) block #474294.Which gets you to the conclusion that if (any) block #474294 was trying to spend it, while not including it, it obviously is the reason for it to be invalid. Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.

PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E PGP fingerprint: AB9E A551 E262 A87A 13BB 9059 1BE7 B545 CDF3 FD0E

TechPriest



Offline



Activity: 383

Merit: 276





Finis coronat opus







Sr. MemberActivity: 383Merit: 276Finis coronat opus Re: 1hash pool just mined an invalid block again July 24, 2017, 03:01:08 PM #11 Quote from: zawy on July 24, 2017, 02:16:18 PM Is it true that SW2x is preferred by some miners over SW because the set block size allows asicboost to work?



No. I don't think so, because in fact SW2x it's the same as SW. (BIP 91 and BIP 141 it's just different ways to implement SW)

Very interesting thread, thank for it, TS.

I have one question: What will happen to theese invalid blocks? They rejected by all nodes and became orphans or what? No. I don't think so, because in fact SW2x it's the same as SW. (BIP 91 and BIP 141 it's just different ways to implement SW)Very interesting thread, thank for it, TS.I have one question: What will happen to theese invalid blocks? They rejected by all nodes and became orphans or what? In science we trust!