Skip to content

Conversation

@IPGlider
Copy link
Contributor

In getmempoolancestors, getmempooldescendants, getmempoolentry and getrawmempool RPCs size returns the virtual transaction size as defined in BIP 141. Renaming it to vsize makes it consistent with returned value and other calls such as getrawtransaction.

Related to #11218.

@fanquake
Copy link
Member

@IPGlider You'll also need to update test/functional/mining_prioritisetransaction.py. See the Travis build failure.

@IPGlider
Copy link
Contributor Author

@fanquake Thanks for letting me know. I have now fixed the tests. I will squash the commits if requested.

@Empact
Copy link
Contributor

Empact commented Apr 18, 2018

Squash please.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine this key-value pair is heavily relied upon. I'd prefer if we included both keys "size" and "vsize" with the same value for at least one release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @MarcoFalke, this is a breaking change.

If you feel that field size should be removed then you must deprecate it first, and wait for the next release to actually remove it. Not sure it's worth it as the description is clear.

@IPGlider IPGlider force-pushed the rename-size-to-vsize branch from 0252836 to 8a6d5fe Compare April 18, 2018 15:19
@IPGlider
Copy link
Contributor Author

I have kept the size field for compatibility as requested by @MarcoFalke. I also added a deprecation message and squashed the commits. Let me know if anything else is needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update note, something like In ... `vsize` was added and `size` is now deprecated ...

@IPGlider IPGlider force-pushed the rename-size-to-vsize branch 3 times, most recently from 2038f18 to 98e9e9a Compare April 19, 2018 14:55
@jnewbery
Copy link
Contributor

jnewbery commented May 8, 2018

Concept ACK. A couple of nitty suggestions:

  • return vsize before size (since the definition for size depends on vsize)
  • hide size behind a deprecation flag so it can be removed cleanly in the next version.

Needs rebase.

@IPGlider IPGlider force-pushed the rename-size-to-vsize branch from 98e9e9a to 1aaad6d Compare May 12, 2018 09:58
@IPGlider
Copy link
Contributor Author

@jnewbery Changed the order and rebased.

Could you please point me towards an example of how to hide size behind a deprecation flag?

@promag
Copy link
Contributor

promag commented May 12, 2018

@IPGlider See

if (IsDeprecatedRPCEnabled("accounts")) entry.pushKV("account", strSentAccount);

@IPGlider IPGlider force-pushed the rename-size-to-vsize branch from 1aaad6d to 5260616 Compare May 12, 2018 11:35
@IPGlider
Copy link
Contributor Author

Thanks @promag.

Hidden size behind a deprecation flag. Any further suggestions?

@laanwj
Copy link
Member

laanwj commented Jul 5, 2018

I'm not sure about this anymore - this came up in some discussions at the building on bitcoin conference. In practice almost no one knows what vsize is, and everyone that knows what it is likely already knows that all the sizes are virtual now.

@luke-jr
Copy link
Member

luke-jr commented Jul 7, 2018

People probably shouldn't use "size" if they don't know about vsize, so I think renaming it here still makes sense...

@maflcko
Copy link
Member

maflcko commented Jul 9, 2018

utACK 52606162ae1cc3c954de7a37411910784317315a

@maflcko
Copy link
Member

maflcko commented Jul 10, 2018

re-utACK 305330e818a410d5bb1f8fc2b6fea0442c3a06a0

@Empact
Copy link
Contributor

Empact commented Jul 11, 2018

Concept ACK - I'm in favor since we show virtual size in the gui as of at least: #12580

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but documentation could be improved for the deprecatedrpc option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should document that size is only returned if deprecatedrpc=size is in the config or passed as an argument to bitcoind. Perhaps:

           "    \"size\" : n,             (numeric) (DEPRECATED) same as vsize. Only returned if bitcoind is started with -deprecatedrpc=size\n"
           "                              `size` will be completely removed in v0.18.\n"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should document that size will only be returned if bitcoind is started with -deprecatedrpc=size.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 17, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #14802 (rpc: faster getblockstats using BlockUndo data by FelixWeis)
  • #14649 (RPC: add weight to mempool entry output by luke-jr)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@jnewbery
Copy link
Contributor

tACK 3bc922d.

Thanks for addressing my review comments. Sorry I didn't ACK earlier. I didn't notice that you'd updated the branch.

@maflcko
Copy link
Member

maflcko commented Nov 22, 2018

re-utACK 3bc922d

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 2, 2019

Needs rebase

getrawmempool RPCs, to be consistent with the returned value and other
RPCs such as getrawtransaction, vsize has been added and size is now
deprecated. size will only be returned if bitcoind is started with
-deprecatedrpc=size.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be moved to a separate file ./doc/release-notes-13008.md

@fanquake
Copy link
Member

I've rebased and fixed up the release notes in #15637.

@fanquake fanquake closed this Mar 22, 2019
maflcko pushed a commit that referenced this pull request Mar 26, 2019
e16b6a7 rpc: Rename size to vsize in mempool related calls (Miguel Herranz)

Pull request description:

  #13008 rebased on `master`, with release notes split out.

  > In getmempoolancestors, getmempooldescendants, getmempoolentry and getrawmempool RPCs size returns the virtual transaction size as defined in BIP 141. Renaming it to vsize makes it consistent with returned value and other calls such as getrawtransaction.
  >
  > Related to #11218.

ACKs for commit e16b6a:
  MarcoFalke:
    re-utACK e16b6a7
  jnewbery:
    utACK e16b6a7

Tree-SHA512: ce95260fe7f280eacf4ff70bfffe02315c3a521b3b462a34e72a05b90733f40cc473319ac2df05d3e3c12cb7b1fbf2a1bbea632a8f979fff94207854cdbd494d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants