public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@bitpay.com>
To: Addy Yeow <ayeowch@gmail.com>
Cc: "bitcoin-development@lists.sourceforge.net"
	<bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Missing fRelayTxes in version message
Date: Thu, 20 Jun 2013 09:35:11 -0400	[thread overview]
Message-ID: <CAJHLa0MrG3wkfQMRoeTp5nOwAcpLOVKd+c96NozTz=w3-0g4Jg@mail.gmail.com> (raw)
In-Reply-To: <CAA3bHnzrRijieFi5phXZfuHEU3eLrPcVJwXuPpUrepWCY7coQQ@mail.gmail.com>

On Thu, Jun 20, 2013 at 3:13 AM, Addy Yeow <ayeowch@gmail.com> wrote:
> I personally don't treat the relay field as optional, i.e. it is there as
> 0x01 if it is set. Otherwise, it is simply a trailing zero byte. Hence, the
> right way of reading the packet as with any network packet is to first
> retrieve the header information, get the actual payload length, then parse
> the payload accordingly. I can also choose to include 0x00 for my relay
> field in my outgoing packet and reflect that accordingly in my length field
> in the header.

That works until another field is added in the same manner.

Implementations are expected to follow the standard logic of

if (more data)
   parse field X
if (more data)
   parse field X+1
if (more data)
   parse field X+2
etc.

Ugly or not, there is no point in changing now.  Updating the version
message to a radically different design, for simply cleanliness
reasons, is not sufficient cause to migrate the entire bitcoin
universe to a new and different version/feature negotiation setup.

--
Jeff Garzik
Senior Software Engineer and open source evangelist
BitPay, Inc.      https://bitpay.com/



  reply	other threads:[~2013-06-20 13:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 13:03 [Bitcoin-development] Missing fRelayTxes in version message Paul Lyon
2013-06-19 13:20 ` Mike Hearn
2013-06-20  6:20   ` Turkey Breast
2013-06-20  7:10     ` Mike Hearn
2013-06-20  7:13     ` Addy Yeow
2013-06-20 13:35       ` Jeff Garzik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-18 17:45 Turkey Breast
2013-06-18 19:48 ` Mike Hearn
2013-06-18 22:30   ` Turkey Breast
2013-06-19  9:39     ` Mike Hearn
2013-06-19 10:33       ` Turkey Breast
2013-06-19 10:43         ` Mike Hearn

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='CAJHLa0MrG3wkfQMRoeTp5nOwAcpLOVKd+c96NozTz=w3-0g4Jg@mail.gmail.com' \
    --to=jgarzik@bitpay.com \
    --cc=ayeowch@gmail.com \
    --cc=bitcoin-development@lists.sourceforge.net \
    /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