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

Soft fork for BIP16, segwit and others #239

Open
domob1812 opened this issue Jul 5, 2018 · 16 comments

Comments

Projects
None yet
4 participants
@domob1812
Copy link

commented Jul 5, 2018

There are a couple of soft forks that have gone through long ago in upstream Bitcoin but not yet in Namecoin. The most important ones are BIP16 and Segwit. BIP16 has not been activated yet as it was activated in Bitcoin through a scheduled time instead of through BIP34, and we never explicitly scheduled it in Namecoin after upgrading to Namecoin Core (while the BIP34 forks went through automatically). Segwit has not been activated because versionbits/BIP9 conflicts with merge mining.

Not having those forks is both a loss in functionality (mainly for BIP16) and a burden/risk when merging upstream changes, as Bitcoin might change things with the assumption that those forks are already done. Thus I think we should finally get them activated.

I already added a parameter for setting an activation height including for segwit (to get around the BIP9 issue) in 4cf6ddb. So all that remains is coordinating mainly with the biggest miners on an actual height and finalising it. I want to use this issue for tracking the effort.

@domob1812 domob1812 added the meta label Jul 5, 2018

@domob1812

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

Top mining pools and contact information for them: https://forum.namecoin.org/viewtopic.php?f=6&p=17489

I'll try to get in touch with everyone and inquire if they are willing to support such a fork (I don't see a reason why not) and how much time they would need in advance.

@domob1812

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

@wangchun: Would you support such a fork and if so, how much advance notice do you need? I'm currently thinking of something like three months. Would that be sufficient? (We can also wait longer - we've now been talking about forks for years already without doing any....)

@domob1812

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

Contacted Slush through their contact form, BTC.com and ViaBTC through their support email addresses. @JeremyRand - I'm not on Twitter, could you perhaps take care of pointing the BTC.top CEO to this issue?

If we get support from F2Pool, Slush, BTC.com, BTC.top and ViaBTC, then we have around 88% of the hash rate covered. Then I think it would be fine to just announce the planned fork on various threads publicly and schedule it three months in advance or something.

@YihaoPeng

This comment has been minimized.

Copy link

commented Jul 5, 2018

Hi I'm the BTC.com's maintainer and I have read your email. We support and welcome this soft fork.

In addition, because this soft fork doesn‘t seem to have any effect on the merge mining, we should be able to complete the upgrade very quickly. It will take about 1 to 2 days to upgrade all the nodes. We can start the upgrade at any date.

So what is your plan? When should I upgrade these nodes and how do I configure it (about the parameter for setting the activation height including for segwit)?

@domob1812

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

Thanks @YihaoPeng for the quick reply - that sounds great! I've not yet set a fork height in the code, so for now, there's no need to update. I'll coordinate with other big pools as well and then fix the height. Once that is done and an upgrade is required from your side, I'll ping this thread and mention you.

@wangchun

This comment has been minimized.

Copy link

commented Jul 5, 2018

@domob1812 Three months good to me.

@JeremyRand

This comment has been minimized.

Copy link
Member

commented Jul 6, 2018

@domob1812 As I alluded to on the forum, there are some edge cases introduced by P2SH and SegWit (mostly SegWit) that I'd like to make sure we have test cases for. I've been busy for the last few weeks due to other areas of dev and some deadlines for DWS submissions, but both of those have quieted down as of today, so I'll inspect the existing test cases in the next day or two and file issues for anything I think we need to test for.

EDIT: To be clear, I don't have any specific reason to believe we have any bugs in the P2SH or SegWit integration -- I just want to make sure that things are tested for, since having something unexpectedly go wrong would be highly bad.

@domob1812

This comment has been minimized.

Copy link
Author

commented Jul 7, 2018

@JeremyRand - sounds good. There is plenty of time before this would actually go live (three months at least), so there is also no particular hurry. We've had some P2SH testing for a long time, both in unit and regression tests - but it is always good for a second check, so please take a look and let me know (issues are perfect) about anything you feel like it needs more tests.

In addition, the activation of the soft forks should not by itself cause any issues even if there were bugs. We only need to make sure that all interactions between P2SH / Segwit and Namecoin are good before we tell people that multisig is now safe with Namecoin and/or change the default address type to Segwit.

@JeremyRand

This comment has been minimized.

Copy link
Member

commented Jul 8, 2018

In addition, the activation of the soft forks should not by itself cause any issues even if there were bugs. We only need to make sure that all interactions between P2SH / Segwit and Namecoin are good before we tell people that multisig is now safe with Namecoin and/or change the default address type to Segwit.

