mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 991 forks source link

Occasional `InvalidPow` after having mined a block #905

Closed ignopeverell closed 6 years ago

ignopeverell commented 6 years ago

Happened about a dozen times over the last 12h

Mar 28 12:23:18.645 DEBG receive_coinbase: built candidate output - Identifier(193f2372b7a4b0ecb84a), 506
Mar 28 12:23:18.645 DEBG receive_coinbase: BlockFees { fees: 0, height: 1523, key_id: Some(Identifier(193f2372b7a4b0ecb84a)) }
Mar 28 12:23:18.782 DEBG get_coinbase: BlockFees { fees: 0, height: 1523, key_id: Some(Identifier(193f2372b7a4b0ecb84a)) }
Mar 28 12:23:18.783 DEBG (Server ID: Port 13414) Built new block with 0 inputs and 1 outputs, network difficulty: 3, cumulative difficulty 15398
Mar 28 12:23:18.799 DEBG Rollbacking txhashset extension. sizes (3156, 3156, 3101)
Mar 28 12:23:18.799 DEBG (Server ID: Port 13414) Mining Cuckoo30 for max 90s on 15398 @ 1523 [6906ef35].
Mar 28 12:23:18.920 DEBG Found cuckoo solution! nonce 18062447192762667700 gave difficulty 9 (block diff 3)
Mar 28 12:23:19.869 INFO (Server ID: Port 13414) Found valid proof of work, adding block 1b9bdfa2.
Mar 28 12:23:19.870 DEBG pipe: process_block 1b9bdfa2 at 1523 with 0 inputs, 1 outputs, 1 kernels
Mar 28 12:23:19.870 ERRO pipe: validate_header failed for cuckoo shift size 30
Mar 28 12:23:19.870 INFO Rejected block 1b9bdfa2 at 1523: InvalidPow
Mar 28 12:23:19.870 ERRO (Server ID: Port 13414) Error validating mined block: InvalidPow
ignopeverell commented 6 years ago

May be related, after multiple of these, the server ended up crashing with:

mean_miner.hpp:883: void edgetrimmer::trimrename1(u32, u32) [with bool TRIMONV = true; u32 = unsigned int]: Assertionmaxnnid < NYZ2' failed.
ignopeverell commented 6 years ago

@tromp @yeastplume rings any bell?

tromp commented 6 years ago

That's certainly possible with ntrims == 240. I avoided further instances in the million nonce run by increasing to ntrims == 256, but grin.toml still has 240

yeastplume commented 6 years ago

I have a few of them in the yeastmonster as well.. I'll try updating the parameters locally as well

yeastplume commented 6 years ago

will see if https://github.com/mimblewimble/grin/pull/910 fixes