Skip to content

Conversation

@jnewbery
Copy link

As part of BIP 141, transaction sizes have been replaced by virtual size (with witness data discounted). Code comments and rpc help text have not been updated everywhere to reflect this change.

This PR fixes various comments and rpc help text.

@jnewbery
Copy link
Author

I've built and tested the changes.

Copy link

@sdaftuar sdaftuar left a comment

Choose a reason for hiding this comment

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

One nit, but otherwise looks good to me.

As a matter of good practice, in addition to building your changes locally, you should also locally run the tests (make check + qa/pull-tester/rpc-tests.py) to make sure nothing inadvertently broke.

Choose a reason for hiding this comment

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

nit: I might drop the word virtual here? I think the last sentence explains sufficiently...

Copy link
Author

Choose a reason for hiding this comment

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

ACK

Choose a reason for hiding this comment

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

This doesnt elucidate what this is to me - maybe the second sentence should be like "Differs from size for witness transactions as this does not include the witness data" or something like that (I dont actually know what its supposed to be).

Choose a reason for hiding this comment

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

His language is very similar to the explanatory text for "vsize" used in the rawtransaction rpc's. Unfortunately, BIP 141 doesn't define virtual transaction size, but I think the best way to wrap this up would be to use the term virtual size here, and then suggest that they update the BIP to define it as well.

Here, virtual size refers to 1/4 of the transaction weight (so base_tx_bytes + witness_size/4).

Copy link
Author

Choose a reason for hiding this comment

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

@sdaftuar I've opened a PR against the BIPS repository: ChaincodeResidency/bips#1

Copy link

@TheBlueMatt TheBlueMatt Sep 15, 2016

Choose a reason for hiding this comment

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

Seems reasonable, though you might have write "See BIP 141" instead of just "BIP 141" :).

Copy link
Author

Choose a reason for hiding this comment

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

Sure thing. Please see 73b772d

Copy link

@sdaftuar sdaftuar left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just make sure you squash these down to one commit before opening the PR upstream.

Since you reference definitions in the BIP, you may want to open the BIP PR first (I'll review that now) and then in the PR text for this pull, link to your BIP 141 update PR as well.

@jnewbery
Copy link
Author

I've opened a pull request to bitcoin/bitcoin. Closing this PR.

@jnewbery jnewbery closed this Sep 29, 2016
@amitiuttarwar amitiuttarwar mentioned this pull request Aug 22, 2019
16 tasks
jnewbery pushed a commit that referenced this pull request Oct 30, 2019
…ter-return checking

8d22ab0 ci: Enable address sanitizer (ASan) stack-use-after-return checking (practicalswift)

Pull request description:

  Enable address sanitizer (ASan) stack-use-after-return checking (`detect_stack_use_after_return=1`).

  Example:

  ```
  #include <iostream>
  #include <string>

  const std::string& get_string(int i) {
      return std::to_string(i);
  }

  int main() {
      std::cout << get_string(41) << "\n";
  }
  ```

  Without address sanitizer (ASan) stack-use-after-return checking:

  ```
  $ ./stack-use-after-return

  $
  ```

  With address sanitizer (ASan) stack-use-after-return checking:

  ```
  $ ASAN_OPTIONS="detect_stack_use_after_return=1" ./stack-use-after-return
  =================================================================
  ==10400==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f7fa0400030 at pc 0x00000049d2cc bp 0x7ffcbd617070 sp 0x7ffcbd616820
  READ of size 2 at 0x7f7abbecd030 thread T0
      #0 0x439781 in fwrite
      #1 0x7f7ac0504cb3 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x113cb3)
      #2 0x4f9b5f in main stack-use-after-return.cpp:9:15
      #3 0x7f7abf440b96 in __libc_start_main
      #4 0x41bbc9 in _start
  …
  $
  ```

Top commit has no ACKs.

Tree-SHA512: 6557a9ff184023380fd9aa433cdf413e01a928ea99dbc59ec138e5d69cb9e13592e8bb5951612f231ff17a37a895bec5c0940c8db5f328a5c840a5771bdeeba5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants