Skip to content
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

Enable loud hard-fork detection #131

Closed
nathan-at-least opened this issue Mar 5, 2015 · 10 comments
Closed

Enable loud hard-fork detection #131

nathan-at-least opened this issue Mar 5, 2015 · 10 comments
Assignees
Labels
A-consensus Area: Consensus rules C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. D-economics Design issue: Economics I-SECURITY Problems and improvements related to security. in 1.0 network upgrade management S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. Zcash codebase

Comments

@nathan-at-least
Copy link
Contributor

This feature may be a fairly light configuration of an existing feature: #109 is for documenting the existing feature, and it links to this bitcoin-development message which alludes to the feature:

https://www.mail-archive.com/bitcoin-development@lists.sourceforge.net/msg06273.html

@nathan-at-least nathan-at-least added I-SECURITY Problems and improvements related to security. Zcash codebase potential feature C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. D-economics Design issue: Economics A-consensus Area: Consensus rules C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. labels Mar 5, 2015
@zookoatleastauthoritycom

#171 was a duplicate. It seems to me that if you, as a Zcoin node, have detected that you're on the short side of a fork, then it is unsafe to tell your user that they received any Zcoin. Any Zcoin that you tell your user they've received, at that point, could be invalidated out from under them if they subsequently upgrade to new software which switches to the longer branch of the chain. So as far as I can tell, once you've detected this condition, the only safe thing to do is to warn the user and refuse to process anymore incoming transactions ostensibly offered to your user.

@zookoatleastauthoritycom zookoatleastauthoritycom changed the title Enable loud hard-fork detection (and integrate feature w/ potential autoupdate and notary features). Enable loud hard-fork detection Jun 17, 2015
@zookoatleastauthoritycom

sipa says that this is currently implemented in bitcoin core:

sipa zooko: seems i am mistaken, and the fork warning will trigger safe mode
zooko sipa: Hm...
zooko sipa: are you looking at the code? Could you give me a pointer to this trigger connection?
sipa GetWarnings in main.cpp
sipa if that returns non-"" for RPC, init.cpp OnRPCCommand will disallow the RPC command
sipa if the RPC command does not have okSafeMode in rpcserver.cpp

@nathan-at-least
Copy link
Contributor Author

@nathan-at-least
Copy link
Contributor Author

It seems possible to notice being on either side of a fork (assuming you receive the block headers).

Presumably the core codebase doesn't propagate headers on other forks, so it may be hard to see a shorter fork, since those blocks will not propagate to your node.

@daira
Copy link
Contributor

daira commented Feb 3, 2016

I'd like to revisit whether this should be in 1.0, because I think that putting it in 1.0 would make it much easier to safely implement hard-forking post-1.0 changes.

@ebfull
Copy link
Contributor

ebfull commented Feb 3, 2016

+1 on revisiting this.

@zookozcash
Copy link

This seems to be related to #688. Perhaps #688 is an implementation of this which causes the node to freeze — ignoring all transactions — in case it detects a hard fork?

@ebfull ebfull added this to the 1.0 milestone Mar 15, 2016
@nathan-at-least nathan-at-least modified the milestones: 1.0, Consensus Code Security Freeze Mar 28, 2016
@zookozcash
Copy link

Unfortunately upstream Bitcoin-Core is talking about removing this from that codebase due to it being unsatisfactory in some way: https://botbot.me/freenode/bitcoin-core-dev/2016-03-31/?msg=63274564&page=2 They've been saying, in IRC chat, that they want to put back a "fixed" implementation of it in the future. I don't understand what's wrong with the current implementation or what fixed implementation they'd want.

@zookozcash
Copy link

Whoops, my mistake. The thing that they're talking about disabling is not the hard-fork-detector, it is the network-partition-detector: https://botbot.me/freenode/bitcoin-core-dev/2016-03-31/?msg=63275812&page=2 Thanks to sipa for clarifying!

@defuse
Copy link
Contributor

defuse commented Jun 9, 2016

#1009 makes it run the -alertnotify command when there's a hard fork and adds an RPC test that checks the hard fork detection.

@defuse defuse added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 9, 2016
zkbot pushed a commit that referenced this issue Jun 12, 2016
…k-alerts-and-tests, r=ebfull

Enable -alertnotify for hard fork detection. Test it.

Closes #171. Closes #131.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rules C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. D-economics Design issue: Economics I-SECURITY Problems and improvements related to security. in 1.0 network upgrade management S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. Zcash codebase
Projects
None yet
Development

No branches or pull requests

6 participants