-
Notifications
You must be signed in to change notification settings - Fork 347
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
Api doesn't return all blocks from subscribeNewHeads when equivocation happens #1744
Comments
This s not on the API layer itself, the subscription is just a thin wrapper around the RPC - all it does extra is to take the raw data and creates an API type from it. Even in the cases on forks, you will notice that the node will generally report more forks in the logs than what is received via RPC. I have had a discussion with @tomusdrw in the past for an additional RPC on Substrate (like subscribeNewHeads), that actually returns everything. The existing RPC is not really the correct avenue to receive everything (which could also include blocks in the past from forks, the current follows the best tip). |
Makes sense, had a long night yesterday. Should I close this and log it into substrate? |
Let's hear from @tomusdrw to see if there is a need, either already logged or possible to adjust into a new direction first. |
The RPC currently only reports blocks that are considered I don't think there is an issue logged in the substrate repo to expose "all heads" subscription, but it should be fairly easy to implement (just removing the filter line above and copy & pasting the rest). We could possibly just parametrize current method (but make it optional to maintain backward compatibility) instead of introducing a new one too. |
That would be perfect! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Not sure if this is polkadot-js/api, substrate related or both. I've got three development OSX machines on local network runing polkadot-kusama nodes trying to test and catch equivocations. My node version is
0.7.19-7c34a67
on all machines polkadot-js api version is1.0.0-beta.17
My bootstrap validator node (Alice) is running with command
command to run equivocating validator nodes (Bob) is
I'm listening to new blocks via
When validator nodes Equivocate, Bob1 returns block
0xBob1
, Bob2 returns block0xBob2
Alice receives0xBob1
or0xBob2
not both. It also logs this into terminal, while Bob1 and Bob2 act normally.Now, if I want to detect equivocation via polkadot-js/api I need to also
I need to compare heads on the same height, if I detect different blocks with the same author, since it will also trigger if there was a fork, I can detect equivocation.
The problem with this is it needs to run on all validator instances all the time to be detectable, because it will not trigger for
0xBob2
if it's the finalized block. It would be more predictable if every node received all the blocks just like when fork happens.Is there any better way to do this right now?
The text was updated successfully, but these errors were encountered: