-
Notifications
You must be signed in to change notification settings - Fork 850
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
Support provhdr on Stratis AltCoin #692
base: master
Are you sure you want to change the base?
Conversation
Why do you need it btw? It seems those header are only interesting for software who wants to validate the headers. Clients who does not validate header can still use the old headers message right? And your full node does not depends on NBitcoin. |
Yes the client can still use the old headers message but new blocks are only announced using proven headers. Without this code the client doesn't get the headers for new blocks as their mined, but if it asks for it then it will get it. |
|
This came up trying to get CanScanUTXOSet() test to work in NBXplorer. This was failing when running strat node
I did some logging and this is the P2P when BTC runs those lines:
And this is what was happening with the strat node:
|
You should definitively announce blocks with header first. Basically so much software is built on the assumption that header first exist that even with this hack, you will get problem down the road. This need to be fixed at Stratis node level. |
Another idea: Instead of using a behavior, use a Filters have been done for this, and it means you don't have to add a new type of payload. |
Yes node.Filters sounds exactly what I need. I will give them a try and update this PR if I can get it to work. Thanks!! |
Filters looks like they would work but I have a problem. Filters are implemented using a ConcurrentDictionary which does not guarantee the ordering of the items. I need my filter to be executed first but because SlimChainBehavior and the other chain behaviors are also implemented using filters. Their filter gets executed before my filter gets a chance to preprocess it even though mine is added first. I have no way of ensuring my filter is the first to be executed. I think we need to replace the collection used for filters (ie ThreadSafeCollection) with something else so the order can be defined and the sequencing of filters is predictable and controllable? What do you think? Is there anything like that already in use in NBitcoin? |
@mikedennis yes I agree. Or refactoring |
Straits fullnode also has a way to use Perhaps using the gateway flag will be sufficient (I would even rename it to something that is not explicitly used for gateway nodes) Note: this flag may needs to come with a -whitelist and -addnode arguments |
878114e
to
24301c6
Compare
d114a5d
to
e4c0829
Compare
725a14b
to
bbcaf18
Compare
When receive provhdr messages on Stratis AltCoin ask for header using getheader so can sync properly when new blocks are mined.
This involved extending ConsensusFactory to be able to provide custom behaviors to handle the new message.
@dangershony