public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Marcel Jamin <marcel@jamin.net>
To: Jonathan Toomim <j@toom.im>
Cc: bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] An implementation of BIP102 as a softfork.
Date: Wed, 30 Dec 2015 14:57:08 +0100	[thread overview]
Message-ID: <CAAUq484dsvTSKTazj=J0zaqJxNQkSVyBS9H8pGZzDNyKhw_eVQ@mail.gmail.com> (raw)
In-Reply-To: <8E12B367-1A55-435F-9244-101C09094BDA@toom.im>

[-- Attachment #1: Type: text/plain, Size: 4205 bytes --]

I guess the same could be said about the softfork flavoured SW
implementation. In any case, the strategy pattern helps with code structure
in situations like this.

2015-12-30 14:29 GMT+01:00 Jonathan Toomim via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org>:

> As a first impression, I think this proposal is intellectually
> interesting, but crufty and hackish and should never actually be deployed.
> Writing code for Bitcoin in a future in which we have deployed a few
> generalized softforks this way sounds terrifying.
>
> Instead of this:
>
>     CTransaction GetTransaction(CBlock block, unsigned int index) {
>         return block->vtx[index];
>     }
>
> We might have this:
>
>     CTransaction GetTransaction(CBlock block, unsigned int index) {
>         if (!IsBIP102sBlock(block)) {
>             return block->vtx[index];
>         } else {
>             if (!IsOtherGeneralizedSoftforkBlock(block)) {
>                 // hooray! only one generalized softfork level to deal
> with!
>                 return
> LookupBlock(GetGSHashFromCoinbase(block->vtx[0].vin[0].scriptSig))->vtx[index];
>            } else {
>                throw NotImplementedError; // I'm too lazy to write
> pseudocode this complicated just to argue a point
>         }
>     }
>
> It might be possible to make that a bit simpler with recursion, or by
> doing subsequent generalized softforks in a way that doesn't have
> multi-levels-deep block-within-a-block-within-a-block stuff. Still: ugh.
>
>
>
>
> On Dec 29, 2015, at 9:46 PM, joe2015--- via bitcoin-dev <
> bitcoin-dev@lists.linuxfoundation.org> wrote:
>
> > Below is a proof-of-concept implementation of BIP102 as a softfork:
> >
> > https://github.com/ZoomT/bitcoin/tree/2015_2mb_blocksize
> >
> https://github.com/jgarzik/bitcoin/compare/2015_2mb_blocksize...ZoomT:2015_2mb_blocksize?diff=split&name=2015_2mb_blocksize
> >
> > BIP102 is normally a hardfork.  The softfork version (unofficial
> > codename BIP102s) uses the idea described here:
> >
> http://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-December/012073.html
> >
> > The basic idea is that post-fork blocks are constructed in such a way
> > they can be mapped to valid blocks under the pre-fork rules.  BIP102s
> > is a softfork in the sense that post-fork miners are still creating a
> > valid chain under the old rules, albeit indirectly.
> >
> > From the POV of non-upgraded clients, BIP102s circumvents the
> > block-size limit by moving transaction validation data "outside" of
> > the block.  This is a similar trick used by Segregated Witness and
> > Extension Blocks (both softfork proposals).
> >
> > From the POV of upgraded clients, the block layout is unchanged,
> > except:
> > - A larger 2MB block-size limit (=BIP102);
> > - The header Merkle root has a new (backwards compatible)
> >  interpretation;
> > - The coinbase encodes the Merkle root of the remaining txs.
> > Aside from this, blocks maintain their original format, i.e. a block
> > header followed by a vector of transactions.  This keeps the
> > implementation simple, and is distinct from SW and EB.
> >
> > Since BIP102s is a softfork it means that:
> > - A miner majority (e.g. 75%, 95%) force miner consensus (100%).  This
> >  is not true for a hardfork.
> > - Fraud risk is significantly reduced (6-conf unlikely depending on
> >  activation threshold).
> > This should address some of the concerns with deploying a block-size
> > increase using a hardfork.
> >
> > Notes:
> >
> > - The same basic idea could be adapted to any of the other proposals
> >  (BIP101, 2-4-8, BIP202, etc.).
> > - I used Jeff Garzik's BIP102 implementation which is incomplete (?).
> >  The activation logic is left unchanged.
> > - I am not a Bitcoin dev so hopefully no embarrassing mistakes in my
> >  code :-(
> >
> > --joe
> >
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>

[-- Attachment #2: Type: text/html, Size: 5845 bytes --]

  reply	other threads:[~2015-12-30 13:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  5:46 [bitcoin-dev] An implementation of BIP102 as a softfork joe2015
2015-12-30 10:33 ` Marco Falke
2015-12-30 16:27   ` joe2015
     [not found]     ` <CAKJqnrE7W8aRgracL1cy_hBLWpVsTAQL4qg4ViSP9aCHvM1yvA@mail.gmail.com>
2016-01-03  3:51       ` joe2015
2016-01-04 18:04         ` Nick ODell
2016-01-05  1:26           ` joe2015
2016-01-12  3:58             ` joe2015
2015-12-30 13:29 ` Jonathan Toomim
2015-12-30 13:57   ` Marcel Jamin [this message]
2015-12-30 14:19   ` Peter Todd
2015-12-30 14:31     ` Peter Todd
2015-12-30 15:00     ` Jonathan Toomim
2015-12-30 11:16 Martijn Meijering
2015-12-30 14:28 ` Peter Todd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAUq484dsvTSKTazj=J0zaqJxNQkSVyBS9H8pGZzDNyKhw_eVQ@mail.gmail.com' \
    --to=marcel@jamin.net \
    --cc=bitcoin-dev@lists.linuxfoundation.org \
    --cc=j@toom.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox