A way to avoid (even more) energy waste in duniter

Hi guys!

After an answer I made on the FB groupe to someone who asked if the nodes calculating PoW (in Bitcoin and then DUniter) are consuming energy for nothing in case of some other find a block before it.
The answer is abviously yes for Bitcoin, but also for DUniter.

I then thought about an enhancement to make in DUniter nodes, and wanted your feeling about it before writing an issue ingitlab… (I also want to say that I’m enable to develop it :confused: )

The enhancement is to calculate an average MAX difficulty for the node be able to find a block, and then just disable the calculation of PoW until the custom difficulty decrease under this limit.

The determination of this limit is quite complicated though because if the node’s calculation is off sometime then it can’t know if this limit had moved… But we can imagine a 1st study phase with statistics creation on block issuance versus difficulty, and a 2nd phase of activation of this limit. And even an alternance of study/activation to get the better compromise.

You may also say that even if the difficulty is high because of a recent bloc issuance, the node have a tiny chance to calculate a block still.
I’ll answer to that: in an idea of collaboration and because money issuance is not related to bloc calculation the node owner may renounce on participation for few blocks until the probability of finding one is greater than energy waste…

1 Like

Its already the case :slight_smile:

Really?

Ok though… Good news!

@inso your docs papers are really needed though :wink:

I don’t think it is the case !
Like for now, if run duniter on a raspberry pi you will have very little chance to find a block but the raspberry will still try to find one.
I think what means @devingfx is that if the difficulty is too high compare to his computational power, the node him self do not compute PoW. For now if the difficulty is too high the node stop the computation of the PoW but it is not related to the node computation power it self.
I think it is doable and it could be instersting to do it.

I just push a merge request yesterday to reduce energy waste by reducing the computation power of the most powerful nodes. So the common difficulty will decrease and smaller nodes will be able to compute the PoW.


I think it will have more impact on the energy waste. Any review is welcome :slight_smile:

3 Likes

If I understand well what you explained it was not what I was saying, but your proposal is even better !! :slight_smile:

1 Like

It is never too high, because PoW has randomness in it. You may very weel find a level 128 proof (8 zeros) with a Raspberry on the very first try. For example we have several proofs of level 112 (7 zeros) whereas the average level is 84 (a bit more than 5 zeros), which is a really big difference!

However, each node knows when it has a handicap. In these moments, depending on the handicap, the node will just stop computing a PoW and wait for better conditions. This handicap is something appart from the exclusion mechanism, where of course the node just stops computing as well when it is in this zone.

The really big deal is to have each member to have at least 1 block in the current window. This block in the window is what horizontalizes the difficulty, and punish the biggest computation machines. Having at least 1 block in the window should be our goal.

3 Likes

Yes we agree on that !
But we could say that when the probability to find a block is very very low (with a given power computation and difficulty) then there is no use to try to find a block.
Like for now there is raspberry that are not finding any block since months. I think they should not try to find a block and wait for better conditions because it will be energy waste in 99.999% of the time for example.

1 Like

That’s weird, because @stephane says its Raspberry finds approximately 3 blocks a day.

Anyway, I would rather say “do not try to compute before the difficulty reaches the common level, and always try if we don’t have a block in the current window”.

1 Like

I confirm (2-3 blocks a day)!
You can see that in cesium.

1 Like

I can confirm that: my raspberry has found 7 blocks in the last 24h. :slight_smile: And when it does find a block, it stops computing for a while as expected.

2 Likes

@Vincent_Rousseau which version of Duniter are you using? Is the whole config (network, member key, etc) ok?

Thanks for return of experience on raspberry pi. Maybe, comments on raspberry not founding block where with older raspberry…

I just launch duniter (1.6.14) on my raspberry pi 3. It has not found a block since startup (3 days) but I don’t loose hope then :slight_smile:

Did you overclock you raspberry ?

Maybe the operating systems are different, and some CPU optimizations are lost with a different kernel.

Are you sure it even tries to find proofs? You can grep on “zeros” to check that.

1 Like

Not at all. :slight_smile: It is a simple raspberry 3 running the stock raspbian. I do add some little cooling on the processor (a little radiator and a PC fan running on 5V, just reusing what I have around), otherwise it tends to get a little hot.
I don’t see your node on the network with your member identity. Did you configure the “Settings/Crypto” tab on your node to specify your identity? How much CPU percentage is dedicated to Duniter? Is your node actually calculating anything? (on the right hand side of the main screen in the “Blocks made by this key”, does it show some hex values like #0072F2 and so on?) Is it even in sync with the network? (what is your current block #?) Is the network config correct? There are quite a few things to double check here, no doubt. In 3 days it should definitely find something.

Here are my last lines of logs : https://framabin.org/?f9cfb0dada0fd9a0#AhLiAz/BIySQEdRHMuyjH6g2ne/83IWFrE5ZRCkH7bU=

It seems that everything is fine. But I just saw that the CPU is at 60%.

Now I see your node as “Private access” in cesium. Maybe there is a problem with that mode?
Can you do the following:

cd .config/duniter/duniter_default
grep FOUND duniter.log

and see if there are any results for that? Then if there is, maybe you should check just after these lines what the log says?

1 Like

It was just bad luck :slight_smile: I do not have access to my node but Remuniter says I found 2 blocks this night !

2 Likes