@domob1812 The things I want to add tests for actually would cause problems in such a case, because incorrect behavior could conceivably cause the softfork to become a hardfork, and/or require a hardfork to fix if P2SH and SegWit are already activated.

@domob1812

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

Slush gave their support by email. I've not yet heard from ViaBTC. @JeremyRand, did you try to contact BTC.top via Twitter yet?

@domob1812

This comment has been minimized.

Copy link
Author

commented Apr 8, 2019

In namecoin/meta#51, we decided that we should go for Segwit with Bitcoin's block weight at least initially (and then see how the situation evolves and consider lowering the weight limit as needed later on). This means that all that remains to do is schedule the softfork. @JeremyRand, can you confirm that I did not miss any other blockers from your point of view?

We should set the fork heights to blocks maybe in a month for testnet and six months for mainnet, and include that as well in the upcoming 0.18 release.

@JeremyRand

This comment has been minimized.

Copy link
Member

commented Apr 8, 2019

@domob1812 AFAIK the softforks activated here are P2SH, CSV, and SegWit, correct? Are there any others? P2SH and SegWit now have unit tests to verify that they don't misbehave with name scripts, so I think those are good to go. I can't think of any reason why CSV could possibly interact badly with Namecoin's changes compared to Bitcoin, so I think that's okay as well. If those are the only 3 softforks activated, then I don't think there are any blockers from my end.

@domob1812

This comment has been minimized.

Copy link
Author

commented Apr 8, 2019

Yes, it is only those. Ok cool! Then I suggest this as the next steps: As soon as Bitcoin releases the final 0.18.0, I will set the soft fork for six months ahead on mainnet and one month on testnet, and release Namecoin 0.18.0 based on Bitcoin 0.18.0 including the softfork trigger.

domob1812 added a commit to domob1812/namecore that referenced this issue May 3, 2019

Schedule segwit activation softfork.
This schedules a softfork activating BIP16 (P2SH), Segwit and
CSV at a future blockheight on mainnet and testnet.

On mainnet, the activation will happen at block 475,000, which is
expected to be mined in about half a year.  On testnet, the activation
happens at block 232,000, or in one or two weeks (but depending strongly
on the mining activity on testnet).

See namecoin#239 for a discussion,
including the commitment to update timely by many of the most important
mining pools.
@domob1812

This comment has been minimized.

Copy link
Author

commented May 3, 2019

Proposed activation is in #302. Please take a look and give feedback there (especially if you do not agree with the proposed activation heights).

domob1812 added a commit that referenced this issue May 13, 2019

Merge #302: Schedule segwit activation softfork.
80d8cea Schedule segwit activation softfork. (Daniel Kraft)

Pull request description:

  This schedules a softfork activating BIP16 (P2SH), Segwit and CSV at a future blockheight on mainnet and testnet.

  On mainnet, the activation will happen at block **475,000**, which is expected to be mined in about half a year.  On testnet, the activation happens at block 232,000, or in one to two weeks (but depending strongly on the mining activity on testnet).

  See #239 for a discussion, including the commitment to update timely by many of the most important
  mining pools.

ACKs for commit 80d8ce:

Tree-SHA512: 8ee37fbba059c60338c03a2ecc6aa624f89dc849d3a4489df1c5fc91c6c7f832fa2d853a8438771a1ca382ea0cb28e2f1acd5cd6d3b0770807f5013663b63064

domob1812 added a commit to domob1812/namecore that referenced this issue May 13, 2019

Schedule segwit activation softfork.
This schedules a softfork activating BIP16 (P2SH), Segwit and
CSV at a future blockheight on mainnet and testnet.

On mainnet, the activation will happen at block 475,000, which is
expected to be mined in about half a year.  On testnet, the activation
happens at block 232,000, or in one or two weeks (but depending strongly
on the mining activity on testnet).

See namecoin#239 for a discussion,
including the commitment to update timely by many of the most important
mining pools.
@domob1812

This comment has been minimized.

Copy link
Author

commented May 13, 2019

Version 0.18.0 has just been released with a scheduled segwit activation. @YihaoPeng, @wangchun and everyone else, please make sure to update timely.

@JeremyRand

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

@YihaoPeng @wangchun Just checking, have BTC.COM and F2Pool upgraded to Namecoin Core 0.18.0 yet? (I'm reaching out to mining pools to gauge how much hashrate has already upgraded.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.