public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: "Jeremy Spilman" <jeremy@taplink•co>
To: "Bitcoin Dev" <bitcoin-development@lists•sourceforge.net>,
	"Jeff Garzik" <jgarzik@bitpay•com>
Subject: Re: [Bitcoin-development] On OP_RETURN in upcoming 0.9 release
Date: Mon, 24 Feb 2014 14:12:10 -0800	[thread overview]
Message-ID: <op.xbs3yki1yldrnw@laptop-air> (raw)
In-Reply-To: <CAJHLa0PXHY1qisXhN98DMxgp11ouqkzYMBvrTTNOtwX09T1kZg@mail.gmail.com>

On Mon, 24 Feb 2014 09:10:26 -0800, Jeff Garzik <jgarzik@bitpay•com> wrote:
> This PR reduces the size to 40 bytes:
> https://github.com/bitcoin/bitcoin/pull/3737

Just quickly GLANCED at it, but if I understand correctly how the template  
matching code works, that will change max size of the <data> to 40 bytes  
but does not do anything to enforce most-efficient encoding.

   else if (opcode2 == OP_SMALLDATA)
   {
       // small pushdata, <= MAX_OP_RETURN_RELAY bytes
       if (vch1.size() > MAX_OP_RETURN_RELAY)
          break;
   }

This code was a bit hard for me to parse since it's not actually requiring  
any data, just disallowing more than a certain number of bytes of data. So  
a bare OP_RETURN would be allowed as well, for whatever good that will do.

If you want to strictly require no PUSHDATA, perhaps you could do:

   else if (opcode2 == OP_SMALLDATA)
   {
       // small pushdata, <= MAX_OP_RETURN_RELAY bytes
       if (opcode1 >= OP_PUSHDATA1 || vch1.size() > MAX_OP_RETURN_RELAY)
          break;
   }

Thanks,
Jeremy




  parent reply	other threads:[~2014-02-24 22:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 16:03 Jeff Garzik
2014-02-24 16:16 ` Pieter Wuille
2014-02-24 16:32   ` Jeff Garzik
2014-02-24 16:33   ` Jeff Garzik
2014-02-24 16:39 ` Wladimir
2014-02-24 16:45   ` Gavin Andresen
2014-02-24 16:50     ` Pavol Rusnak
2014-02-24 17:23   ` Mark Friedenbach
2014-02-24 23:06     ` Andreas Petersson
2014-02-24 23:13       ` Gregory Maxwell
2014-02-24 23:13       ` Luke-Jr
2014-02-28  5:25     ` Troy Benjegerdes
2014-02-28 14:42       ` Warren Togami Jr.
2014-02-28 19:25         ` Mark Friedenbach
2014-02-28 19:36           ` Justus Ranvier
2014-02-28 20:10         ` Drak
2014-02-24 17:10 ` Jeff Garzik
2014-02-24 22:12 ` Jeremy Spilman [this message]
2014-02-24 22:50   ` Jeff Garzik

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=op.xbs3yki1yldrnw@laptop-air \
    --to=jeremy@taplink$(echo .)co \
    --cc=bitcoin-development@lists$(echo .)sourceforge.net \
    --cc=jgarzik@bitpay$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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