-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix consensus #425
fix consensus #425
Conversation
This fix is more related to avoiding communication after block is sent and verification of signatures, not so much related to the commit phase we have been working, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes! Seem to allow PrepareResponse to arrive prior to PrepareRequest, which happens a lot in practice. Usually timer used to finish together with block relay too, good fix... now with Akka I haven't seen anymore.
@erikzhang could you explain what happend here? why the necesity of review the signatures? neo/neo/Consensus/ConsensusService.cs Lines 252 to 257 in 92e55f1
|
What if a normal RPC inject this, Shargon? |
I think its not reviewing signatures shargon, its allowing to.keep sigs from PrepReponse if PrepRequest arrives later.. the previous code was dropping useful signatures I guess. |
Yes |
It seems good for me, we will test it! :) |
I updated it again and solved the consensus problem that is now facing. Please review it again. @shargon @vncoelho @igormcoelho |
Double checked, @erikzhang. Great job and precise. |
Erik, what if you verify the transactions Line 382 in c2d7bd4
|
@erikzhang This change just feels redundant to me, because these tx are supposed to exist on mempool already... so perhaps it's something I didn't get. The most important is to get Neo safer and safer now, even if it costs performance temporarialy, so I agree with the changes. |
@erikzhang if a CN doesn't have a TX, where he asking for it? |
If there are a large number of transactions in the memory pool, it takes a lot of time to re-verify them all.
After the block is persisted, all transactions in the memory pool must be re-verified.
neo/neo/Consensus/ConsensusService.cs Lines 325 to 330 in c2d7bd4
The |
Thanks, Erik.
Does this re-verifiying occurs naturally at the One last question and summary, Erik. 🗡️
Thanks for the patient. Following this reasoning, one could see this |
Tested on private net and working fine.
|
I would prefer to re-verify the pending TXs in |
If there are a lot of transactions in the memory pool, it will take a long time to re-verify them. And it will block the consensus. That's why I move them into |
This lock the state when a Block was sent, right? do you think that is needed the commit phase after this PR? |
@erikzhang, I agree with you that we should not re-verify at OnPersist. I think that this With this PR the Backups will be able to speed up the process of getting a hash that they do not know. |
Right. |
Lets go for it and then we can merge with the commit phase for finally tackling that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikzhang, last time question... 🔢
byte[] hashData = context.MakeHeader()?.GetHashData(); | ||
if (hashData == null) | ||
{ | ||
context.Signatures[payload.ValidatorIndex] = message.Signature; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikzhang, I am double checking here and just to be sure I am thinking why message.Signature
is assigned here to the Signatures array.
Should not it be context.Signatures[payload.ValidatorIndex] = null
?
If the hashData is null it means that the payload is kind of empty, right?
I think @igormcoelho has answered your question:
|
That part of reviewing signatures I understood (I think, eahueauea). I mean this line neo/neo/Consensus/ConsensusService.cs Line 296 in 4407478
Should not it be context.Signatures[payload.ValidatorIndex] = null; ?
Because Node It it is neo/neo/Consensus/ConsensusService.cs Line 85 in 4407478
|
No description provided.